delve/pkg/proc/native/nonative_darwin.go
ttoad 53998cbb18
pkg/proc,service/*: Supports sending output to clients when running programs remotely (#3253)
* wip: Support sending output when remote debug

* wip: Support local output and remote output

* wip: fix stderr and stdout assignment error

* wip: optimize code

* wip: Only if outputMode is "remote" is the redirected console output

* wip: Redirected debugMode output(Not tested on windows)

* wip: support remote debugging output redirection of windows

* wip: real-time write back output

* wip: support for windows

* wip: fix windows remote debug not output

* wip: fix truncated output redirection

* wip: delete printfln

* wip: use debugger.Config to pass redirect(macOS)

* wip: use debugger.Config to pass redirect(linux)

* wip: Change redirect to a concrete type

* wip: s.wg.wait before sending "terminated"

* wip: add proc/redirect test(darwin and linux)

* Merge branch 'master' of github.com:tttoad/delve into feat-console

* wip: Fix test failure on windows

* fix: undefined: proc.Redirects

* fix: compile failure

* wip: Remove useless code

* fix: filename error

* fix: os.file not close

* test: add server_test.redirect

* fix: Remove 'eol' from end of file

* fix: gdbserial: File not closed in file mode.
(in reality, gdbserial will never use file mode)

* feat: Remove "only-remote". Fix spelling mistakes.

* fix: spelling mistakes

* refactor: redirect

* fix: stdout and stderr are not set to default values

* fix: Restore code logic for rr.openRedirects()

* fix: Optimization Code

* fix: utiltest

* fix: execpt out

* fix: Resource release for redirects

* fix: build failure

* fix: clean->clear

* fix: build failure

* fix: test failure

* fix: Optimization Code

* style: remove useless code

* refactor: namedpipe

* refactor: namedpipe, launch ...

* fix: freebsd compile failure

* fix: proc_darwin compile failure

* style:  remove useless code

* feat: add d.config.Stdxx check on debug.Restart

* style: formatting and adding comments

* style: formatting and adding comments

* feat: add d.config.Stdxx check on debug.Restart

* style: namedpipe->redirector

* style: namedPipe->redirector

---------

Co-authored-by: 李翔 <qian.fu2@amh-group.com>
2023-07-05 08:39:01 -07:00

146 lines
3.9 KiB
Go

//go:build darwin && !macnative
// +build darwin,!macnative
package native
import (
"errors"
"sync"
"github.com/go-delve/delve/pkg/dwarf/op"
"github.com/go-delve/delve/pkg/proc"
"github.com/go-delve/delve/pkg/proc/amd64util"
"github.com/go-delve/delve/pkg/proc/internal/ebpf"
)
var ErrNativeBackendDisabled = errors.New("native backend disabled during compilation")
// Launch returns ErrNativeBackendDisabled.
func Launch(_ []string, _ string, _ proc.LaunchFlags, _ []string, _ string, _ string, _ proc.OutputRedirect, _ proc.OutputRedirect) (*proc.TargetGroup, error) {
return nil, ErrNativeBackendDisabled
}
// Attach returns ErrNativeBackendDisabled.
func Attach(_ int, _ []string) (*proc.TargetGroup, error) {
return nil, ErrNativeBackendDisabled
}
// waitStatus is a synonym for the platform-specific WaitStatus
type waitStatus struct{}
// osSpecificDetails holds information specific to the OSX/Darwin
// operating system / kernel.
type osSpecificDetails struct{}
// osProcessDetails holds Darwin specific information.
type osProcessDetails struct{}
func (os *osProcessDetails) Close() {}
func killProcess(pid int) error {
panic(ErrNativeBackendDisabled)
}
func registers(thread *nativeThread) (proc.Registers, error) {
panic(ErrNativeBackendDisabled)
}
func (dbp *nativeProcess) loadProcessInformation(wg *sync.WaitGroup) {
panic(ErrNativeBackendDisabled)
}
func (dbp *nativeProcess) requestManualStop() (err error) {
panic(ErrNativeBackendDisabled)
}
func (dbp *nativeProcess) resume() error {
panic(ErrNativeBackendDisabled)
}
func trapWait(procgrp *processGroup, pid int) (*nativeThread, error) {
panic(ErrNativeBackendDisabled)
}
func (*processGroup) stop(cctx *proc.ContinueOnceContext, trapthread *nativeThread) (*nativeThread, error) {
panic(ErrNativeBackendDisabled)
}
func (dbp *nativeProcess) updateThreadList() error {
panic(ErrNativeBackendDisabled)
}
func (dbp *nativeProcess) kill() (err error) {
panic(ErrNativeBackendDisabled)
}
func (dbp *nativeProcess) detach(kill bool) error {
panic(ErrNativeBackendDisabled)
}
// EntryPoint returns the entry point for the process,
// useful for PIEs.
func (dbp *nativeProcess) EntryPoint() (uint64, error) {
panic(ErrNativeBackendDisabled)
}
func (dbp *nativeProcess) SupportsBPF() bool {
panic(ErrNativeBackendDisabled)
}
func (dbp *nativeProcess) SetUProbe(fnName string, goidOffset int64, args []ebpf.UProbeArgMap) error {
panic(ErrNativeBackendDisabled)
}
func (dbp *nativeProcess) GetBufferedTracepoints() []ebpf.RawUProbeParams {
panic(ErrNativeBackendDisabled)
}
// SetPC sets the value of the PC register.
func (t *nativeThread) setPC(pc uint64) error {
panic(ErrNativeBackendDisabled)
}
// SetReg changes the value of the specified register.
func (thread *nativeThread) SetReg(regNum uint64, reg *op.DwarfRegister) error {
panic(ErrNativeBackendDisabled)
}
// ReadMemory reads len(buf) bytes at addr into buf.
func (t *nativeThread) ReadMemory(buf []byte, addr uint64) (int, error) {
panic(ErrNativeBackendDisabled)
}
// WriteMemory writes the contents of data at addr.
func (t *nativeThread) WriteMemory(addr uint64, data []byte) (int, error) {
panic(ErrNativeBackendDisabled)
}
func (t *nativeThread) resume() error {
panic(ErrNativeBackendDisabled)
}
func (t *nativeThread) singleStep() error {
panic(ErrNativeBackendDisabled)
}
func (t *nativeThread) restoreRegisters(sr proc.Registers) error {
panic(ErrNativeBackendDisabled)
}
func (t *nativeThread) withDebugRegisters(f func(*amd64util.DebugRegisters) error) error {
return proc.ErrHWBreakUnsupported
}
// Stopped returns whether the thread is stopped at
// the operating system level.
func (t *nativeThread) Stopped() bool {
panic(ErrNativeBackendDisabled)
}
// SoftExc returns true if this thread received a software exception during the last resume.
func (t *nativeThread) SoftExc() bool {
panic(ErrNativeBackendDisabled)
}
func initialize(dbp *nativeProcess) (string, error) { return "", nil }