Thread overview
[Issue 5118] Stack traces should properly handle nested functions
Oct 20, 2016
Nemanja Boric
August 07, 2014
https://issues.dlang.org/show_bug.cgi?id=5118

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh@quickfur.ath.cx

--
August 07, 2014
https://issues.dlang.org/show_bug.cgi?id=5118

--- Comment #1 from hsteoh@quickfur.ath.cx ---
If I run the program under gdb and set a breakpoint on the throw, gdb is able to display the nested function as part of the call stack. So obviously all necessary info is there, it's just a matter of incorporating it into the stacktrace generated by the throw.

--
October 20, 2016
https://issues.dlang.org/show_bug.cgi?id=5118

Nemanja Boric <4burgos@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |4burgos@gmail.com
         Resolution|---                         |FIXED

--- Comment #2 from Nemanja Boric <4burgos@gmail.com> ---
I think the problem here is that previous exception handler was using BPs
stored
on stack to walk the stack frame, and nested functions were not doing this
properly (if I remember correctly, they were not using *BP for the stack frame,
or something similar).

With the new exception handler, this issue is gone:

object.Exception@test.d(8): Test.
----------------
??:? void test.doIt().nested() [0x422ae9]
??:? void test.doIt() [0x422a92]
??:? _Dmain [0x422a80]
??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0x423126]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).tryExec(scope void delegate()) [0x423070]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).runAll() [0x4230e2]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).tryExec(scope void delegate()) [0x423070]
??:? _d_run_main [0x422fe1]
??:? main [0x422b75]
??:? __libc_start_main [0x935bb82f]

--