aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracectf.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/tracectf.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/tracectf.c')
-rw-r--r--gdb/tracectf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/tracectf.c b/gdb/tracectf.c
index d8d0f05..ab513b1 100644
--- a/gdb/tracectf.c
+++ b/gdb/tracectf.c
@@ -1535,7 +1535,7 @@ ctf_get_traceframe_address (void)
struct tracepoint *tp
= get_tracepoint_by_number_on_target (tpnum);
- if (tp && tp->loc)
+ if (tp != nullptr && tp->has_locations ())
addr = tp->loc->address;
}