This is the mail archive of the gcc@gcc.gnu.org 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 tables for function generated on the fly


Tom Quarendon wrote:

> If I do this I get std::terminate called from __cxa_throw. Researching
> this it seems that I somehow need to register some exception handling
> tables to correspond to the "magic" function to enable the exception
> handler to allow the exception to propagate through.

Right.

> I'd welcome any pointers to where I might be able to get some
> information on this. I've looked at the C++ ABI documentation which
> helps a bit, and I've found some information on the format that the
> tables need to be in (and indeed I've looked at the assembler generated
> by the gcc compiler if I code up "magic" and compile it directly), but I
> don't yet see quite how to put it all together.

There's no quick way to solve this: you'll just have to study DWARF
unwinder data and figure out how to generate it.  It's not particularly
difficult, but there is a fair bit to learn.  As you're writing a JIT
it may well be that you can use a simplified subset of DWARF; you don't
need to cater for every possibility.

Call __register_frame_info() when you're done.

Andrew.


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