mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 18:27:37 +08:00
Implement frontend next command
This commit is contained in:
@ -24,6 +24,7 @@ func DebugCommands() *Commands {
|
||||
cmds := map[string]cmdfunc{
|
||||
"exit": exitFunc,
|
||||
"continue": cont,
|
||||
"next": next,
|
||||
"break": breakpoint,
|
||||
"step": step,
|
||||
"clear": clear,
|
||||
@ -94,6 +95,23 @@ func step(p *proctl.DebuggedProcess, args ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func next(p *proctl.DebuggedProcess, args ...string) error {
|
||||
err := p.Next()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
regs, err := p.Registers()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
f, l, _ := p.GoSymTable.PCToLine(regs.PC())
|
||||
fmt.Printf("Stopped at: %s:%d\n", f, l)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func clear(p *proctl.DebuggedProcess, args ...string) error {
|
||||
fname := args[0]
|
||||
fn := p.GoSymTable.LookupFunc(fname)
|
||||
|
||||
Reference in New Issue
Block a user