proc/*: minor miscellaneous code cleanups (#2790)

* made Pid a method of Target instead of a method of Process
* changed argument of NewTarget to ProcessInternal, since that's the
  interface that backends have to implement
* removed warnings about ProcessInternal since there is no way for
  users of pkg/proc to access those methods anyway
* made RecordingManipulation an optional interface for backends, Target
  supplies its own dummy implementation when the backend doesn't
* inlined small interfaces that only existed to be inlined in
  proc.Process anyway
* removed unused function findExecutable in the Windows and no-native
  darwin backends
* removed (*EvalScope).EvalVariable, an old synonym for EvalExpression
This commit is contained in:
Alessandro Arzilli
2021-11-26 17:06:23 +01:00
committed by GitHub
parent 88dca53e5c
commit 01b01423ae
18 changed files with 124 additions and 141 deletions

View File

@ -164,8 +164,6 @@ type process struct {
breakpoints proc.BreakpointMap
}
var _ proc.ProcessInternal = &process{}
// thread represents a thread in the core file being debugged.
type thread struct {
th osThread
@ -222,7 +220,7 @@ func OpenCore(corePath, exePath string, debugInfoDirs []string) (*proc.Target, e
return nil, ErrNoThreads
}
return proc.NewTarget(p, currentThread, proc.NewTargetConfig{
return proc.NewTarget(p, p.pid, currentThread, proc.NewTargetConfig{
Path: exePath,
DebugInfoDirs: debugInfoDirs,
DisableAsyncPreempt: false,
@ -459,11 +457,6 @@ func (p *process) Valid() (bool, error) {
return true, nil
}
// Pid returns the process ID of this process.
func (p *process) Pid() int {
return p.pid
}
// ResumeNotify is a no-op on core files as we cannot
// control execution.
func (p *process) ResumeNotify(chan<- struct{}) {