This is the mail archive of the gdb-patches@sources.redhat.com 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]

[PATCH] make gdb run on alpha osf5.1 target


Hi,

I have a patch to make the debugger run on the alpha osf5.1. Unpatched
the debugger is unusable because:

1) does not compile because access to EF_* in machine/reg.h is not allowed.
2) next/step does not work as expected.
3) it crashes in solib_add (memory exhausted because of endless
   loop). 

For the first two points I found the patches on the net.

The patches are against gdb-5.0. 

Would it be possible to have them somehow included in the sources?

regards,
Dirk
-- 
Dirk Bonné                 Email: dbonne@inform-ac.com
INFORM GmbH                Tel. : +49(0)2408-9456-366
Logistics Division         Fax  : +49(0)02408-6090

Index: gdb/alpha-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-nat.c,v
retrieving revision 1.1.1.3
diff -u -u -p -r1.1.1.3 alpha-nat.c
--- alpha-nat.c	1999/10/05 23:07:58	1.1.1.3
+++ alpha-nat.c	2001/02/19 12:40:29
@@ -27,7 +27,7 @@
 #include <asm/reg.h>
 #include <alpha/ptrace.h>
 #else
-#include <machine/reg.h>
+#include <machine/coreregs.h>
 #endif
 #include <sys/user.h>
 
@@ -101,16 +101,16 @@ fetch_osf_core_registers (core_reg_sect,
      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,
+#define EFL (NCF_REGS)
+    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,
     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_PC, -1
   };
   static char zerobuf[MAX_REGISTER_RAW_SIZE] =
   {0};
Index: gdb/configure.host
===================================================================
RCS file: /cvs/src/src/gdb/configure.host,v
retrieving revision 1.4.2.1
diff -u -u -p -r1.4.2.1 configure.host
--- configure.host	2000/05/01 16:30:55	1.4.2.1
+++ configure.host	2001/02/19 12:40:29
@@ -32,7 +32,10 @@ a29k-*-*)		gdb_host=ultra3 ;;
 
 alpha*-*-osf1*)		gdb_host=alpha-osf1 ;;
 alpha*-*-osf2*)		gdb_host=alpha-osf2 ;;
-alpha*-*-osf[3456789]*)	gdb_host=alpha-osf3 ;;
+alpha*-*-osf[34]*)	gdb_host=alpha-osf3 ;;
+alpha*-*-osf5.0)        gdb_host=alpha-osf3 ;;
+alpha*-*-osf*)          gdb_host=alpha-osf51 ;;
+
 alpha*-*-linux*)	gdb_host=alpha-linux ;;
 
 arm*-*-linux*)		gdb_host=linux ;;
Index: gdb/osfsolib.c
===================================================================
RCS file: /cvs/src/src/gdb/osfsolib.c,v
retrieving revision 1.2
diff -u -u -p -r1.2 osfsolib.c
--- osfsolib.c	2000/04/04 02:08:52	1.2
+++ osfsolib.c	2001/02/19 12:40:29
@@ -394,7 +394,13 @@ next_link_map_member (so_list_ptr)
 			     (char *) &next_lm.module_info,
 			     sizeof (ldr_module_info_t)) != 0)
     return lm;
-
+#ifdef LDR_OSF51
+  /* modinfo_addr isn't set, so do it by hand */
+  next_lm.module_info.modinfo_addr = so_list_ptr->lm.module_info.next;
+  if(next_lm.module_info.module_id == 2) /* ignore first two modules */
+    next_lm.module_info.module_name = NULL;
+#endif
+  
   lm = &next_lm;
   lm->l_name = lm->module_info.module_name;
 #endif
Index: gdb/symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.3
diff -u -u -p -r1.3 symtab.c
--- symtab.c	2000/04/04 02:08:52	1.3
+++ symtab.c	2001/02/19 12:40:31
@@ -4410,6 +4410,26 @@ in_prologue (pc, func_start)
   if (sal.line == 0)
     goto nosyms;
 
+#ifdef TM_ALPHA_H
+ 
+  /* N.B.: If the `sal' we got does not belong to the pc's
+     function we fetch the following `sal'. This is actually
+     a work around a bug in egcs-1.1.[12] since this compiler
+     generates bad line number info for alpha-dec-osf targets. */
+  
+  if ((sal.pc < func_addr) || (sal.pc > sal.end))
+    {
+      sal.line = 0;
+      
+      if (sal.end < func_end)
+        sal = find_pc_line (sal.end, 0);
+      
+      if (sal.line == 0)
+        goto nosyms;
+    }
+
+#endif
+
   /* sal.end is the address of the first instruction past sal.line. */
   if (sal.end > func_addr
       && sal.end <= func_end)	/* Is prologue in function? */
Index: gdb/config/alpha/alpha-osf51.mh
===================================================================
RCS file: alpha-osf51.mh
diff -N alpha-osf51.mh
--- /dev/null	Tue May  5 13:32:27 1998
+++ alpha-osf51.mh	Mon Feb 19 04:40:31 2001
@@ -0,0 +1,7 @@
+# Host: Little-endian Alpha running OSF/5.1 and higher using procfs
+XDEPFILES= 
+XM_FILE= xm-alphaosf.h
+NAT_FILE= nm-osf51.h
+NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o \
+	osfsolib.o procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
+
Index: gdb/config/alpha/nm-osf51.h
===================================================================
RCS file: nm-osf51.h
diff -N nm-osf51.h
--- /dev/null	Tue May  5 13:32:27 1998
+++ nm-osf51.h	Mon Feb 19 04:40:31 2001
@@ -0,0 +1,29 @@
+/* Native definitions for alpha running OSF/5.1 and higher, using procfs.
+   Copyright (C) 1995 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "alpha/nm-osf3.h"
+
+/* implementation of the loader changed against osf3
+
+   The link_map list in the loader has slight changes:
+   - the modinfo_addr isn't set. 
+   - the first two modules should be ignored, instead of only the first one.
+*/
+#define LDR_OSF51

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