Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: gdb/nacl-tdep.c

Issue 10797007: GDB: fix offsets for reading svr4 link map on x86_64-nacl (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/nacl-tdep.c
diff --git a/gdb/nacl-tdep.c b/gdb/nacl-tdep.c
index edb376398bc6410b8ee3b97b0125e12c7df3dab4..53dc8f9f253bc94ca38354b33b667f8b8441cf6c 100644
--- a/gdb/nacl-tdep.c
+++ b/gdb/nacl-tdep.c
@@ -71,6 +71,34 @@ amd64_nacl_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
return amd64_nacl_addr_bits_remove (gdbarch, sp);
}
+struct link_map_offsets *
+amd64_nacl_fetch_link_map_offsets (void)
+{
+ static struct link_map_offsets lmo;
+ static struct link_map_offsets *lmp = NULL;
+
+ if (lmp == NULL)
+ {
+ lmp = &lmo;
+
+ lmo.r_version_offset = 0;
+ lmo.r_version_size = 4;
+ lmo.r_map_offset = 4;
+ lmo.r_brk_offset = 8;
+ /* Dynamic linker is in the normal list of shared objects. */
+ lmo.r_ldsomap_offset = -1;
+
+ lmo.link_map_size = 24;
+ lmo.l_addr_offset = 0;
+ lmo.l_name_offset = 8;
+ lmo.l_ld_offset = 12;
+ lmo.l_next_offset = 16;
+ lmo.l_prev_offset = 20;
+ }
+
+ return lmp;
+}
+
static void
amd64_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
@@ -79,7 +107,7 @@ amd64_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_init_abi (info, gdbarch);
tdep->tdesc = tdesc_amd64_linux;
set_solib_svr4_fetch_link_map_offsets (gdbarch,
- svr4_lp64_fetch_link_map_offsets);
+ amd64_nacl_fetch_link_map_offsets);
nacl_init_abi (info, gdbarch);
/* NaCl data model.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698