github.com/undoio/delve@v1.9.0/pkg/proc/native/nonative_darwin.go (about)

     1  //go:build darwin && !macnative
     2  // +build darwin,!macnative
     3  
     4  package native
     5  
     6  import (
     7  	"errors"
     8  	"sync"
     9  
    10  	"github.com/undoio/delve/pkg/dwarf/op"
    11  	"github.com/undoio/delve/pkg/proc"
    12  	"github.com/undoio/delve/pkg/proc/amd64util"
    13  	"github.com/undoio/delve/pkg/proc/internal/ebpf"
    14  )
    15  
    16  var ErrNativeBackendDisabled = errors.New("native backend disabled during compilation")
    17  
    18  // Launch returns ErrNativeBackendDisabled.
    19  func Launch(_ []string, _ string, _ proc.LaunchFlags, _ []string, _ string, _ [3]string) (*proc.Target, error) {
    20  	return nil, ErrNativeBackendDisabled
    21  }
    22  
    23  // Attach returns ErrNativeBackendDisabled.
    24  func Attach(_ int, _ []string) (*proc.Target, error) {
    25  	return nil, ErrNativeBackendDisabled
    26  }
    27  
    28  // waitStatus is a synonym for the platform-specific WaitStatus
    29  type waitStatus struct{}
    30  
    31  // osSpecificDetails holds information specific to the OSX/Darwin
    32  // operating system / kernel.
    33  type osSpecificDetails struct{}
    34  
    35  // osProcessDetails holds Darwin specific information.
    36  type osProcessDetails struct{}
    37  
    38  func (os *osProcessDetails) Close() {}
    39  
    40  func killProcess(pid int) error {
    41  	panic(ErrNativeBackendDisabled)
    42  }
    43  
    44  func registers(thread *nativeThread) (proc.Registers, error) {
    45  	panic(ErrNativeBackendDisabled)
    46  }
    47  
    48  func (dbp *nativeProcess) loadProcessInformation(wg *sync.WaitGroup) {
    49  	panic(ErrNativeBackendDisabled)
    50  }
    51  
    52  func (dbp *nativeProcess) requestManualStop() (err error) {
    53  	panic(ErrNativeBackendDisabled)
    54  }
    55  
    56  func (dbp *nativeProcess) resume() error {
    57  	panic(ErrNativeBackendDisabled)
    58  }
    59  
    60  func (dbp *nativeProcess) trapWait(pid int) (*nativeThread, error) {
    61  	panic(ErrNativeBackendDisabled)
    62  }
    63  
    64  func (dbp *nativeProcess) stop(cctx *proc.ContinueOnceContext, trapthread *nativeThread) (*nativeThread, error) {
    65  	panic(ErrNativeBackendDisabled)
    66  }
    67  
    68  func (dbp *nativeProcess) updateThreadList() error {
    69  	panic(ErrNativeBackendDisabled)
    70  }
    71  
    72  func (dbp *nativeProcess) kill() (err error) {
    73  	panic(ErrNativeBackendDisabled)
    74  }
    75  
    76  func (dbp *nativeProcess) detach(kill bool) error {
    77  	panic(ErrNativeBackendDisabled)
    78  }
    79  
    80  // EntryPoint returns the entry point for the process,
    81  // useful for PIEs.
    82  func (dbp *nativeProcess) EntryPoint() (uint64, error) {
    83  	panic(ErrNativeBackendDisabled)
    84  }
    85  
    86  func (dbp *nativeProcess) SupportsBPF() bool {
    87  	panic(ErrNativeBackendDisabled)
    88  }
    89  
    90  func (dbp *nativeProcess) SetUProbe(fnName string, goidOffset int64, args []ebpf.UProbeArgMap) error {
    91  	panic(ErrNativeBackendDisabled)
    92  }
    93  
    94  func (dbp *nativeProcess) GetBufferedTracepoints() []ebpf.RawUProbeParams {
    95  	panic(ErrNativeBackendDisabled)
    96  }
    97  
    98  // SetPC sets the value of the PC register.
    99  func (t *nativeThread) setPC(pc uint64) error {
   100  	panic(ErrNativeBackendDisabled)
   101  }
   102  
   103  // SetReg changes the value of the specified register.
   104  func (thread *nativeThread) SetReg(regNum uint64, reg *op.DwarfRegister) error {
   105  	panic(ErrNativeBackendDisabled)
   106  }
   107  
   108  // ReadMemory reads len(buf) bytes at addr into buf.
   109  func (t *nativeThread) ReadMemory(buf []byte, addr uint64) (int, error) {
   110  	panic(ErrNativeBackendDisabled)
   111  }
   112  
   113  // WriteMemory writes the contents of data at addr.
   114  func (t *nativeThread) WriteMemory(addr uint64, data []byte) (int, error) {
   115  	panic(ErrNativeBackendDisabled)
   116  }
   117  
   118  func (t *nativeThread) resume() error {
   119  	panic(ErrNativeBackendDisabled)
   120  }
   121  
   122  func (t *nativeThread) singleStep() error {
   123  	panic(ErrNativeBackendDisabled)
   124  }
   125  
   126  func (t *nativeThread) restoreRegisters(sr proc.Registers) error {
   127  	panic(ErrNativeBackendDisabled)
   128  }
   129  
   130  func (t *nativeThread) withDebugRegisters(f func(*amd64util.DebugRegisters) error) error {
   131  	return proc.ErrHWBreakUnsupported
   132  }
   133  
   134  // Stopped returns whether the thread is stopped at
   135  // the operating system level.
   136  func (t *nativeThread) Stopped() bool {
   137  	panic(ErrNativeBackendDisabled)
   138  }
   139  
   140  // SoftExc returns true if this thread received a software exception during the last resume.
   141  func (t *nativeThread) SoftExc() bool {
   142  	panic(ErrNativeBackendDisabled)
   143  }
   144  
   145  func initialize(dbp *nativeProcess) error { return nil }