[00/12] Use intrusive_list for breakpoints and breakpoint locations

Message ID 20230511144832.17974-1-simon.marchi@efficios.com
Headers
Series Use intrusive_list for breakpoints and breakpoint locations |

Message

Simon Marchi May 11, 2023, 2:48 p.m. UTC
  This series changes two linked lists to use intrusive_list.  There are
some cleanups before that, and some small fixes that needed to be made
to some of our iterator wrappers.

Simon Marchi (12):
  gdb: get gdbarch from syscall_catchpoint instead of location
  gdb: make some breakpoint methods use `this`
  gdb: constify breakpoint::print_it parameter
  gdb: add breakpoint "has locations" methods
  gdb: add breakpoint::first_loc methods
  gdbsupport: add missing increment/decrement operators to
    reference_to_pointer_iterator
  gdb: link breakpoint locations with intrusive_list
  gdb: remove bp_location_pointer_iterator
  gdb: link breakpoints with intrusive_list
  gdbsupport: make basic_safe_iterator::operator* return the same thing
    as underlying iterator
  gdbsupport: make filtered_iterator::operator* return the same thing as
    underlying iterator
  gdb: remove breakpoint_pointer_iterator

 gdb/ada-lang.c                             |   20 +-
 gdb/break-catch-exec.c                     |    4 +-
 gdb/break-catch-fork.c                     |    4 +-
 gdb/break-catch-load.c                     |   25 +-
 gdb/break-catch-sig.c                      |    4 +-
 gdb/break-catch-syscall.c                  |   21 +-
 gdb/break-catch-throw.c                    |   10 +-
 gdb/breakpoint.c                           | 1225 ++++++++++----------
 gdb/breakpoint.h                           |  104 +-
 gdb/dummy-frame.c                          |    4 +-
 gdb/elfread.c                              |    8 +-
 gdb/guile/scm-breakpoint.c                 |    4 +-
 gdb/infrun.c                               |   11 +-
 gdb/jit.c                                  |    6 +-
 gdb/python/py-breakpoint.c                 |    8 +-
 gdb/python/py-finishbreakpoint.c           |    8 +-
 gdb/remote.c                               |    4 +-
 gdb/solib-svr4.c                           |   10 +-
 gdb/tracectf.c                             |    4 +-
 gdb/tracefile-tfile.c                      |    4 +-
 gdb/tracefile.c                            |    6 +-
 gdb/tracepoint.c                           |  108 +-
 gdb/tui/tui-winsource.c                    |   16 +-
 gdbsupport/filtered-iterator.h             |    7 +-
 gdbsupport/reference-to-pointer-iterator.h |   18 +
 gdbsupport/safe-iterator.h                 |    6 +-
 26 files changed, 848 insertions(+), 801 deletions(-)
  

Comments

Andrew Burgess May 18, 2023, 3:54 p.m. UTC | #1
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

> This series changes two linked lists to use intrusive_list.  There are
> some cleanups before that, and some small fixes that needed to be made
> to some of our iterator wrappers.

I took a look through and left a few comments, but otherwise, this looks
great.

I also ran the testsuite locally, and saw no regressions.

Reviewed-By: Andrew Burgess <aburgess@redhat.com>

Thanks,
Andrew

>
> Simon Marchi (12):
>   gdb: get gdbarch from syscall_catchpoint instead of location
>   gdb: make some breakpoint methods use `this`
>   gdb: constify breakpoint::print_it parameter
>   gdb: add breakpoint "has locations" methods
>   gdb: add breakpoint::first_loc methods
>   gdbsupport: add missing increment/decrement operators to
>     reference_to_pointer_iterator
>   gdb: link breakpoint locations with intrusive_list
>   gdb: remove bp_location_pointer_iterator
>   gdb: link breakpoints with intrusive_list
>   gdbsupport: make basic_safe_iterator::operator* return the same thing
>     as underlying iterator
>   gdbsupport: make filtered_iterator::operator* return the same thing as
>     underlying iterator
>   gdb: remove breakpoint_pointer_iterator
>
>  gdb/ada-lang.c                             |   20 +-
>  gdb/break-catch-exec.c                     |    4 +-
>  gdb/break-catch-fork.c                     |    4 +-
>  gdb/break-catch-load.c                     |   25 +-
>  gdb/break-catch-sig.c                      |    4 +-
>  gdb/break-catch-syscall.c                  |   21 +-
>  gdb/break-catch-throw.c                    |   10 +-
>  gdb/breakpoint.c                           | 1225 ++++++++++----------
>  gdb/breakpoint.h                           |  104 +-
>  gdb/dummy-frame.c                          |    4 +-
>  gdb/elfread.c                              |    8 +-
>  gdb/guile/scm-breakpoint.c                 |    4 +-
>  gdb/infrun.c                               |   11 +-
>  gdb/jit.c                                  |    6 +-
>  gdb/python/py-breakpoint.c                 |    8 +-
>  gdb/python/py-finishbreakpoint.c           |    8 +-
>  gdb/remote.c                               |    4 +-
>  gdb/solib-svr4.c                           |   10 +-
>  gdb/tracectf.c                             |    4 +-
>  gdb/tracefile-tfile.c                      |    4 +-
>  gdb/tracefile.c                            |    6 +-
>  gdb/tracepoint.c                           |  108 +-
>  gdb/tui/tui-winsource.c                    |   16 +-
>  gdbsupport/filtered-iterator.h             |    7 +-
>  gdbsupport/reference-to-pointer-iterator.h |   18 +
>  gdbsupport/safe-iterator.h                 |    6 +-
>  26 files changed, 848 insertions(+), 801 deletions(-)
>
> -- 
> 2.40.1
  
Simon Marchi May 18, 2023, 9:01 p.m. UTC | #2
On 5/18/23 11:54, Andrew Burgess via Gdb-patches wrote:
> Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
>> This series changes two linked lists to use intrusive_list.  There are
>> some cleanups before that, and some small fixes that needed to be made
>> to some of our iterator wrappers.
> 
> I took a look through and left a few comments, but otherwise, this looks
> great.
> 
> I also ran the testsuite locally, and saw no regressions.
> 
> Reviewed-By: Andrew Burgess <aburgess@redhat.com>

Thanks for reviewing.  Since the adjustments were mostly trivial, I will
push the modified version of this series once the checked_static_cast
for references patches (or an equivalent) is in.

Simon
  
Simon Marchi May 25, 2023, 2:01 p.m. UTC | #3
On 5/18/23 17:01, Simon Marchi via Gdb-patches wrote:
> On 5/18/23 11:54, Andrew Burgess via Gdb-patches wrote:
>> Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>>
>>> This series changes two linked lists to use intrusive_list.  There are
>>> some cleanups before that, and some small fixes that needed to be made
>>> to some of our iterator wrappers.
>>
>> I took a look through and left a few comments, but otherwise, this looks
>> great.
>>
>> I also ran the testsuite locally, and saw no regressions.
>>
>> Reviewed-By: Andrew Burgess <aburgess@redhat.com>
> 
> Thanks for reviewing.  Since the adjustments were mostly trivial, I will
> push the modified version of this series once the checked_static_cast
> for references patches (or an equivalent) is in.

I pushed this.

Simon