From 6710bf39b7c037de481a4b351fb69cec6b48b138 Mon Sep 17 00:00:00 2001 From: Stan Shebs Date: Tue, 27 Sep 2011 13:09:37 +0000 Subject: Add return address collection for tracepoints. * tracepoint.c (encode_actions_1): Add case for $_ret. (validate_actionline): Check for $_ret. (trace_dump_actions): Ditto. * ax-gdb.h (gen_trace_for_return_address): Declare. * ax-gdb.c: Include arch-utils.h. (gen_trace_for_return_address): New function. (agent_command): Add return address special case. * amd64-tdep.c: Include ax.h and ax-gdb.h. (amd64_gen_return_address): New function. (amd64_init_abi): Call it. * i386-tdep.c: Include ax.h and ax-gdb.h. (i386_gen_return_address): New function. (i386_init_abi): Call it. * arch-utils.h (default_gen_return_address): Declare. * arch-utils.c (default_gen_return_address): New function. * gdbarch.sh (gen_return_address): New method. * gdbarch.h, gdbarch.c: Regenerate. * gdb.texinfo (Tracepoint Action Lists): Document $_ret. * gdb.trace/collection.exp: Test collection of $_ret. --- gdb/gdbarch.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gdb/gdbarch.h') diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 7619581..0117322 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -54,6 +54,7 @@ struct displaced_step_closure; struct core_regset_section; struct syscall; struct agent_expr; +struct axs_value; /* The architecture associated with the connection to the target. @@ -1014,6 +1015,16 @@ extern void set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch, const extern int gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch); extern void set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch, int has_dos_based_file_system); +/* Generate bytecodes to collect the return address in a frame. + Since the bytecodes run on the target, possibly with GDB not even + connected, the full unwinding machinery is not available, and + typically this function will issue bytecodes for one or more likely + places that the return address may be found. */ + +typedef void (gdbarch_gen_return_address_ftype) (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope); +extern void gdbarch_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope); +extern void set_gdbarch_gen_return_address (struct gdbarch *gdbarch, gdbarch_gen_return_address_ftype *gen_return_address); + /* Definition for an unknown syscall, used basically in error-cases. */ #define UNKNOWN_SYSCALL (-1) -- cgit v1.1