This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Exception Handling description

Michael Matz wrote:

On Sun, 17 May 2009, Michael Eager wrote:

But the _format_ of the LSDA is not specified. It's really an implementation detail of the compiler/language and doesn't have to be agreed upon for mixing .o files from different compilers, as every compilation unit can have it's own personality routine.
This is what needs to be documented and specified for the PPC ABI.

Hmm, strange request. So the ABI talks only about C++? And if g++ should ever emit some different LSDA info (and appropriately using a new personality routine), which is completely transparent and okay, it wouldn't be ABI compatible anymore? Are the requesters of your task aware of that?

The PowerPC ABI doesn't address C++, but exception handling in general. (Similar to the AMD64 ABI, which you co-wrote or co-edited.) The way that GCC implements exception handling tables has also been used by other compilers, as I understand it.

If the LSDA is only interpreted by the personality routine pointed to
by the unwind table, then all that should be needed is to describe the
the functionality of that routine.  (The PowerPC ABI already references the
Itanium C++ ABI on the CodeSourcery site.)  The details on how to generate
the LSDA would likely be an appendix showing an example implementation.
G++ (or a different compiler) could use a different LSDA, as long as as
the personality routine performed the same.

The ABI would also need to say something about the name or linkage of
the personality routine, so that if different compilations have different
routines, they won't collide.  (The AMD64 ABI says that there is no
psABI-specified name, but that doesn't prevent collisions.) seems to
Great. This looks like exactly what I was looking for.

Do you happen to know the copyright status on the HP document?

Nope. It obviously is from the aC++ manual, so copyrighted, OTOH it's on CodeSourcerys site, so maybe there's some nice arrangement. And it may or may not be ia64 specific, OTOH much from C++ ABI was derived from the ia64 ABI, so that might not be a problem. I don't even know who can tell us :)

<gripe> Creating any kind of standards document generally involves incorporating material from existing documents. Having clear copyright statements and (preferably open) license terms makes this much easier. </gripe>

But in any case: if you write up anything about the exception handling gory details, it would be extremely nice to have it in a form for the internal manual (or at least for the Wiki) ;)

Ya, sure.

Btw. the LSDA data structures itself (at the low level, i.e. asm directives) are built in except.c (output_function_exception_table and subfunctions), so that's the definitive reference. Compile flags "-fverbose-asm -dA" will also be revealing because of the useful comments besides the LSDA blob definitions.


-- Michael Eager 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]