diff options
author | Kevin Buettner <kevinb@redhat.com> | 2002-12-21 05:07:36 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2002-12-21 05:07:36 +0000 |
commit | 96bb4d5a35520c49e0b6027a5534335433071c99 (patch) | |
tree | 458793349b53307e50ec9ace7ad7e720ab781954 /gdb | |
parent | ef7550d5b71c6856a0ce1a715b07416eb2f2b30b (diff) | |
download | gdb-96bb4d5a35520c49e0b6027a5534335433071c99.tar.gz |
Multiarch SVR4_FETCH_LINK_MAP_OFFSETS and GET_LONGJMP_TARGET for GNU/Linux/MIPS.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 14 | ||||
-rw-r--r-- | gdb/Makefile.in | 2 | ||||
-rw-r--r-- | gdb/config/mips/tm-linux.h | 19 | ||||
-rw-r--r-- | gdb/mips-linux-tdep.c | 19 |
4 files changed, 32 insertions, 22 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cdd814d0805..caf57c3d135 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,17 @@ +2002-12-20 Kevin Buettner <kevinb@redhat.com> + + * Makefile.in (mips-linux-tdep.o): Add $(osabi_h) and $(gdb_string_h). + * config/mips/tm-linux.h (mips_linux_svr4_fetch_link_map_offsets) + (mips_linux_get_longjmp_target): Delete declarations. + (SVR4_FETCH_LINK_MAP_OFFSETS, GET_LONGJMP_TARGET) + (MIPS_LINUX_JB_ELEMENT_SIZE, MIPS_LINUX_JB_PC): Delete definitions. + * mips-linux-tdep.c (osabi.h, gdb_string.h): Include. + (MIPS_LINUX_JB_ELEMENT_SIZE, MIPS_LINUX_JB_PC): Define. + (mips_linux_get_longjmp_target) + (mips_linux_svr4_fetch_link_map_offsets): Make static. + (mips_linux_init_abi): New function. + (_initialize_mips_linux_tdep): Register mips_linux_init_abi(). + 2002-12-19 Keith Seitz <keiths@redhat.com> patch committed by Elena Zannoni <ezannoni@redhat.com> diff --git a/gdb/Makefile.in b/gdb/Makefile.in index b5037d2c7d7..f4c72bfe16a 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1946,7 +1946,7 @@ minsyms.o: minsyms.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) \ mips-irix-tdep.o: mips-irix-tdep.c $(defs_h) $(osabi_h) $(elf_bfd_h) mips-linux-nat.o: mips-linux-nat.c $(defs_h) mips-linux-tdep.o: mips-linux-tdep.c $(defs_h) $(gdbcore_h) $(target_h) \ - $(solib_svr4_h) + $(solib_svr4_h) $(osabi_h) $(gdb_string_h) mips-nat.o: mips-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) mips-tdep.o: mips-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ $(symtab_h) $(value_h) $(gdbcmd_h) $(language_h) $(gdbcore_h) \ diff --git a/gdb/config/mips/tm-linux.h b/gdb/config/mips/tm-linux.h index 60e9bee8782..c049c29aa72 100644 --- a/gdb/config/mips/tm-linux.h +++ b/gdb/config/mips/tm-linux.h @@ -40,25 +40,6 @@ #include "config/tm-linux.h" -/* Use target_specific function to define link map offsets. */ - -extern struct link_map_offsets *mips_linux_svr4_fetch_link_map_offsets (void); -#define SVR4_FETCH_LINK_MAP_OFFSETS() \ - mips_linux_svr4_fetch_link_map_offsets () - -/* Details about jmp_buf. */ - -#define MIPS_LINUX_JB_ELEMENT_SIZE 4 -#define MIPS_LINUX_JB_PC 0 - -/* Figure out where the longjmp will land. Slurp the arguments out of the - stack. We expect the first arg to be a pointer to the jmp_buf structure - from which we extract the pc (JB_PC) that we will land at. The pc is - copied into ADDR. This routine returns 1 on success. */ - -#define GET_LONGJMP_TARGET(ADDR) mips_linux_get_longjmp_target(ADDR) -extern int mips_linux_get_longjmp_target (CORE_ADDR *); - /* We do single stepping in software. */ #define SOFTWARE_SINGLE_STEP_P() 1 diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index 9ad457b0352..3a40670d712 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -23,6 +23,8 @@ #include "gdbcore.h" #include "target.h" #include "solib-svr4.h" +#include "osabi.h" +#include "gdb_string.h" /* Copied from <asm/elf.h>. */ #define ELF_NGREG 45 @@ -60,7 +62,10 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; which we extract the pc (MIPS_LINUX_JB_PC) that we will land at. The pc is copied into PC. This routine returns 1 on success. */ -int +#define MIPS_LINUX_JB_ELEMENT_SIZE 4 +#define MIPS_LINUX_JB_PC 0 + +static int mips_linux_get_longjmp_target (CORE_ADDR *pc) { CORE_ADDR jb_addr; @@ -309,7 +314,7 @@ static struct core_fns regset_core_fns = This makes it possible to access GNU/Linux MIPS shared libraries from a GDB that was built on a different host platform (for cross debugging). */ -struct link_map_offsets * +static struct link_map_offsets * mips_linux_svr4_fetch_link_map_offsets (void) { static struct link_map_offsets lmo; @@ -342,8 +347,18 @@ mips_linux_svr4_fetch_link_map_offsets (void) return lmp; } +static void +mips_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + set_gdbarch_get_longjmp_target (gdbarch, mips_linux_get_longjmp_target); + set_solib_svr4_fetch_link_map_offsets + (gdbarch, mips_linux_svr4_fetch_link_map_offsets); +} + void _initialize_mips_linux_tdep (void) { + gdbarch_register_osabi (bfd_arch_mips, GDB_OSABI_LINUX, + mips_linux_init_abi); add_core_fns (®set_core_fns); } |