From f5951b9ff8a018c9234656e9b26b372c6b3d238b Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 9 May 2023 10:28:09 -0400 Subject: 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 --- gdb/tracectf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/tracectf.c') diff --git a/gdb/tracectf.c b/gdb/tracectf.c index ab513b1..1646171 100644 --- a/gdb/tracectf.c +++ b/gdb/tracectf.c @@ -1536,7 +1536,7 @@ ctf_get_traceframe_address (void) = get_tracepoint_by_number_on_target (tpnum); if (tp != nullptr && tp->has_locations ()) - addr = tp->loc->address; + addr = tp->first_loc ().address; } /* Restore the position. */ -- cgit v1.1