+2010-06-07 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Clear stale specific bp_location from former whole breakpoint.
+ * breakpoint.c (delete_breakpoint): Move the stale referencing clear
+ code ...
+ (free_bp_location): ... here. Rename there the called function to
+ bpstat_remove_bp_location_callback.
+ (bpstat_remove_breakpoint_callback): Rename to ...
+ (bpstat_remove_bp_location_callback): ... here, change DATA resolution
+ to struct bp_location. Change the called function to
+ bpstat_remove_bp_location. Create new declaration for the function.
+ (bpstat_remove_breakpoint): Rename to ...
+ (bpstat_remove_bp_location): ..., change the parameter to loc, adjust
+ code for the new parameter type.
+
2010-06-07 Nathan Sidwell <nathan@codesourcery.com>
* README: Make version-agnostic.
static void update_global_location_list_nothrow (int);
+static int bpstat_remove_bp_location_callback (struct thread_info *th,
+ void *data);
+
static int is_hardware_watchpoint (const struct breakpoint *bpt);
static int is_watchpoint (const struct breakpoint *bpt);
static void free_bp_location (struct bp_location *loc)
{
+ /* Be sure no bpstat's are pointing at it after it's been freed. */
+ /* FIXME, how can we find all bpstat's?
+ We just check stop_bpstat for now. Note that we cannot just
+ remove bpstats pointing at bpt from the stop_bpstat list
+ entirely, as breakpoint commands are associated with the bpstat;
+ if we remove it here, then the later call to
+ bpstat_do_actions (&stop_bpstat);
+ in event-top.c won't do anything, and temporary breakpoints
+ with commands won't work. */
+
+ iterate_over_threads (bpstat_remove_bp_location_callback, loc);
+
if (loc->cond)
xfree (loc->cond);
update_global_location_list (inserting);
}
-/* Clear BPT from a BPS. */
+/* Clear LOC from a BPS. */
static void
-bpstat_remove_breakpoint (bpstat bps, struct breakpoint *bpt)
+bpstat_remove_bp_location (bpstat bps, struct bp_location *loc)
{
bpstat bs;
for (bs = bps; bs; bs = bs->next)
- if (bs->breakpoint_at && bs->breakpoint_at->owner == bpt)
+ if (bs->breakpoint_at == loc)
{
bs->breakpoint_at = NULL;
bs->old_val = NULL;
/* Callback for iterate_over_threads. */
static int
-bpstat_remove_breakpoint_callback (struct thread_info *th, void *data)
+bpstat_remove_bp_location_callback (struct thread_info *th, void *data)
{
- struct breakpoint *bpt = data;
+ struct bp_location *loc = data;
- bpstat_remove_breakpoint (th->stop_bpstat, bpt);
+ bpstat_remove_bp_location (th->stop_bpstat, loc);
return 0;
}
xfree (bpt->exec_pathname);
clean_up_filters (&bpt->syscalls_to_be_caught);
- /* Be sure no bpstat's are pointing at it after it's been freed. */
- /* FIXME, how can we find all bpstat's?
- We just check stop_bpstat for now. Note that we cannot just
- remove bpstats pointing at bpt from the stop_bpstat list
- entirely, as breakpoint commands are associated with the bpstat;
- if we remove it here, then the later call to
- bpstat_do_actions (&stop_bpstat);
- in event-top.c won't do anything, and temporary breakpoints
- with commands won't work. */
-
- iterate_over_threads (bpstat_remove_breakpoint_callback, bpt);
-
/* Now that breakpoint is removed from breakpoint
list, update the global location list. This
will remove locations that used to belong to