handler for a function returns/exits

Hari K. Pyla harip@vt.edu
Thu Dec 14 18:57:00 GMT 2006


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.



More information about the Gcc-help mailing list