This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How does g++ implement error handling?
- From: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>
- To: Euler Herbert <herberteuler at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 21 Feb 2005 10:52:32 +0000
- Subject: Re: How does g++ implement error handling?
- References: <BAY18-F389B3A855B2540581C7F3BDA610@phx.gbl>
On Mon, Feb 21, 2005 at 12:32:52PM +0800, Euler Herbert wrote:
> Hi everyone,
Hi,
> I am trying to find out how g++ implements error handling.
> My environment is CPU AMD Athlon(tm) XP 2000+, Debian GNU/Linux
> 3.1, GCC 3.4.3-6, and Glibc 2.3.2.ds1-20. After researching
> assembling codes generated by g++, I have known the beginning
> and ending part. That is, we will call __cxa_allocate_exception
> when writing 'throw expression', then the constructor of the
> exception class, and then __cxa_throw. __cxa_throw calls
> _Unwind_RaiseException. But this function is so complex for
> me that I cannot get the outline of the real process. However,
> I found uw_install_context (which is a macro) will be called
> if _Unwind_RaiseException succeeds, and the body of
> uw_install_context contains calling of longjmp. So setjmp will
> be somewhere, but I did no find it. Could somebody tell me the
> outline of the unwinding process?
I think this behaviour is defined by this spec:
http://www.codesourcery.com/cxx-abi/abi-eh.html
Which is part of the C++ ABI spec:
http://www.codesourcery.com/cxx-abi/
Hope that helps,
jon
--
"A woman drove me to drink, I never had the courtesy to thank her."
- W.C. Fields