patch to gdb on Tru64 5.1

Nick Duffek nsd@redhat.com
Thu May 10 09:56:00 GMT 2001


Hi,

On 9-May-2001, Joel Brobecker wrote:

>I am an employee of Ada Core Technologies, Inc, and I've done some work
>on gdb to make it work on Tru64 5.1 (it currently does not compile on
>this plateform).

Recently I did the same thing.

>alpha-nat.c:
>------------
>fetch_osf_core_registers: adapt the table used to map the regnum to
> the core register section index to work on Tru64 5.1 as well.

I did that slightly differently:

@@ -95,16 +95,19 @@ fetch_osf_core_registers (char *core_reg
      The floating point register values are garbage in OSF/1.2 core files.  */
   static int core_reg_mapping[NUM_REGS] =
   {
-#define EFL (EF_SIZE / 8)
-    EF_V0, EF_T0, EF_T1, EF_T2, EF_T3, EF_T4, EF_T5, EF_T6,
-    EF_T7, EF_S0, EF_S1, EF_S2, EF_S3, EF_S4, EF_S5, EF_S6,
-    EF_A0, EF_A1, EF_A2, EF_A3, EF_A4, EF_A5, EF_T8, EF_T9,
-    EF_T10, EF_T11, EF_RA, EF_T12, EF_AT, EF_GP, EF_SP, -1,
-    EFL + 0, EFL + 1, EFL + 2, EFL + 3, EFL + 4, EFL + 5, EFL + 6, EFL + 7,
-    EFL + 8, EFL + 9, EFL + 10, EFL + 11, EFL + 12, EFL + 13, EFL + 14, EFL + 15,
-    EFL + 16, EFL + 17, EFL + 18, EFL + 19, EFL + 20, EFL + 21, EFL + 22, EFL + 23,
-    EFL + 24, EFL + 25, EFL + 26, EFL + 27, EFL + 28, EFL + 29, EFL + 30, EFL + 31,
-    EF_PC, -1
+    CF_V0, CF_T0, CF_T1, CF_T2, CF_T3, CF_T4, CF_T5, CF_T6,
+    CF_T7, CF_S0, CF_S1, CF_S2, CF_S3, CF_S4, CF_S5, CF_S6,
+    CF_A0, CF_A1, CF_A2, CF_A3, CF_A4, CF_A5, CF_T8, CF_T9,
+    CF_T10, CF_T11, CF_RA, CF_T12, CF_AT, CF_GP, CF_SP, -1,
+    NCF_REGS + 0, NCF_REGS + 1, NCF_REGS + 2, NCF_REGS + 3,
+    NCF_REGS + 4, NCF_REGS + 5, NCF_REGS + 6, NCF_REGS + 7,
+    NCF_REGS + 8, NCF_REGS + 9, NCF_REGS + 10, NCF_REGS + 11,
+    NCF_REGS + 12, NCF_REGS + 13, NCF_REGS + 14, NCF_REGS + 15,
+    NCF_REGS + 16, NCF_REGS + 17, NCF_REGS + 18, NCF_REGS + 19,
+    NCF_REGS + 20, NCF_REGS + 21, NCF_REGS + 22, NCF_REGS + 23,
+    NCF_REGS + 24, NCF_REGS + 25, NCF_REGS + 26, NCF_REGS + 27,
+    NCF_REGS + 28, NCF_REGS + 29, NCF_REGS + 30, NCF_REGS + 31,
+    CF_PC, -1
   };
   static char zerobuf[MAX_REGISTER_RAW_SIZE] =
   {0};

I think that approach addresses Andrew's comment about mixing EF macros
with CF ones.

>alpha-osf5.mh:
>--------------
>new file. This is a modified version of alpha-osf3.mh where
> -DUSE_LDR_ROUTINES is added to the compilation flags. This forces gdb to
> use the xproc library to load the symbols, instead of relying on an
> empirical algorithm (which does not work on Tru64 5.1 anymore).

That didn't work when I tried it, because the xproc routines only allow a
process to examine itself.  It _seems_ to work because GDB happens to load
the same shared libraries as most programs it debugs (libc.so and
libm.so), but it doesn't when debugging programs linked against other
shared libs.

I'll post an alternative patch for shared library support in a separate
message.

Nick



More information about the Gdb-patches mailing list