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/tracepoint.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/tracepoint.c')
-rw-r--r-- | gdb/tracepoint.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 4b775d1..6075958 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2752,7 +2752,7 @@ get_traceframe_location (int *stepping_frame_p) /* If this is a stepping frame, we don't know which location triggered. The first is as good (or bad) a guess as any... */ *stepping_frame_p = 1; - return t->loc; + return &t->first_loc (); } /* Return the default collect actions of a tracepoint T. */ |