www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Stack Traces on Linux

reply dsimcha <dsimcha yahoo.com> writes:
What determines whether the function name or just the address will be printed
out when a stack trace is printed on Linux?  I'm trying to debug an error and
all I'm getting is hex addresses.  I have no idea why.  With other programs I
get full function names.
Nov 05 2010
next sibling parent reply Daniel Gibson <metalcaedes gmail.com> writes:
dsimcha schrieb:
 What determines whether the function name or just the address will be printed
 out when a stack trace is printed on Linux?  I'm trying to debug an error and
 all I'm getting is hex addresses.  I have no idea why.  With other programs I
 get full function names.
I'm not sure, but aren't debug symbols needed (i.e. did you compile with -g)?
Nov 05 2010
parent Jesse Phillips <jessekphillips+D gmail.com> writes:
Daniel Gibson Wrote:

 dsimcha schrieb:
 What determines whether the function name or just the address will be printed
 out when a stack trace is printed on Linux?  I'm trying to debug an error and
 all I'm getting is hex addresses.  I have no idea why.  With other programs I
 get full function names.
I'm not sure, but aren't debug symbols needed (i.e. did you compile with -g)?
Add this flag -L--export-dynamic and compile with -gc (-g may work) http://www.digitalmars.com/d/archives/digitalmars/D/A_working_backtrace_for_linux_114405.html
Nov 05 2010
prev sibling parent =?UTF-8?B?IkrDqXLDtG1lIE0uIEJlcmdlciI=?= <jeberger free.fr> writes:
dsimcha wrote:
 What determines whether the function name or just the address will be p=
rinted
 out when a stack trace is printed on Linux?  I'm trying to debug an err=
or and
 all I'm getting is hex addresses.  I have no idea why.  With other prog=
rams I
 get full function names.
IIRC with gcc you need to add -rdynamic when linking. Jerome --=20 mailto:jeberger free.fr http://jeberger.free.fr Jabber: jeberger jabber.fr
Nov 05 2010