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/elfread.c | |
parent | 9dc1523b573cc065d6124e3127009c1d7cb8317b (diff) | |
download | binutils-f5951b9ff8a018c9234656e9b26b372c6b3d238b.zip binutils-f5951b9ff8a018c9234656e9b26b372c6b3d238b.tar.gz binutils-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/elfread.c')
-rw-r--r-- | gdb/elfread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c index 83b20a3..799e3b9 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -977,7 +977,7 @@ elf_gnu_ifunc_resolver_stop (code_breakpoint *b) gdb_assert (frame_id_p (b_return->frame_id)); if (b_return->thread == thread_id - && b_return->loc->requested_address == prev_pc + && b_return->first_loc ().requested_address == prev_pc && b_return->frame_id == prev_frame_id) break; } @@ -1046,7 +1046,7 @@ elf_gnu_ifunc_resolver_return_stop (code_breakpoint *b) func_func = value::allocate (func_func_type); func_func->set_lval (lval_memory); - func_func->set_address (b->loc->related_address); + func_func->set_address (b->first_loc ().related_address); value = value::allocate (value_type); gdbarch_return_value_as_value (gdbarch, func_func, value_type, regcache, |