On 09/27/2010 10:36 AM, Luke A. Guest wrote: > On Mon, 2010-09-27 at 11:12 +0200, Olivier Hainque wrote: >> Hello Luke, >> >> Luke A. Guest wrote: >>> I'm having a look into getting DWARF2 exceptions (ZCX) working on ARM. >> >> Thanks :-) > > Well, I'm reading as much as I can regarding this, but finding it hard > to work some things out. I've been reading through: > http://gcc.gnu.org/ml/gcc/2004-03/msg01779.html and trying some example > code in C++ and Ada, but it doesn't seem to match up in some places, > i.e. no calls into __register_frame_info() yet the libgcc_eh.so contains > the function. > >>> Any pointers would be gratefully received. I'm fairly sure I know where >>> to start. >> >> A few general points, jic. >> >> The first thing will be to adjust your target system.ads to >> have GCC_ZCX_Support := True, then use the gnatlib-zcx Makefile >> target, with essentially two effects: adjust your target system.ads >> further to switch the GCC_ZCX_Support to True as well, and arrange >> to build/link with the "-gcc" variants of a-exexpr.adb and raise.c. > > Yup, aware of this so far. > >> The system.ads changes control the compiler to declare eh regions, produce >> dwarf eh info etc. > > Yup. > >> The use of -gcc variants is for the runtime library, switching to the >> libgcc services for exception propagations. >> >> raise-gcc.c hosts the Ada personality routine, where a number of changes >> will be needed I believe. > > Also, I think tracebak.c is where the ARM specific routine(s) will need > to go, included from another file tb-armlinux.c? I think this will be > required as (if I'm right), different ARM CPU's have differing number of > registers, and I think I read in the ARM docs that float regs won't need > to be saved if they're not used. I could be wrong about this though. > >> There, please, I'd rather have the ARM specializations abstracted as >> much as possible, e.g. with new functions and alternate implementations, >> instead of provided as #ifdefs blocks spread within existing functions. > > Well, I think that's possible to a point, obviously some things will > have to go into ifdef's unfortunately (it's not Ada :D). > > Hopefully, I can rely on some help from you AdaCore guys? This is my > first foray into GCC internals :/
The best clue you're going to get is my work to solve the same problem in libgcj. Most of what you need to know is in libjava/exception.cc. See Revision 128098. Andrew.