gnu.gcc.help
[Top] [All Lists]

Re: printing calling function's name from __cyg_profile_func_enter / exi

Subject: Re: printing calling function's name from __cyg_profile_func_enter / exit?
From: Andrew Haley
Date: Mon, 08 Sep 2008 06:50:49 -0500
Newsgroups: gnu.gcc.help

Christof Warlich <cwarlich@xxxxxx> wrote:

> is there any way to print the calling function's name from
> the hooks __cyg_profile_func_enter and __cyg_profile_func_exit?

> __func__ or __PRETTY_FUNCTION__ does not work, as it will just print
> the names of the hooks. But as the hooks get the calling function's
> address passed, I was hoping that it may be possible to somehow get
> hold of its names through the address.

Sure, just use dladdr(3).

Andrew.

<Prev in Thread] Current Thread [Next in Thread>