Documentation
¶
Index ¶
- Variables
- type Debugger
- func (debug *Debugger) AddTrace(function string, line uint64)
- func (debug *Debugger) CreateBreakpoint(function string, line, condition uint64)
- func (debug *Debugger) ListBreakpoint() string
- func (debug *Debugger) Next()
- func (debug *Debugger) PrintLocals()
- func (debug *Debugger) PrintTraces()
- func (debug *Debugger) Quit()
- func (debug *Debugger) Reset()
- func (debug *Debugger) ResetLocals()
- func (debug *Debugger) Return()
- func (debug *Debugger) Run()
- func (debug *Debugger) StepInside()
- func (debug *Debugger) Stop()
- func (debug *Debugger) UpdateLocals(locals map[string]dvm.Variable)
Constants ¶
This section is empty.
Variables ¶
View Source
var Dispatcher = func(i *dvm.DVM_Interpreter, funcLine string) bool { debug := GetDebugger() curr_rec := i.State.Monitor_recursion function := i.EntryPoint lineIP := i.IP debug.AddTrace(function, lineIP) debug.UpdateLocals(i.Locals) stopExecution := func() { debug.freezer <- true for { if freeze := <-debug.freezer; !freeze { break } time.Sleep(time.Millisecond) } } updateRec := func(prev, curr *int64) { *prev = *curr } displayUpdateAndWait := func(msg, line string, ip uint64, p, c *int64) { if msg != "" { log.Info("%s %v\t%v\n", msg, ip, formatLine(line)) } else { log.Info(" %v\t%v\n", ip, formatLine(line)) } updateRec(p, c) stopExecution() } for { switch debug.event { case run: if ok := debug.isBreakpointValid(function, lineIP); ok { reachedBP := fmt.Sprintf("Breakpoint reached in function '%s' at the line:\n", function) displayUpdateAndWait(reachedBP, funcLine, lineIP, &prev_rec, &curr_rec) } case stepi: displayUpdateAndWait("", funcLine, lineIP, &prev_rec, &curr_rec) case next: if curr_rec <= prev_rec { displayUpdateAndWait("", funcLine, lineIP, &prev_rec, &curr_rec) } case ret: if curr_rec < prev_rec { displayUpdateAndWait("", funcLine, lineIP, &prev_rec, &curr_rec) } case freeze: stopExecution() case invalid: fallthrough case quit: log.Info("Debugger: Force quit!!!\n") close(debug.freezer) return true } return false } panic("You should never run this line!!!") }
Functions ¶
This section is empty.
Types ¶
type Debugger ¶
type Debugger struct {
// contains filtered or unexported fields
}
func GetDebugger ¶
func GetDebugger() *Debugger
func (*Debugger) CreateBreakpoint ¶
func (*Debugger) ListBreakpoint ¶
func (*Debugger) PrintLocals ¶
func (debug *Debugger) PrintLocals()
func (*Debugger) PrintTraces ¶
func (debug *Debugger) PrintTraces()
func (*Debugger) ResetLocals ¶
func (debug *Debugger) ResetLocals()
func (*Debugger) StepInside ¶
func (debug *Debugger) StepInside()
Click to show internal directories.
Click to hide internal directories.