mirror of
https://github.com/go-delve/delve.git
synced 2025-11-02 12:59:01 +08:00
Implement print command
This commit is contained in:
@ -29,6 +29,7 @@ func DebugCommands() *Commands {
|
|||||||
"break": breakpoint,
|
"break": breakpoint,
|
||||||
"step": step,
|
"step": step,
|
||||||
"clear": clear,
|
"clear": clear,
|
||||||
|
"print": printVar,
|
||||||
"": nullCommand,
|
"": nullCommand,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,6 +158,16 @@ func breakpoint(p *proctl.DebuggedProcess, args ...string) error {
|
|||||||
return nil
|
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 {
|
func printcontext(p *proctl.DebuggedProcess) error {
|
||||||
var context []string
|
var context []string
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user