This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
patch to gdb on Tru64 5.1
- To: gdb-patches at sources dot redhat dot com
- Subject: patch to gdb on Tru64 5.1
- From: Joel Brobecker <brobecker at act-europe dot fr>
- Date: Wed, 9 May 2001 08:22:28 +0200
Hi,
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). ACT is happy to contribute the changes that we made in
the hope that it will be useful to others.
Here is the patch agains the latest CVS sources that will allow gdb to
compile and work on Tru64 5.1 using the native cc compiler. I don't know
if it will successfully build with gcc.
On top of the patch, there is this new file 'alpha-osf5.mh' in
'gdb/config/alpha' that will need to be created. I am attaching it as
well.
The ChangeLog:
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.
configure.host:
---------------
set gdb_host to alpha-osf5 for Tru64 5+ (instead of alpha-osf3).
osfsolib.c:
-----------
in_solib_dynsym_resolve_code: provide a dummy implementation for this
function. It is not used on Tru64, but is needed anyway to avoid
undefined symbols (it is declared in solib.h, which is not target
dependent). The best approach is probably to conditionalize the
definition of this procedure in solib.h so that it is not defined
when building on Tru64 5+, but I am not sure how to do that yet.
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). Added
the associated linking flags to NAT_CLIBS.
Cheers,
--
Joel
Index: gdb/alpha-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-nat.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 alpha-nat.c
*** alpha-nat.c 2001/03/06 08:21:05 1.7
--- alpha-nat.c 2001/05/09 05:33:21
***************
*** 29,35 ****
#include <asm/reg.h>
#include <alpha/ptrace.h>
#else
! #include <machine/reg.h>
#endif
#include <sys/user.h>
--- 29,35 ----
#include <asm/reg.h>
#include <alpha/ptrace.h>
#else
! #include <alpha/coreregs.h>
#endif
#include <sys/user.h>
*************** fetch_osf_core_registers (char *core_reg
*** 97,112 ****
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
};
static char zerobuf[MAX_REGISTER_RAW_SIZE] =
{0};
--- 97,121 ----
The floating point register values are garbage in OSF/1.2 core files. */
static int core_reg_mapping[NUM_REGS] =
{
+ #ifdef NCF_REGS
+ #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,
+ #else
#define EFL (EF_SIZE / 8)
+ #define CF_PC EF_PC
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,
+ #endif
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,
! 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.20
diff -c -3 -p -r1.20 configure.host
*** configure.host 2001/04/27 16:40:29 1.20
--- configure.host 2001/05/09 05:33:21
*************** case "${host}" in
*** 30,36 ****
alpha*-*-osf1*) gdb_host=alpha-osf1 ;;
alpha*-*-osf2*) gdb_host=alpha-osf2 ;;
! alpha*-*-osf[3456789]*) gdb_host=alpha-osf3 ;;
alpha*-*-linux*) gdb_host=alpha-linux ;;
alpha*-*-freebsd*) gdb_host=fbsd ;;
--- 30,37 ----
alpha*-*-osf1*) gdb_host=alpha-osf1 ;;
alpha*-*-osf2*) gdb_host=alpha-osf2 ;;
! alpha*-*-osf[34]*) gdb_host=alpha-osf3 ;;
! alpha*-*-osf[56789]*) gdb_host=alpha-osf5 ;;
alpha*-*-linux*) gdb_host=alpha-linux ;;
alpha*-*-freebsd*) gdb_host=fbsd ;;
Index: gdb/osfsolib.c
===================================================================
RCS file: /cvs/src/src/gdb/osfsolib.c,v
retrieving revision 1.9
diff -c -3 -p -r1.9 osfsolib.c
*** osfsolib.c 2001/05/04 04:15:26 1.9
--- osfsolib.c 2001/05/09 05:33:24
*************** must be loaded manually, using `sharedli
*** 933,935 ****
--- 933,944 ----
&setlist),
&showlist);
}
+
+
+ int
+ in_solib_dynsym_resolve_code (CORE_ADDR pc)
+ {
+ /* This function is actually never used for the moment, but is needed
+ because it is defined solib.h. We just return False all the time. */
+ return 0;
+ }
# Host: Little-endian Alpha running OSF/1-5.x and higher using procfs
MH_CFLAGS = -DUSE_LDR_ROUTINES
XDEPFILES=
XM_FILE= xm-alphaosf.h
NAT_FILE= nm-osf3.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
NAT_CLIBS= -lpthreaddebug -lxproc -Wl,-expect_unresolved,ldr_process_context