diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-05-09 10:28:09 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-05-25 08:47:00 -0400 |
commit | f5951b9ff8a018c9234656e9b26b372c6b3d238b (patch) | |
tree | 4427bb72ea2170d31468656e6d0bd53306c46ca7 /gdb/infrun.c | |
parent | 9dc1523b573cc065d6124e3127009c1d7cb8317b (diff) | |
download | fsf-binutils-gdb-f5951b9ff8a018c9234656e9b26b372c6b3d238b.zip fsf-binutils-gdb-f5951b9ff8a018c9234656e9b26b372c6b3d238b.tar.gz fsf-binutils-gdb-f5951b9ff8a018c9234656e9b26b372c6b3d238b.tar.bz2 |
gdb: add breakpoint::first_loc methods
Add convenience first_loc methods to struct breakpoint (const and
non-const overloads). A subsequent patch changes the list of locations
to be an intrusive_list and makes the actual list private, so these
spots would need to change from:
b->loc
to something ugly like:
*b->locations ().begin ()
That would make the code much heavier and not readable. There is a
surprisingly big number of places that access the first location of
breakpoints. Whether this is correct, or these spots fail to consider
the possibility of multi-location breakpoints, I don't know. But
anyhow, I think that using this instead:
b->first_loc ()
conveys the intention better than the other two forms.
Change-Id: Ibbefe3e4ca6cdfe570351fe7e2725f2ce11d1e95
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index efe2c00..a9e2a24 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -950,14 +950,14 @@ follow_inferior_reset_breakpoints (void) if (tp->control.step_resume_breakpoint) { breakpoint_re_set_thread (tp->control.step_resume_breakpoint); - tp->control.step_resume_breakpoint->loc->enabled = 1; + tp->control.step_resume_breakpoint->first_loc ().enabled = 1; } /* Treat exception_resume breakpoints like step_resume breakpoints. */ if (tp->control.exception_resume_breakpoint) { breakpoint_re_set_thread (tp->control.exception_resume_breakpoint); - tp->control.exception_resume_breakpoint->loc->enabled = 1; + tp->control.exception_resume_breakpoint->first_loc ().enabled = 1; } /* Reinsert all breakpoints in the child. The user may have set @@ -2551,7 +2551,8 @@ resume_1 (enum gdb_signal sig) user breakpoints at PC to trigger (again) when this hits. */ insert_hp_step_resume_breakpoint_at_frame (get_current_frame ()); - gdb_assert (tp->control.step_resume_breakpoint->loc->permanent); + gdb_assert (tp->control.step_resume_breakpoint->first_loc () + .permanent); tp->step_after_step_resume_breakpoint = step; } @@ -7008,9 +7009,9 @@ process_event_stop_test (struct execution_control_state *ecs) = ecs->event_thread->control.step_resume_breakpoint; if (sr_bp != nullptr - && sr_bp->loc->permanent + && sr_bp->first_loc ().permanent && sr_bp->type == bp_hp_step_resume - && sr_bp->loc->address == ecs->event_thread->prev_pc) + && sr_bp->first_loc ().address == ecs->event_thread->prev_pc) { infrun_debug_printf ("stepped permanent breakpoint, stopped in handler"); delete_step_resume_breakpoint (ecs->event_thread); |