aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-11-06 11:02:12 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-11-06 11:02:12 +0000
commitc12260ac385cffb6c60330b62a789a4fad9f52a1 (patch)
tree5ffbe71a86f4cb4f586708895cb14e10e224c76c /gdb/gdbarch.c
parent9e5abb068c86f04dcdd5ca82068caad4785c3a85 (diff)
downloadgdb-c12260ac385cffb6c60330b62a789a4fad9f52a1.zip
gdb-c12260ac385cffb6c60330b62a789a4fad9f52a1.tar.gz
gdb-c12260ac385cffb6c60330b62a789a4fad9f52a1.tar.bz2
* arch-utils.c (generic_in_function_epilogue_p): New function.
* arch-utils.h (generic_in_function_epilogue_p): Declare extern. * breakpoint.c (watchpoint_check): Add test whether the pc is currently in the epilogue of a function. * gdbarch.c: Autogenerated from gdbarch.sh. * gdbarch.h: Ditto. * gdbarch.sh (function_list): Add `in_function_epilogue_p' definition.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 9cbc87a..94cac02 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -254,6 +254,7 @@ struct gdbarch
gdbarch_print_insn_ftype *print_insn;
gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
+ gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
};
@@ -392,6 +393,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
+ 0,
/* startup_gdbarch() */
};
@@ -500,6 +502,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->print_insn = legacy_print_insn;
current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
+ current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
/* gdbarch_alloc() */
return current_gdbarch;
@@ -754,6 +757,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of print_insn, invalid_p == 0 */
/* Skip verify of skip_trampoline_code, invalid_p == 0 */
/* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
+ /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
buf = ui_file_xstrdup (log, &dummy);
make_cleanup (xfree, buf);
if (strlen (buf) > 0)
@@ -780,6 +784,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
GDB_MULTI_ARCH);
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
+ "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
+ (long) current_gdbarch->in_function_epilogue_p);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
"gdbarch_dump: register_read = 0x%08lx\n",
(long) current_gdbarch->register_read);
if (GDB_MULTI_ARCH)
@@ -4241,6 +4249,24 @@ set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
gdbarch->in_solib_call_trampoline = in_solib_call_trampoline;
}
+int
+gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ if (gdbarch->in_function_epilogue_p == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_in_function_epilogue_p invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
+ return gdbarch->in_function_epilogue_p (gdbarch, addr);
+}
+
+void
+set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
+ gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
+{
+ gdbarch->in_function_epilogue_p = in_function_epilogue_p;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */