Open timotheecour opened 4 years ago
The idea of ComesFrom is that template expansions do not lose one debug stack frame. As you can see, the implementation was never finished but I think the idea is a good one so I'd rather keep the dead code.
just to clarify: so the goal was indeed what i suspected, to treat template/macro calls as if they were function calls, ie:
template bar() = doAssert false proc fn=bar() fn()
with nim --stacktracetemplates
would produce something like:
stacktrace:
main.nim(1) in bar
main.nim(2) in fn
?
if so, yes, it's a good idea (but i was thinking of a different implementation to achieve that)
if not, please clarify maybe with an example
Yes, exactly.
@Araq while working on something else I noticed that
nkComesFrom
is deadcode (never set) even though it's used quite a bit, so removing it would declutter a bit.nkComesFrom
might be revived or is the new code path inwrapInComesFrom
strictly better so thatnkComesFrom
can be removed + its corresponding code cleaned up?nkComesFrom
to produce stacktrace entries for templates/macros as if they were function calls? if so, it would be useful to have it as an option (i had a WIP on that but done differently) but not sure that's what it was abouteg, this code is also dead because of that:
as well as
initFrameNoDebug
+deinitFrameNoDebug
+ some other code