mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	Implement frontend next command
This commit is contained in:
		| @ -24,6 +24,7 @@ func DebugCommands() *Commands { | |||||||
| 	cmds := map[string]cmdfunc{ | 	cmds := map[string]cmdfunc{ | ||||||
| 		"exit":     exitFunc, | 		"exit":     exitFunc, | ||||||
| 		"continue": cont, | 		"continue": cont, | ||||||
|  | 		"next":     next, | ||||||
| 		"break":    breakpoint, | 		"break":    breakpoint, | ||||||
| 		"step":     step, | 		"step":     step, | ||||||
| 		"clear":    clear, | 		"clear":    clear, | ||||||
| @ -94,6 +95,23 @@ func step(p *proctl.DebuggedProcess, args ...string) error { | |||||||
| 	return nil | 	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 { | func clear(p *proctl.DebuggedProcess, args ...string) error { | ||||||
| 	fname := args[0] | 	fname := args[0] | ||||||
| 	fn := p.GoSymTable.LookupFunc(fname) | 	fn := p.GoSymTable.LookupFunc(fname) | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Derek Parker
					Derek Parker