Ejemplo n.º 1
0
func SetTraceSubcmd(args []string) {
	onoff := "on"
	if len(args) == 3 {
		onoff = args[2]
	}
	switch ParseOnOff(onoff) {
	case ONOFF_ON:
		if interp.InstTracing() {
			gub.Errmsg("Instruction tracing already on")
		} else {
			gub.Msg("Setting Instruction trace on")
			interp.SetInstTracing()
		}
	case ONOFF_OFF:
		if !interp.InstTracing() {
			gub.Errmsg("Instruction tracing already off")
		} else {
			gub.Msg("Setting Instruction trace off")
			interp.ClearInstTracing()
		}
	case ONOFF_UNKNOWN:
		gub.Errmsg("Expecting 'on' or 'off', got '%s'; nothing done", onoff)
	}
}
Ejemplo n.º 2
0
func ShowTraceSubcmd(args []string) {
	ShowOnOff(args[1], interp.InstTracing())
}