This is the mail archive of the
mailing list for the GCC project.
Re: -finstrument-functions and stack unwinding on C++ exceptions
- From: Earl Chew <earl_chew at agilent dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 13 Nov 2007 10:17:34 -0800
- Subject: Re: -finstrument-functions and stack unwinding on C++ exceptions
- References: <4737AFA8.firstname.lastname@example.org> <email@example.com>
Ian Lance Taylor wrote:
The -finstrument-functions options inserts calls to __cyg_profile_func_enter
and __cyg_profile_func_exit into functions and methods.
In particular __cyg_profile_func_exit is called just prior to the
In C++ a method can also terminate due to an exception. This causes
the stack to unwind as the runtime searches for an exception handler.
As the intervening stack frames are unwound, are the related calls
to __cyg_profile_func_exit called, or will those stack frames
end up with an unmatched __cyg_profile_func_enter ?
Try it and see.
I would bet that you will see an unmatched __cyg_profile_func_enter.
I found this bug report:
and this patch:
The code appears to have been merged to gcc 4.X but the patch
requires the tree-ssa changes to be viable.