mirror of
https://github.com/go-delve/delve.git
synced 2025-11-01 12:01:35 +08:00
Implement print command
This commit is contained in:
@ -29,6 +29,7 @@ func DebugCommands() *Commands {
|
||||
"break": breakpoint,
|
||||
"step": step,
|
||||
"clear": clear,
|
||||
"print": printVar,
|
||||
"": nullCommand,
|
||||
}
|
||||
|
||||
@ -157,6 +158,16 @@ func breakpoint(p *proctl.DebuggedProcess, args ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func printVar(p *proctl.DebuggedProcess, args ...string) error {
|
||||
val, err := p.EvalSymbol(args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println(val.Value)
|
||||
return nil
|
||||
}
|
||||
|
||||
func printcontext(p *proctl.DebuggedProcess) error {
|
||||
var context []string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user