aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-05-09 10:23:44 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-05-25 08:46:23 -0400
commit9dc1523b573cc065d6124e3127009c1d7cb8317b (patch)
tree93c5b1823d9158cdfd80e06baa3e605e9d4457f6 /gdb/tracepoint.c
parent5e632eca05f38ea7229f103e0636e02c6dfcd9fa (diff)
downloadbinutils-9dc1523b573cc065d6124e3127009c1d7cb8317b.zip
binutils-9dc1523b573cc065d6124e3127009c1d7cb8317b.tar.gz
binutils-9dc1523b573cc065d6124e3127009c1d7cb8317b.tar.bz2
gdb: add breakpoint "has locations" methods
Add three convenience methods to struct breakpoint: - has_locations: returns true if the breakpoint has at least one location - has_single_location: returns true if the breakpoint has exactly one location - has_multiple_locations: returns true if the breakpoint has more than one location A subsequent patch changes the list of breakpoints to be an intrusive_list, so all these spots would need to change. But in any case, I think that this: if (b->has_multiple_locations ()) conveys the intention better than: if (b->loc != nullptr && b->loc->next != nullptr) Change-Id: Ib18c3605fd35d425ef9df82cb7aacff1606c6747 Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 9e5ced1..4b775d1 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1524,7 +1524,7 @@ process_tracepoint_on_disconnect (void)
user that pending tracepoint will no longer work. */
for (breakpoint *b : all_tracepoints ())
{
- if (b->loc == NULL)
+ if (!b->has_locations ())
{
has_pending_p = 1;
break;