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. */ |