From: David Daney <ddaney@avtrex.com>
To: "Paulo J. Matos" <pocm@soton.ac.uk>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Accessing symbol table to find function given address
Date: Sat, 26 May 2007 21:00:00 -0000 [thread overview]
Message-ID: <46589FB9.3030504@avtrex.com> (raw)
In-Reply-To: <11b141710705261329k4e3e866bt898663aa85cd46f@mail.gmail.com>
Paulo J. Matos wrote:
> Hello all,
>
> Is there a way to access the symbol table during runtime to know which
> function belongs to a given address. The problem is to print the
> function name if I am instrumenting functions. I get the address, can
> I during runtime print the function name? (or the solution is get it
> through addr2line after program as run)?
If you are using glibc, you could try the dladdr() function. Otherwise
you can try addr2line as you suggested.
David Daney.
next prev parent reply other threads:[~2007-05-26 21:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-26 20:37 Paulo J. Matos
2007-05-26 21:00 ` David Daney [this message]
2007-05-26 21:17 ` Brian Dessent
2007-05-27 18:05 ` Paulo J. Matos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46589FB9.3030504@avtrex.com \
--to=ddaney@avtrex.com \
--cc=gcc-help@gcc.gnu.org \
--cc=pocm@soton.ac.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).