This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Call Stack (Reflection)


On Mon, Jan 18, 1999 at 09:37:03AM -0500, Zack Weinberg wrote:
>
> dladdr() won't give you anything useful except for exported dynamic
> symbols in shared objects (i.e. libraries and modules loaded with
> dlopen()).  You want to print out the raw addresses and use addr2line
> to clean them up.  Take a look at debug/catchsegv.sh in the libc
> code.  I wouldn't bother with backtracesyms() at all.
>

 Yes, that works, thanks. I've borrowed some code from addr2line.c and
can now properly decode my backtrace. However, that currently only seems
to work on Linux.
 I've used the "generic" backtrace() function from glibc/sysdeps/generic/
backtrace.c, which uses __builtin_frame_address(0) to access the toplevel
frame. On SunOS, this produces a single stack frame pointing into an egcs
function (gcc/frame.c:0). On HPpa, I get nothing at all. All this is using
egcs 1.1a.
 Do you know of other (generic or system-specific) possibilities to
access a backtrace?

	Frank


-- 
 + Frank Pilhofer                        fp@informatik.uni-frankfurt.de  +
 |                                      http://www.uni-frankfurt.de/~fp/ |
 +---- Life would be a very great deal less weird without you.  - DA ----+


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]