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/tui | |
parent | 9dc1523b573cc065d6124e3127009c1d7cb8317b (diff) | |
download | gdb-f5951b9ff8a018c9234656e9b26b372c6b3d238b.zip gdb-f5951b9ff8a018c9234656e9b26b372c6b3d238b.tar.gz 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/tui')
-rw-r--r-- | gdb/tui/tui-winsource.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 3c4ce50..3fc38b7 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -640,7 +640,7 @@ tui_source_window_base::update_breakpoint_info mode |= TUI_BP_ENABLED; if (bp->hit_count) mode |= TUI_BP_HIT; - if (bp->loc->cond) + if (bp->first_loc ().cond) mode |= TUI_BP_CONDITIONAL; if (bp->type == bp_hardware_breakpoint) mode |= TUI_BP_HARDWARE; |