www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - stack trace output on exception

reply "Stephan Schiffels" <stephan_schiffels mac.com> writes:
Hi,

I am using dmd with version: DMD64 D Compiler v2.065-devel-db2a73d

My program throws a custom exception with a custom error message 
at some point. The stack trace (below) is very uninformative. Is 
there a way to output the function names of each position in the 
stack?

I already compile using -g and I also tried -gc and -gs and all 
three of them together. I also tried -debug. The stack trace 
looks always like this:

popGenFunc.IllegalParametersException popGenFunc.d(556): gamma 
out of range
----------------
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x42752b]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x423ee7]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x404bab]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x402d7e]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x4028d6]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433cc4]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c1e]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c84]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c1e]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433b9f]
/nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x421121]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) 
[0x7ffe8440e76d]

Thanks for your help,
Stephan
Jul 08 2014
parent reply "JR" <zorael gmail.com> writes:
On Tuesday, 8 July 2014 at 07:11:26 UTC, Stephan Schiffels wrote:
 Hi,

 I am using dmd with version: DMD64 D Compiler 
 v2.065-devel-db2a73d

 My program throws a custom exception with a custom error 
 message at some point. The stack trace (below) is very 
 uninformative. Is there a way to output the function names of 
 each position in the stack?

 I already compile using -g and I also tried -gc and -gs and all 
 three of them together. I also tried -debug. The stack trace 
 looks always like this:

 popGenFunc.IllegalParametersException popGenFunc.d(556): gamma 
 out of range
 ----------------
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x42752b]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x423ee7]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x404bab]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x402d7e]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x4028d6]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433cc4]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c1e]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c84]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c1e]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433b9f]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x421121]
 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) 
 [0x7ffe8440e76d]

 Thanks for your help,
 Stephan
Tried building with -L--export-dynamic?
Jul 08 2014
parent Stephan Schiffels via Digitalmars-d-learn writes:
Ah nice. That worked. Thanks!



2014-07-08 9:25 GMT+02:00 JR via Digitalmars-d-learn <
digitalmars-d-learn puremagic.com>:

 On Tuesday, 8 July 2014 at 07:11:26 UTC, Stephan Schiffels wrote:

 Hi,

 I am using dmd with version: DMD64 D Compiler v2.065-devel-db2a73d

 My program throws a custom exception with a custom error message at some
 point. The stack trace (below) is very uninformative. Is there a way to
 output the function names of each position in the stack?

 I already compile using -g and I also tried -gc and -gs and all three of
 them together. I also tried -debug. The stack trace looks always like this:

 popGenFunc.IllegalParametersException popGenFunc.d(556): gamma out of
 range
 ----------------
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x42752b]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x423ee7]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x404bab]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x402d7e]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x4028d6]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433cc4]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c1e]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c84]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433c1e]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x433b9f]
 /nfs/users/nfs_s/ss27/Projects/hfit/build/hfit() [0x421121]
 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7ffe8440e76d]

 Thanks for your help,
 Stephan
Tried building with -L--export-dynamic?
Jul 08 2014