Implement dummy_id for NaCl architecture because we need to sandbox frame pointer.
This function describes stack frames created by gdb in order to call user functions.
BUG= http://code.google.com/p/nativeclient/issues/detail?id=2990
TEST= none
R=eaeltsin@google.com,khim@google.com
Review URL: https://chromiumcodereview.appspot.com/10897005
diff --git a/gdb/nacl-tdep.c b/gdb/nacl-tdep.c
index 9a408dd..f33af43 100644
--- a/gdb/nacl-tdep.c
+++ b/gdb/nacl-tdep.c
@@ -162,6 +162,17 @@
return 0;
}
+static struct frame_id
+amd64_nacl_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
+{
+ CORE_ADDR fp;
+
+ fp = get_frame_register_unsigned (this_frame, AMD64_RBP_REGNUM) + 16;
+ fp = amd64_nacl_addr_bits_remove(gdbarch, fp);
+
+ return frame_id_build (fp, get_frame_pc (this_frame));
+}
+
static void
amd64_nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
@@ -199,6 +210,8 @@
set_gdbarch_adjust_breakpoint_address (gdbarch,
amd64_nacl_adjust_breakpoint_address);
set_gdbarch_software_single_step (gdbarch, amd64_nacl_software_single_step);
+ /* Recognizing dummy frames. */
+ set_gdbarch_dummy_id(gdbarch, amd64_nacl_dummy_id);
}
/* Provide a prototype to silence -Wmissing-prototypes. */