func illegalOffset() { defer func() { if r := recover(); r != nil { print("Recovered in illegalOffset") } }() hopwatch.CallerOffset(-1).Break() }
func debug(vars ...interface{}) *hopwatch.Watchpoint { // create a watchpoint and compensate for extra stack frame watchPoint := hopwatch.CallerOffset(2 + 1) watchPoint.Dump(vars...) // revert compensation for calls on the return value watchPoint.CallerOffset(2) return watchPoint }
func indirectBreak() { hopwatch.CallerOffset(3).Break() }
func indirectDisplay(args ...interface{}) { hopwatch.CallerOffset(2).Display(args...) }
func illegalOffset() { hopwatch.CallerOffset(-1).Break() }
func Display(args ...interface{}) { hopwatch.CallerOffset(3).Display(args...) }
func Debug(args ...interface{}) { hopwatch.CallerOffset(3).Display(args...).Break() }