Tracking down where symbols come from in gdb

July 25, 2011 at 12:14 am Leave a comment

There should be a better way of doing this – perhaps someone on the internet will tell me what it is.

I wanted to answer the following question today.

What dynamically loaded library does this function come from?

To do this I used the following approach:

* Start the process
* Attach to it in gdb
* Use the x command to find the memory address of the symbol associated with the function (e.g x function name)
* Look this memory address up in /procs/pid/maps

There is probably a slightly shorter way of doing this, this looked hopeful, together with the interpreter command in gdb:

http://davis.lbl.gov/Manuals/GDB/gdb_24.html#SEC469

but didn’t seem to be present on my gdb (probably an old version).

Advertisements

Entry filed under: Uncategorized.

Send an attachment from the command line Postgres listing all tables ordered by approximate size

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


July 2011
M T W T F S S
« Jun   Sep »
 123
45678910
11121314151617
18192021222324
25262728293031

%d bloggers like this: