If I write a small program like this and compile it with cpp:
class Main {
static public function main(): Void {
trace('${haxe.CallStack.callstack()}');
}
}
…then on cpp it always produces an empty array ([]). This is making it rather hard to debug things. Is there any compiler setting I need to enable to make this work? I’ve tried it with --debug both on and off.
Sadly, the debugger won’t help here — I need to capture the stack trace in logs.
I should add that I’m not getting stack traces when throwing an uncaught exception or when catching a haxe.Exception and looking a the stack field, either.
You can try to play with those defines: HXCPP_STACK_TRACE Have valid function-level stack traces, even in release mode. HXCPP_STACK_LINE Include line information in stack traces, even in release mode.
There are more in the manual, maybe you will find something suitable for your needs: