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