aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.h
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <koriakin@0x04.net>2016-02-18 09:21:38 +0100
committerMarcin Koƛcielnicki <koriakin@0x04.net>2016-02-18 17:21:22 +0100
commit5f034a78b986d30a90030b2409c61a8660b9b48c (patch)
tree312e005927c2673b81ad675d0e46e8b6ac5a5cd2 /gdb/gdbarch.h
parentc304e18e5ca825f57963bd0c5f022fa8f5797b29 (diff)
downloadgdb-5f034a78b986d30a90030b2409c61a8660b9b48c.zip
gdb-5f034a78b986d30a90030b2409c61a8660b9b48c.tar.gz
gdb-5f034a78b986d30a90030b2409c61a8660b9b48c.tar.bz2
gdb: Add guess_tracepoint_registers hook to gdbarch.
When we're looking at a tracefile trace frame where registers are not available, and the tracepoint has only one location, we supply the location's address as the PC register. However, this only works if PC is not a pseudo register, and individual architectures may want to guess more registers. Add a gdbarch hook that will handle that. gdb/ChangeLog: * arch-utils.c (default_guess_tracepoint_registers): New function. * arch-utils.h (default_guess_tracepoint_registers): New prototype. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh: Add guess_tracepoint_registers hook. * tracefile.c (tracefile_fetch_registers): Use the new gdbarch hook.
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r--gdb/gdbarch.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 3fadcd1..7ffbf1f 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1327,6 +1327,15 @@ typedef int (gdbarch_fast_tracepoint_valid_at_ftype) (struct gdbarch *gdbarch, C
extern int gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, char **msg);
extern void set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at);
+/* Guess register state based on tracepoint location. Used for tracepoints
+ where no registers have been collected, but there's only one location,
+ allowing us to guess the PC value, and perhaps some other registers.
+ On entry, regcache has all registers marked as unavailable. */
+
+typedef void (gdbarch_guess_tracepoint_registers_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
+extern void gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
+extern void set_gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, gdbarch_guess_tracepoint_registers_ftype *guess_tracepoint_registers);
+
/* Return the "auto" target charset. */
typedef const char * (gdbarch_auto_charset_ftype) (void);