Page 1 of 1

Longer Stacktrace (cli option)

Posted: Thu Jul 19, 2018 8:11 pm
by eradicator
What?
It would be mighty nice if the game produced a longer (full) stack trace when encountering an error during startup.

Examples
This is how a generic error during data.lua looks:
short_trace.png
short_trace.png (10.64 KiB) Viewed 1109 times
It only tells me that somewhere deep down in my library something caused an error, but i have no clue where it comes from. Ofc, i know i can insert a breakpoint and print a stacktrace from there myself:
long_trace.png
long_trace.png (17.24 KiB) Viewed 1109 times
But digging down into the lib, inserting a breakpoint, fixing the bug, removing the breakpoint... is repetitive and would in most cases be solved if the game just showed a full trace in the first place. Also not every modder (especially inexperienced ones) has a self-made stack trace printer. So this would hopefully help them greatly :). This could be dis-/enabled via a command line option if deemed nessecary, but would make it slightly less useful to new modders who might not know about it.

Re: Longer Stacktrace (cli option)

Posted: Fri Jul 20, 2018 8:57 am
by Rseding91
I've looked into this before and we aren't limiting the stack trace that lua generates. Simply it doesn't generate the full stack trace in all instances and I don't know why.

If you do, I can fix it :P

Re: Longer Stacktrace (cli option)

Posted: Fri Jul 20, 2018 9:29 am
by eradicator
Alas i don't though *sigh*. Random googling comes up with this stackoverflow question talking about pcall truncating stack traces and possible workarounds. But i don't even know anything about how the c-side of things does anything :roll: .