aboutsummaryrefslogtreecommitdiff
path: root/gdb/record.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2012-04-24 14:33:12 +0000
committerYao Qi <yao@codesourcery.com>2012-04-24 14:33:12 +0000
commit20388dd6b670db6c2fada1c609d7ca4ae04c85a0 (patch)
treeb8c0df862294c1400dccb67ab2e6b07431d059af /gdb/record.c
parent4734f50e63de6deef4fe7976bbfaa398ac701deb (diff)
gdb:
Revert this patch to allow breakpoint always-inserted in record target. 2011-12-05 Pedro Alves <pedro@codesourcery.com> * breakpoint.c: Include record.h. (breakpoints_always_inserted_mode): Return false when the record target is in use. * breakpoint.c (iterate_over_bp_locations): New. * breakpoint.h: Declare. New typedef walk_bp_location_callback. * record.c (record_open): Call record_init_record_breakpoints. (record_sync_record_breakpoints): New. (record_init_record_breakpoints): New. * NEWS: Mention supporting breakpoint always-inserted mode in record target.
Diffstat (limited to 'gdb/record.c')
-rw-r--r--gdb/record.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/record.c b/gdb/record.c
index 9b7ee2f7f5..7db15277ed 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -896,6 +896,8 @@ record_open_1 (char *name, int from_tty)
push_target (&record_ops);
}
+static void record_init_record_breakpoints (void);
+
/* "to_open" target method. Open the process record target. */
static void
@@ -993,6 +995,8 @@ record_open (char *name, int from_tty)
record_async_inferior_event_token
= create_async_event_handler (record_async_inferior_event_handler,
NULL);
+
+ record_init_record_breakpoints ();
}
/* "to_close" target method. Close the process record target. */
@@ -1744,6 +1748,35 @@ DEF_VEC_P(record_breakpoint_p);
active. */
VEC(record_breakpoint_p) *record_breakpoints = NULL;
+static void
+record_sync_record_breakpoints (struct bp_location *loc, void *data)
+{
+ if (loc->loc_type != bp_loc_software_breakpoint)
+ return;
+
+ if (loc->inserted)
+ {
+ struct record_breakpoint *bp = XNEW (struct record_breakpoint);
+
+ bp->addr = loc->target_info.placed_address;
+ bp->address_space = loc->target_info.placed_address_space;
+
+ bp->in_target_beneath = 1;
+
+ VEC_safe_push (record_breakpoint_p, record_breakpoints, bp);
+ }
+}
+
+/* Sync existing breakpoints to record_breakpoints. */
+
+static void
+record_init_record_breakpoints (void)
+{
+ VEC_free (record_breakpoint_p, record_breakpoints);
+
+ iterate_over_bp_locations (record_sync_record_breakpoints);
+}
+
/* Behavior is conditional on RECORD_IS_REPLAY. We will not actually
insert or remove breakpoints in the real target when replaying, nor
when recording. */