func illegalOffset() {
	defer func() {
		if r := recover(); r != nil {
			print("Recovered in illegalOffset")
		}
	}()
	hopwatch.CallerOffset(-1).Break()
}
示例#2
0
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...)
}
示例#5
0
func illegalOffset() {
	hopwatch.CallerOffset(-1).Break()
}
示例#6
0
func Display(args ...interface{}) {
	hopwatch.CallerOffset(3).Display(args...)
}
示例#7
0
func Debug(args ...interface{}) {
	hopwatch.CallerOffset(3).Display(args...).Break()
}