From 1035ed42696e97cfd50be8e962c510ed0746be33 Mon Sep 17 00:00:00 2001 From: Henning Stahlke Date: Sat, 18 Apr 2020 15:21:28 +0200 Subject: [PATCH] add skip parameter to debug.nas breakpoint class --- Nasal/debug.nas | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Nasal/debug.nas b/Nasal/debug.nas index 9ff8d9b8e..8f28e6b5f 100644 --- a/Nasal/debug.nas +++ b/Nasal/debug.nas @@ -631,10 +631,12 @@ var Probe = { var Breakpoint = { # label: Used in property path and as text for backtrace. # dump_locals: bool passed to backtrace. Dump variables in BT. - new: func(label, dump_locals = 1) { + # skip_level: int passed to backtrace. + new: func(label, dump_locals = 1, skip_level=0) { var obj = { parents: [Breakpoint, Probe.new(label, "bp")], - tokens: 0, + tokens: 0, + skip_level: num(skip_level+1), # +1 for Breakpoint.hit() dump_locals: num(dump_locals), }; obj._enableN.remove(); @@ -664,7 +666,7 @@ var Breakpoint = { callback(me.hits[0], me.tokens); } else { - debug.backtrace(me.label, me.dump_locals, 1); + debug.backtrace(me.label, me.dump_locals, me.skip_level); } me._enableN.setValue(me.tokens); }