Exception handling HowTO??

Jim Wilson wilson@specifixinc.com
Tue Mar 30 00:53:00 GMT 2004


Jan Hoogerbrugge wrote:
> I can use some advice to implement exception handing for my target port. 

I doubt that we have a HowTO anywhere.

The simple way is to just builtin setjmp/longjmp style EH.  You 
probabbly don't need much if builtin setjmp/longjmp already work.  The 
efficient way is to use DWARF2 CFI style unwinding.  For this, you will 
need to do quite a bit of work.

See the "Exception Handling" node of the gcc docs for some of the macros 
that need to be defined to make DWARF2 style unwinding work.

You will have to define DWARF2 CFI support for your target, and 
implement it.  You will have to modify the prologue support to emit 
DWARF2 CFI info, which is usually done by marking insns with 
RTX_FRAME_RELATED_P, and then letting machine independent code handle 
the rest.  You may have to do some of this in machine dependent code. 
See the docs for DWRAF2_DEBUGGING_INFO.

In general, searching the gcc docs for "exception" and "dwarf2" should 
turn up useful info scattered around the gcc docs.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list