From: "Shorty Porty" <getshorty_@hotmail.com>
To: 'Glynn Clements' <glynn@gclements.plus.com>,
'Shriek' <shriek.007@gmail.com>
Cc: 'Vadiraj' <vadiraj.cs@gmail.com>,
'Mihai Dontu' <mdontu@bitdefender.com>,
linux-c-programming@vger.kernel.org
Subject: RE: Where to find definition for __FUNCTION__ macro
Date: Wed, 23 Aug 2006 22:49:28 +1000 [thread overview]
Message-ID: <BAY104-DAV70758AAD5F35546BA30EEED470@phx.gbl> (raw)
In-Reply-To: <17644.14314.29203.840094@cerise.gclements.plus.com>
My understanding is that __FUNCTION__ is substituted at compile time. So
__FUNCTION__ doesn't run anything, it's just a string, like __FILE__ or
__LINE__.
shorty
-----Original Message-----
From: linux-c-programming-owner@vger.kernel.org
[mailto:linux-c-programming-owner@vger.kernel.org] On Behalf Of Glynn
Clements
Sent: Wednesday, 23 August 2006 9:12 PM
Shriek wrote:
> Alright, I might just as well present my problem here... I am trying
> to debug some call back handlers which are actualy registered as
> function pointers at boot time for a router, now lets say there is a
> central notification framework and looking at the msg-type it calls a
> specific handler, so there is some statement like
>
> ev_msg_handlers[msg->rtsm_type].
> So I was thinking if I could get the internals of the __FUNCTION__
> macro and if my assumption that it looks it up in system map then I
> could possibly attempt to modify it so as to accept the handler
> address and return the function name it is entering ... what say ???
__FUNCTION__ won't help you here.
You need to be able to read either the executable's symbol table (for
a dynamically-linked executable) or its debug information (for an
executable with debug info). For a statically-linked executable with
no debug info, it's impossible; the function's names simply don't
exist anywhere at run-time.
I'd suggest looking at the source code for "nm" for details on reading
symbol information.
prev parent reply other threads:[~2006-08-23 12:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-23 10:02 Where to find definition for __FUNCTION__ macro Shriek
2006-08-23 10:13 ` Mihai Dontu
[not found] ` <6eee1c40608230324t63154c45xa4b54c6d6cc9850d@mail.gmail.com>
2006-08-23 10:48 ` Shriek
2006-08-23 11:11 ` Glynn Clements
2006-08-23 12:49 ` Shorty Porty [this message]
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=BAY104-DAV70758AAD5F35546BA30EEED470@phx.gbl \
--to=getshorty_@hotmail.com \
--cc=glynn@gclements.plus.com \
--cc=linux-c-programming@vger.kernel.org \
--cc=mdontu@bitdefender.com \
--cc=shriek.007@gmail.com \
--cc=vadiraj.cs@gmail.com \
/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 NNTP newsgroup(s).