C++ Exception object layout

Jim Dehnert dehnert at transmeta.com
Mon Dec 4 20:47:46 UTC 2000


"Narayanaswamy, Ravi" wrote:
> 
> In section 2.2.1 C++ Exception Objects,  the text part says that the unwind
> header
> structure is followed by the exception object itself, where as the layout
> of the structure is just the opposite.  Can someone tell me which is the
> correct one. Below is part of the section.

They are both correct.

The "unwind header" is the  "_Unwind_Exception unwindHeader;" at the end
of the C++ exception header.  It immediately precedes the exception object
itself, which follows the header.  The unwind runtime is not expected to
be conscious of the rest of the C++ header.

Jim

> Thanks
> Ravi
> Intel Corporation.
> 
> 2.2.1 C++ Exception Objects
> A C++ exception object consists of a header, which is a wrapper around an
> unwind object header with additional C++ specific information, followed by
> the exception object itself. The structure of the header is as follows:
> 
>   struct __cxa_exception {
>         std::type_info *        exceptionType;
>         void (*exceptionDestructor) (void *);
>         unexpected_handler      unexpectedHandler;
>         terminate_handler       terminateHandler;
>         __cxa_exception *       nextException;
> 
>         int                     handlerCount;
>         int                     handlerSwitchValue;
>         const char *            actionRecord;
>         const char *            languageSpecificData;
>         void *                  catchTemp;
>         void *                  adjustedPtr;
> 
>         _Unwind_Exception       unwindHeader;
>    };

-- 
		Jim Dehnert		Transmeta Corp.
		dehnert at transmeta.com	(408) 919-6984
		dehnertj at acm.org




More information about the cxx-abi-dev mailing list