Hi,

I've been reading as much as possible and trying to follow the source as
much as possible and have, I think, come across a bit of a stopper as it
may require a re-arrangement of GNAT sources, if I'm right, that is.

So an exception object is defined within a-exexpr-gcc.adb as:

   type Unwind_Exception is record
      Class    : Exception_Class := GNAT_Exception_Class;
      Cleanup  : System.Address  := System.Null_Address;
      Private1 : Unwind_Word;
      Private2 : Unwind_Word;
   end record;

This maps onto the C structure for DWARF2 exceptions. GNAT then defines
it's language specific record:

   type GNAT_GCC_Exception is record
      Header : Unwind_Exception;
      --  ABI Exception header first

      Id : Exception_Id;
      ...
      etc.
      ...
   end record;

With it's extra fields tagged onto the end. No problem there.

The ARM EABI code has it's own unwinder library defined within
gcc/config/arm/unwind-arm.[ch].

When _Unwind_RaiseException is called, a stub in libunwind.S is called
which sets up an extra parameter for the Virtual Register Set (VRS) data
and then calls the __gnu_Unwind_RaiseException which was a
_Unwind_Control_Block as a first parameter. All the other API functions
are handled similarly.

Within unwind-arm.h this line is defined:

#define _Unwind_Exception _Unwind_Control_Block

>From what I can tell, the _Unwind_Control_Block is the _Unwind_Exception
under ARM EABI, which is actually bigger than the _Unwind_Exception
struct by quite a bit. This will cause a problem for GNAT as it's
written in Ada, rather than C, like the other front-ends.

So, if I'm correct, I need to extract Unwind_Exception from
a-exexpr-gcc.adb into 2 private child packages, 1 for the ARM EABI and 1
for everything else which works normally. The ARM EABI version will then
mirror the _Unwind_Control_Block defined in unwind-arm.h.

Can someone verify if my assertions are correct before I do anything
further?

Thanks,
Luke.


Reply via email to