diff options
author | Michael Snyder <msnyder@vmware.com> | 2000-10-31 19:35:04 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2000-10-31 19:35:04 +0000 |
commit | 1a8629c73571e63f55313b354033825a7ef7cad1 (patch) | |
tree | b0150c865c029162f4252d69a03e805e7d6c3263 /gdb/sh-tdep.c | |
parent | 8637c0456a215e6f89fbb853ebb88485de5368df (diff) | |
download | gdb-1a8629c73571e63f55313b354033825a7ef7cad1.zip gdb-1a8629c73571e63f55313b354033825a7ef7cad1.tar.gz gdb-1a8629c73571e63f55313b354033825a7ef7cad1.tar.bz2 |
2000-10-30 Michael Snyder <msnyder@cleaver.cygnus.com>
* config/sh/tm-linux.h: New file. Include generic tm-linux.h,
plus tm-sh.h, then define SVR4_FETCH_LINK_MAP_OFFSETS to use
the sh target function instead of the default link map offsets.
* config/sh/sh.mt: Add solib.o and solib-svr4.o to TDEPFILES.
Use sh/tm-linux.h instead of sh/tm-sh.h.
* sh-tdep.c (sh_linux_svr4_fetch_link_map_offsets):
New function. Construct target-specific link map offsets.
* i386-linux-tdep.c (i386_linux_svr4_fetch_link_map_offsets:
New function. Construct target-specific link map offsets.
* config/i386/tm-linux.h: Use above function instead of default.
2000-10-30 Michael Snyder <msnyder@cleaver.cygnus.com>
* config/i386/tm-linux.h: Remove definition of SVR4_SHARED_LIBS,
and inclusion of solib.h. Move up into ../tm-linux.h.
config/tm-linux.h: Define SVR4_SHARED_LIBS, include solib.h.
Diffstat (limited to 'gdb/sh-tdep.c')
-rw-r--r-- | gdb/sh-tdep.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index b2b4d2f..44c5bd8 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -39,6 +39,8 @@ #include "arch-utils.h" #include "floatformat.h" +#include "solib-svr4.h" + #undef XMALLOC #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE))) @@ -1798,6 +1800,50 @@ sh_do_registers_info (int regnum, int fpregs) } } +#ifdef SVR4_SHARED_LIBS + +/* Fetch (and possibly build) an appropriate link_map_offsets structure + for native i386 linux targets using the struct offsets defined in + link.h (but without actual reference to that file). + + This makes it possible to access i386-linux shared libraries from + a gdb that was not built on an i386-linux host (for cross debugging). + */ + +struct link_map_offsets * +sh_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; /* 20 not actual size but all we need */ + + lmo.r_map_offset = 4; + lmo.r_map_size = 4; + + lmo.link_map_size = 20; /* 552 not actual size but 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; +} +#endif /* SVR4_SHARED_LIBS */ + static gdbarch_init_ftype sh_gdbarch_init; static struct gdbarch * |