2021-07-31 15:16:26 +00:00
|
|
|
//go:build darwin && !macnative
|
2018-10-01 08:19:06 +00:00
|
|
|
|
|
|
|
package native
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"sync"
|
|
|
|
|
2021-03-04 18:28:28 +00:00
|
|
|
"github.com/go-delve/delve/pkg/dwarf/op"
|
2019-01-04 18:39:25 +00:00
|
|
|
"github.com/go-delve/delve/pkg/proc"
|
2021-09-24 22:17:46 +00:00
|
|
|
"github.com/go-delve/delve/pkg/proc/amd64util"
|
2021-07-31 15:16:26 +00:00
|
|
|
"github.com/go-delve/delve/pkg/proc/internal/ebpf"
|
2018-10-01 08:19:06 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var ErrNativeBackendDisabled = errors.New("native backend disabled during compilation")
|
|
|
|
|
|
|
|
// Launch returns ErrNativeBackendDisabled.
|
2023-07-05 15:39:01 +00:00
|
|
|
func Launch(_ []string, _ string, _ proc.LaunchFlags, _ []string, _ string, _ string, _ proc.OutputRedirect, _ proc.OutputRedirect) (*proc.TargetGroup, error) {
|
2018-10-01 08:19:06 +00:00
|
|
|
return nil, ErrNativeBackendDisabled
|
|
|
|
}
|
|
|
|
|
|
|
|
// Attach returns ErrNativeBackendDisabled.
|
2023-08-09 17:30:22 +00:00
|
|
|
func Attach(_ int, _ *proc.WaitFor, _ []string) (*proc.TargetGroup, error) {
|
2018-10-01 08:19:06 +00:00
|
|
|
return nil, ErrNativeBackendDisabled
|
|
|
|
}
|
|
|
|
|
2023-08-09 17:30:22 +00:00
|
|
|
func waitForSearchProcess(string, map[int]struct{}) (int, error) {
|
|
|
|
return 0, proc.ErrWaitForNotImplemented
|
|
|
|
}
|
|
|
|
|
2020-03-26 12:05:09 +00:00
|
|
|
// waitStatus is a synonym for the platform-specific WaitStatus
|
|
|
|
type waitStatus struct{}
|
2018-10-01 08:19:06 +00:00
|
|
|
|
2020-03-26 12:05:09 +00:00
|
|
|
// osSpecificDetails holds information specific to the OSX/Darwin
|
2018-10-01 08:19:06 +00:00
|
|
|
// operating system / kernel.
|
2020-03-26 12:05:09 +00:00
|
|
|
type osSpecificDetails struct{}
|
2018-10-01 08:19:06 +00:00
|
|
|
|
2020-03-26 12:05:09 +00:00
|
|
|
// osProcessDetails holds Darwin specific information.
|
|
|
|
type osProcessDetails struct{}
|
2018-10-01 08:19:06 +00:00
|
|
|
|
2021-07-31 15:16:26 +00:00
|
|
|
func (os *osProcessDetails) Close() {}
|
|
|
|
|
2018-10-01 08:19:06 +00:00
|
|
|
func killProcess(pid int) error {
|
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2020-05-13 18:56:50 +00:00
|
|
|
func registers(thread *nativeThread) (proc.Registers, error) {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2020-03-26 12:05:09 +00:00
|
|
|
func (dbp *nativeProcess) loadProcessInformation(wg *sync.WaitGroup) {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2020-03-26 12:05:09 +00:00
|
|
|
func (dbp *nativeProcess) requestManualStop() (err error) {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2023-08-28 19:46:19 +00:00
|
|
|
func (*processGroup) resume() error {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2023-02-22 17:26:28 +00:00
|
|
|
func trapWait(procgrp *processGroup, pid int) (*nativeThread, error) {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2023-02-22 17:26:28 +00:00
|
|
|
func (*processGroup) stop(cctx *proc.ContinueOnceContext, trapthread *nativeThread) (*nativeThread, error) {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2020-03-26 12:05:09 +00:00
|
|
|
func (dbp *nativeProcess) updateThreadList() error {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2023-08-28 19:46:19 +00:00
|
|
|
func (*processGroup) kill(dbp *nativeProcess) (err error) {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2020-03-26 12:05:09 +00:00
|
|
|
func (dbp *nativeProcess) detach(kill bool) error {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2018-11-12 22:52:13 +00:00
|
|
|
// EntryPoint returns the entry point for the process,
|
|
|
|
// useful for PIEs.
|
2020-03-26 12:05:09 +00:00
|
|
|
func (dbp *nativeProcess) EntryPoint() (uint64, error) {
|
2018-05-29 15:01:51 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2021-07-31 15:16:26 +00:00
|
|
|
func (dbp *nativeProcess) SupportsBPF() bool {
|
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2021-08-24 12:53:27 +00:00
|
|
|
func (dbp *nativeProcess) SetUProbe(fnName string, goidOffset int64, args []ebpf.UProbeArgMap) error {
|
2021-07-31 15:16:26 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (dbp *nativeProcess) GetBufferedTracepoints() []ebpf.RawUProbeParams {
|
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2018-10-01 08:19:06 +00:00
|
|
|
// SetPC sets the value of the PC register.
|
2021-03-04 18:28:28 +00:00
|
|
|
func (t *nativeThread) setPC(pc uint64) error {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2021-03-04 18:28:28 +00:00
|
|
|
// SetReg changes the value of the specified register.
|
|
|
|
func (thread *nativeThread) SetReg(regNum uint64, reg *op.DwarfRegister) error {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ReadMemory reads len(buf) bytes at addr into buf.
|
2020-09-09 17:36:15 +00:00
|
|
|
func (t *nativeThread) ReadMemory(buf []byte, addr uint64) (int, error) {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
|
|
|
// WriteMemory writes the contents of data at addr.
|
2020-09-09 17:36:15 +00:00
|
|
|
func (t *nativeThread) WriteMemory(addr uint64, data []byte) (int, error) {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2020-03-26 12:05:09 +00:00
|
|
|
func (t *nativeThread) resume() error {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2023-09-20 07:17:45 +00:00
|
|
|
func (*processGroup) singleStep(*nativeThread) error {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2020-03-26 12:05:09 +00:00
|
|
|
func (t *nativeThread) restoreRegisters(sr proc.Registers) error {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2021-09-24 22:17:46 +00:00
|
|
|
func (t *nativeThread) withDebugRegisters(f func(*amd64util.DebugRegisters) error) error {
|
|
|
|
return proc.ErrHWBreakUnsupported
|
2021-05-06 17:33:56 +00:00
|
|
|
}
|
|
|
|
|
2018-10-01 08:19:06 +00:00
|
|
|
// Stopped returns whether the thread is stopped at
|
|
|
|
// the operating system level.
|
2020-03-26 12:05:09 +00:00
|
|
|
func (t *nativeThread) Stopped() bool {
|
2018-10-01 08:19:06 +00:00
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
2018-11-12 22:52:13 +00:00
|
|
|
|
2022-02-22 17:57:37 +00:00
|
|
|
// SoftExc returns true if this thread received a software exception during the last resume.
|
|
|
|
func (t *nativeThread) SoftExc() bool {
|
|
|
|
panic(ErrNativeBackendDisabled)
|
|
|
|
}
|
|
|
|
|
2023-05-09 18:40:00 +00:00
|
|
|
func initialize(dbp *nativeProcess) (string, error) { return "", nil }
|