aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2005-09-06 23:14:44 +0000
committerKevin Buettner <kevinb@redhat.com>2005-09-06 23:14:44 +0000
commit696cc4a69c289715d0d04de54b436e7ade8c2dea (patch)
treec5509f32ff5149dde70fd4d8ae20e8bea8e32489 /gdb
parentbfc1906fb07f235cb909a8d7860491e521c56c77 (diff)
downloadgdb-696cc4a69c289715d0d04de54b436e7ade8c2dea.zip
gdb-696cc4a69c289715d0d04de54b436e7ade8c2dea.tar.gz
gdb-696cc4a69c289715d0d04de54b436e7ade8c2dea.tar.bz2
* mn10300-linux-tdep.c (solib-svr4.h): Include.
(mn10300_linux_svr4_fetch_link_map_offsets): New function. (am33_linux_init_osabi): Register it. * Makefile.in (mn10300-linux-tdep.o): Update dependencies.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/Makefile.in3
-rw-r--r--gdb/mn10300-linux-tdep.c46
3 files changed, 55 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7e23cf1..10914d1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2005-09-06 Kevin Buettner <kevinb@redhat.com>
+ * mn10300-linux-tdep.c (solib-svr4.h): Include.
+ (mn10300_linux_svr4_fetch_link_map_offsets): New function.
+ (am33_linux_init_osabi): Register it.
+ * Makefile.in (mn10300-linux-tdep.o): Update dependencies.
+
+2005-09-06 Kevin Buettner <kevinb@redhat.com>
+
* mn10300-tdep.c (mn10300_analyze_prologue): Delete code disabled
via "#if 0".
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 7c5f86a..efc2d66 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2306,7 +2306,8 @@ mips-tdep.o: mips-tdep.c $(defs_h) $(gdb_string_h) $(gdb_assert_h) \
mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \
$(regcache_h) $(gregset_h)
mn10300-linux-tdep.o: mn10300-linux-tdep.c $(defs_h) $(gdbcore_h) \
- $(gdb_string_h) $(regcache_h) $(mn10300_tdep_h)
+ $(gdb_string_h) $(regcache_h) $(mn10300_tdep_h) $(gdb_assert_h) \
+ $(bfd_h) $(elf_bfd_h) $(osabi_h) $(regset_h) $(solib_svr4_h)
mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(arch_utils_h) $(dis_asm_h) \
$(gdbtypes_h) $(regcache_h) $(gdb_string_h) $(gdb_assert_h) \
$(frame_h) $(frame_unwind_h) $(frame_base_h) $(trad_frame_h) \
diff --git a/gdb/mn10300-linux-tdep.c b/gdb/mn10300-linux-tdep.c
index e0f557c..bba2643 100644
--- a/gdb/mn10300-linux-tdep.c
+++ b/gdb/mn10300-linux-tdep.c
@@ -29,6 +29,7 @@
#include "elf-bfd.h"
#include "osabi.h"
#include "regset.h"
+#include "solib-svr4.h"
#include <stdlib.h>
@@ -467,6 +468,49 @@ am33_regset_from_core_section (struct gdbarch *gdbarch,
am33_collect_gregset_method);
}
+/* Fetch, and possibly build, an appropriate link_map_offsets structure
+ for mn10300 linux targets using the struct offsets defined in <link.h>.
+ Note, however, that link.h is not actually referred to in this file.
+ Instead, the relevant structs offsets were obtained from examining
+ link.h. (We can't refer to link.h from this file because the host
+ system won't necessarily have it, or if it does, the structs which
+ it defines will refer to the host system, not the target.) */
+
+struct link_map_offsets *
+mn10300_linux_svr4_fetch_link_map_offsets (void)
+{
+ static struct link_map_offsets lmo;
+ static struct link_map_offsets *lmp = 0;
+
+ if (lmp == 0)
+ {
+ lmp = &lmo;
+
+ lmo.r_debug_size = 8; /* Actual size is 20, but this is all we
+ need. */
+
+ lmo.r_map_offset = 4;
+ lmo.r_map_size = 4;
+
+ lmo.link_map_size = 20; /* Might be larger, but this is all we
+ need. */
+
+ lmo.l_addr_offset = 0;
+ lmo.l_addr_size = 4;
+
+ lmo.l_name_offset = 4;
+ lmo.l_name_size = 4;
+
+ lmo.l_next_offset = 12;
+ lmo.l_next_size = 4;
+
+ lmo.l_prev_offset = 16;
+ lmo.l_prev_size = 4;
+ }
+
+ return lmp;
+}
+
/* AM33 Linux osabi has been recognized.
Now's our chance to register our corefile handling. */
@@ -475,6 +519,8 @@ am33_linux_init_osabi (struct gdbarch_info gdbinfo, struct gdbarch *gdbarch)
{
set_gdbarch_regset_from_core_section (gdbarch,
am33_regset_from_core_section);
+ set_solib_svr4_fetch_link_map_offsets
+ (gdbarch, mn10300_linux_svr4_fetch_link_map_offsets);
}
void