public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* handler for a function returns/exits
@ 2006-12-13 21:41 Hari K. Pyla
  2006-12-14 13:32 ` Andrew Haley
  2006-12-14 18:57 ` Hari K. Pyla
  0 siblings, 2 replies; 3+ messages in thread
From: Hari K. Pyla @ 2006-12-13 21:41 UTC (permalink / raw)
  To: gcc-help

Hi,
     I was wondering, if there is any way to register a handler which 
gets called whenever any function returns/exits, similar in lines to 
_mcount() but, which gets executed before the actual function, when 
compiled with -pg option.
I was wondering if it is possible to print the function name or its 
address whenever a function exits by, may be making changes to gcc or 
glibc. I appreciate you taking time to answer this.
Thanks in advance.

Regards,
--Hari



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: handler for a function returns/exits
  2006-12-13 21:41 handler for a function returns/exits Hari K. Pyla
@ 2006-12-14 13:32 ` Andrew Haley
  2006-12-14 18:57 ` Hari K. Pyla
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Haley @ 2006-12-14 13:32 UTC (permalink / raw)
  To: Hari K. Pyla; +Cc: gcc-help

Hari K. Pyla writes:
 > Hi,
 >      I was wondering, if there is any way to register a handler which 
 > gets called whenever any function returns/exits, similar in lines to 
 > _mcount() but, which gets executed before the actual function, when 
 > compiled with -pg option.
 > I was wondering if it is possible to print the function name or its 
 > address whenever a function exits by, may be making changes to gcc or 
 > glibc. I appreciate you taking time to answer this.

It's all documented.  See item -finstrument-functions in the gcc docs.

Andrew.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: handler for a function returns/exits
  2006-12-13 21:41 handler for a function returns/exits Hari K. Pyla
  2006-12-14 13:32 ` Andrew Haley
@ 2006-12-14 18:57 ` Hari K. Pyla
  1 sibling, 0 replies; 3+ messages in thread
From: Hari K. Pyla @ 2006-12-14 18:57 UTC (permalink / raw)
  To: gcc-help

Thank you Andrew.

Regards,
--Hari

Hari K. Pyla writes:
 > Hi,
 >      I was wondering, if there is any way to register a handler which 
 > gets called whenever any function returns/exits, similar in lines to 
 > _mcount() but, which gets executed before the actual function, when 
 > compiled with -pg option.
 > I was wondering if it is possible to print the function name or its 
 > address whenever a function exits by, may be making changes to gcc or 
 > glibc. I appreciate you taking time to answer this.

It's all documented.  See item -finstrument-functions in the gcc docs.

Andrew.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-12-14 18:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-13 21:41 handler for a function returns/exits Hari K. Pyla
2006-12-14 13:32 ` Andrew Haley
2006-12-14 18:57 ` Hari K. Pyla

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).