gitlab.com/Raven-IO/raven-delve@v1.22.4/pkg/proc/native/nonative_darwin.go (about)

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