Symbol Tables and Backtraces in Linux

From: TLOlczyk (olczyk2002_at_yahoo.com)
Date: 07/25/04


Date: Sun, 25 Jul 2004 04:53:42 -0500

On 22 Jul 2004 03:51:43 -0700, gil_hamilton@hotmail.com (Gil Hamilton)
wrote:

>TLOlczyk <olczyk2002@yahoo.com> wrote in message news:<v7lqf0h53jmgf4srijng3mb9bo7adr4pj9@4ax.com>...
>> I have a shared object for which I want to print (stack) backtraces
>> at certain locations. I've tried backtrace and backtrace_symbols_fd.
>>
Since then I've printed to the file using backtrace_symbols. Same
result.

>> The thing is that I don't quite get the output I want.
>> Many lines are printed simple as:
>> shared_object_file_name(offset)
>>
>> sometimes as
>>
>> shared_object_file_name(function_name+offset)
>>
>> I've compiled with the -g option.
>> The shared object is third party with it's own make system,
>> so I might be missing something in the build. If so, what should
>> I look for?
>
The funny thing is that if I use ddd, put in a sleep(10) and "attach
to process", I can see the lines of source in ddd. So the symbol
information must be in there.

>I recently went through much the same exercise trying to produce a
>stack trace for my executable. I wasn't able to get actual function
>names printed until I started using the linker's -E (--export-dynamic)
>option. To pass it through the compiler to the linker, you use
>"-Wl,-E".
>

Finding the source in the debugger is OK if I use -E or if I don't.
IAnyone give me suggestions?

The reply-to email address is olczyk2002@yahoo.com.
This is an address I ignore.
To reply via email, remove 2002 and change yahoo to
interaccess,

**
Thaddeus L. Olczyk, PhD

There is a difference between
*thinking* you know something,
and *knowing* you know something.



Relevant Pages

  • Symbol Tables and Backtraces in Linux
    ... >> I have a shared object for which I want to print backtraces ... >stack trace for my executable. ...
    (comp.programming)
  • Symbol Tables and Backtraces in Linux
    ... >> I have a shared object for which I want to print backtraces ... >stack trace for my executable. ...
    (comp.os.linux.development.system)
  • Backtraces in Linux
    ... I have a shared object for which I want to print (stack) backtraces ... Can anyone suggest references or web sites? ...
    (comp.os.linux.development.system)
  • Backtraces in Linux
    ... I have a shared object for which I want to print (stack) backtraces ... Can anyone suggest references or web sites? ...
    (comp.programming)
  • User defined stack for threads in Linux 2.6.11 + glibc 2.3.5
    ... I am currently working with threads using linux 2.6.11 and glibc 2.3.5 ... trying to create any thread (for user defined stack) using this shared ... creating a thread using shared object shall result in segfault. ... gdb output for the behavior is: ...
    (comp.lang.c)