This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

Summary of conventions for hppa-hpux


Hey Randolph,

I had a chance to research a bit the GNAT conventions with respect to
the unwind record last week. Here is a small summary that shows a bit
the differences I now know of between the HP compilers, GCC, and what
I called GNAT, which is our in-house GCC.

----------
--  HP  --
----------

  * Save_SP: Means Previous_SP saved in frame marker
    JDA: Not used by HP.

  * Large_frame_r3: 1 if r3 is the frame pointer

-----------
--  GCC  --
-----------

  * Save_SP => r3 is used at the frame pointer

  * Entry_FR & Entry_GR:
    Warning: GCC saves FRs & GRs a bit differently.

Not used by GCC:

  * Large_frame_r3  
  * alloca_frame
  
------------
--  GNAT  --
------------

  * Entry_FR: Always zero.

      - HP ABI says: FP saved first, then GR saved after
      - GCC does something different:
          1. Saves r3
          2. Saves GP regs
          3. Saves FP regs

      So GNAT does not set the Entry_FR field, so that the unwinder
      can fetch the GR registers at the right location.

  * alloca_frame: 1 if function uses alloca.
    => Large_frame_r3

      PB: GCC always uses r3, which ABI says it could be either r3 or r4
          dependending on frame size.
          => we also set Large_frame_r3 when setting alloca_frame so
             that the HP unwinder knows to use r3 to do the unwinding.

      Note: The meaning of the frame pointer is different between what
            the ABI says, and what GCC implements. The location they
            point to is different. I don't think this has any influence
            on the debugger, though.
            see s-traceb-hpux.adb (Prepare_For_Unwind_Of)

-- 
Joel


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