diff options
author | Kevin Buettner <kevinb@redhat.com> | 2001-11-30 20:27:09 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2001-11-30 20:27:09 +0000 |
commit | a42dd537c4eefd5681bf0ced97b2eb7735b2d9f0 (patch) | |
tree | 505b640c11cf842e523d7a7a2d32e07c49376c48 | |
parent | 25d559ca7846a5fb9cd61015912469efa792584d (diff) | |
download | gdb-a42dd537c4eefd5681bf0ced97b2eb7735b2d9f0.zip gdb-a42dd537c4eefd5681bf0ced97b2eb7735b2d9f0.tar.gz gdb-a42dd537c4eefd5681bf0ced97b2eb7735b2d9f0.tar.bz2 |
Define SVR4 link map offset fetcher for Linux/ARM.
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/arm-tdep.c | 44 | ||||
-rw-r--r-- | gdb/config/arm/tm-linux.h | 4 |
3 files changed, 56 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7078df5..aa767ca 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2001-11-30 Kevin Buettner <kevinb@redhat.com> + + From Louis Hamilton <hamilton@redhat.com>: + * arm-tdep.c (solib-svr4.h): Include. + (arm_linux_svr4_fetch_link_map_offsets): New function. + * config/arm/tm-linux.h (SVR4_FETCH_LINK_MAP_OFFSETS): Define. + (arm_linux_svr4_fetch_link_map_offsets): Declare. + 2001-11-30 Daniel Jacobowitz <drow@mvista.com> * values.c (value_primitive_field): Add embedded_offset to the diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 4243fd7..f7d91ed 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -32,6 +32,7 @@ #include "regcache.h" #include "doublest.h" #include "value.h" +#include "solib-svr4.h" /* Each OS has a different mechanism for accessing the various registers stored in the sigcontext structure. @@ -2068,6 +2069,49 @@ arm_othernames (char *names, int n) set_disassembly_flavor (); } +/* Fetch, and possibly build, an appropriate link_map_offsets structure + for ARM 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 * +arm_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; /* Actual size is 552, 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; +} + void _initialize_arm_tdep (void) { diff --git a/gdb/config/arm/tm-linux.h b/gdb/config/arm/tm-linux.h index 8f18e00..4ef05bb 100644 --- a/gdb/config/arm/tm-linux.h +++ b/gdb/config/arm/tm-linux.h @@ -26,6 +26,10 @@ #include "tm-linux.h" +/* Use target-specific function to define link map offsets. */ +extern struct link_map_offsets *arm_linux_svr4_fetch_link_map_offsets (void); +#define SVR4_FETCH_LINK_MAP_OFFSETS() arm_linux_svr4_fetch_link_map_offsets () + /* Target byte order on ARM Linux is little endian and not selectable. */ #undef TARGET_BYTE_ORDER_SELECTABLE_P #define TARGET_BYTE_ORDER_SELECTABLE_P 0 |