This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Question about -finstrument-functions


The gcc option -finstrument-functions generates calls to the profiling
functions

    void __cyg_profile_func_enter (void *this_fn, void *call_site);
    void __cyg_profile_func_exit  (void *this_fn, void *call_site);

My question is: what is the value of call_site if this_fn is a signal
handler? If call_site is an address "outside" the program being profiled,
is there a simple way to test this (without having to look up in the
program's symbol table? What I'm looking for is to write something like

void __cyg_profile_func_enter (void *this_fn, void *call_site)
{
  if (call_site is some strange address)
    {
      /* this_fn just entered is a signal handler, do something safe... */
    }
  else
    {
      /* this_fn is a "normal" function, do something else... */ 
    }
}

Thanks for any help,
Andreas Sorensen

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]