Open bobrippling opened 2 months ago
Well, if this were possible in an efficient way I'd be all for it. However if it were easy I'd have added it to the debugger already :)
Basically I don't want to calculate/store a bunch of extra stuff for each function call, because that would slow execution down.
So I guess you have two options really:
bt
would do, and find instances of jspeFunctionCall
oldLex
pointer to JsLex, and as we replace it when we're executing the function (https://github.com/espruino/Espruino/blob/176a23cf1bf8e37aab69b125b316942bced8332e/src/jsparse.c#L840) link in the 'old' lexer rather than storing it in JsLex *oldLex
. That way the debugger could skip back down all the lexers and reconstruct the call stack.Now I think about it the second option should be possible with minimal extra overhead
Interesting - I'll take a look, thanks for the pointers
I'd like to be able to see the call stack (useful for debugging what's called code, such as finding out where a
width
has been set), likebt
ingdb
- before I work on the feature though, is this something that would be accepted into espruino?I'm thinking something like: