aboutsummaryrefslogtreecommitdiff
path: root/gdb/record.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-03-04 20:41:15 +0000
committerPedro Alves <palves@redhat.com>2015-03-04 20:41:15 +0000
commit9e8915c6cee5c37637521b424d723e990e06d597 (patch)
tree42ec607db6c86af4d136c70e2c588b5cd87bfbbd /gdb/record.h
parent15c66dd626380fbd7db6538b0c21d1fe86dda6c9 (diff)
downloadfsf-binutils-gdb-9e8915c6cee5c37637521b424d723e990e06d597.zip
fsf-binutils-gdb-9e8915c6cee5c37637521b424d723e990e06d597.tar.gz
fsf-binutils-gdb-9e8915c6cee5c37637521b424d723e990e06d597.tar.bz2
record-full/record-btrace: software/hardware breakpoint trap
This adjusts the record targets to tell the core whether a trap was caused by a breakpoint. Targets that can do this should report breakpoint traps with the PC already adjusted, so this removes the re-incrementing record-full was doing. These targets need to be adjusted before process_stratum targets beneath are, otherwise target_supports_stopped_by_sw_breakpoint, etc. would fall through to the target beneath while recording/replaying, and the core would get confused. Tested on x86-64 Fedora 20, native and gdbserver. gdb/ChangeLog: 2015-03-04 Pedro Alves <palves@redhat.com> * btrace.h: Include target/waitstatus.h. (struct btrace_thread_info) <stop_reason>: New field. * record-btrace.c (record_btrace_step_thread): Use record_check_stopped_by_breakpoint instead of breakpoint_here_p. (record_btrace_decr_pc_after_break): Delete. (record_btrace_stopped_by_sw_breakpoint) (record_btrace_supports_stopped_by_sw_breakpoint) (record_btrace_stopped_by_hw_breakpoint) (record_btrace_supports_stopped_by_hw_breakpoint): New functions. (init_record_btrace_ops): Install them. * record-full.c (record_full_hw_watchpoint): Delete and replace with ... (record_full_stop_reason): ... this throughout. (record_full_exec_insn): Adjust. (record_full_wait_1): Adjust. No longer re-increment the PC. (record_full_wait_1): Adjust. Use record_check_stopped_by_breakpoint instead of breakpoint_here_p. (record_full_stopped_by_watchpoint): Adjust. (record_full_stopped_by_sw_breakpoint) (record_full_supports_stopped_by_sw_breakpoint) (record_full_supports_stopped_by_sw_breakpoint) (record_full_stopped_by_hw_breakpoint) (record_full_supports_stopped_by_hw_breakpoint): New functions. (init_record_full_ops, init_record_full_core_ops): Install them. * record.c (record_check_stopped_by_breakpoint): New function. * record.h: Include target/waitstatus.h. (record_check_stopped_by_breakpoint): New declaration.
Diffstat (limited to 'gdb/record.h')
-rw-r--r--gdb/record.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/record.h b/gdb/record.h
index 771b14d..101daae 100644
--- a/gdb/record.h
+++ b/gdb/record.h
@@ -20,6 +20,8 @@
#ifndef _RECORD_H_
#define _RECORD_H_
+#include "target/waitstatus.h" /* For enum target_stop_reason. */
+
struct cmd_list_element;
extern unsigned int record_debug;
@@ -47,6 +49,17 @@ enum record_print_flag
RECORD_PRINT_INDENT_CALLS = (1 << 2)
};
+/* Determined whether the target is stopped at a software or hardware
+ breakpoint, based on PC and the breakpoint tables. The breakpoint
+ type is translated to the appropriate target_stop_reason and
+ written to REASON. Returns true if stopped at a breakpoint, false
+ otherwise. */
+
+extern int
+ record_check_stopped_by_breakpoint (struct address_space *aspace,
+ CORE_ADDR pc,
+ enum target_stop_reason *reason);
+
/* Wrapper for target_read_memory that prints a debug message if
reading memory fails. */
extern int record_read_memory (struct gdbarch *gdbarch,