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

Unified Diff: gdb/nacl-tdep.c

Issue 10700182: Dumb change to support 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 e74a962ddbc5ea830a32d8d6f9a7a019f658245d..91db26266505d7c8edc26f3f3df889bb9363a586 100644
--- a/gdb/nacl-tdep.c
+++ b/gdb/nacl-tdep.c
@@ -25,6 +25,8 @@
#include "nacl-manifest.h"
#include "symtab.h"
#include "solib-svr4.h"
+#include "frame.h"
+#include "osabi.h"
static void
nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
@@ -47,6 +49,28 @@ i386_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
nacl_init_abi (info, gdbarch);
}
+static CORE_ADDR
+amd64_nacl_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR val)
+{
+ return val & 0xffffffffUL;
+}
+
+static CORE_ADDR
+amd64_nacl_unwind_pc (struct gdbarch *gdbarch, struct frame_info *this_frame)
+{
+ CORE_ADDR pc;
+ pc = frame_unwind_register_unsigned (this_frame, gdbarch_pc_regnum (gdbarch));
+ return amd64_nacl_addr_bits_remove (gdbarch, pc);
+}
+
+static CORE_ADDR
+amd64_nacl_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
+{
+ CORE_ADDR sp;
+ sp = frame_unwind_register_unsigned (this_frame, gdbarch_sp_regnum (gdbarch));
+ return amd64_nacl_addr_bits_remove (gdbarch, sp);
+}
+
static void
amd64_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
@@ -57,6 +81,9 @@ amd64_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_solib_svr4_fetch_link_map_offsets (gdbarch,
svr4_lp64_fetch_link_map_offsets);
nacl_init_abi (info, gdbarch);
+ set_gdbarch_addr_bits_remove (gdbarch, amd64_nacl_addr_bits_remove);
+ set_gdbarch_unwind_pc (gdbarch, amd64_nacl_unwind_pc);
+ set_gdbarch_unwind_sp (gdbarch, amd64_nacl_unwind_sp);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
« 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