service/debugger,terminal: API and user interface for follow exec mode (#3286)

Updates #2551
This commit is contained in:
Alessandro Arzilli
2023-04-24 23:37:31 +02:00
committed by GitHub
parent 47481fe0ab
commit a61ccea65a
12 changed files with 295 additions and 1 deletions

View File

@ -429,10 +429,12 @@ func ConvertRegisters(in *op.DwarfRegisters, dwarfRegisterToString func(int, *op
return
}
// ConvertImage convers proc.Image to api.Image.
func ConvertImage(image *proc.Image) Image {
return Image{Path: image.Path, Address: image.StaticBase}
}
// ConvertDumpState converts proc.DumpState to api.DumpState.
func ConvertDumpState(dumpState *proc.DumpState) *DumpState {
dumpState.Mutex.Lock()
defer dumpState.Mutex.Unlock()
@ -449,3 +451,12 @@ func ConvertDumpState(dumpState *proc.DumpState) *DumpState {
}
return r
}
// ConvertTarget converts a proc.Target into a api.Target.
func ConvertTarget(tgt *proc.Target, convertThreadBreakpoint func(proc.Thread) *Breakpoint) *Target {
//TODO(aarzilli): copy command line here
return &Target{
Pid: tgt.Pid(),
CurrentThread: ConvertThread(tgt.CurrentThread(), convertThreadBreakpoint(tgt.CurrentThread())),
}
}