binutils-gdb/gdbsupport
Simon Marchi 679a4e92b3 gdbsupport: make basic_safe_iterator::operator* return the same thing as underlying iterator
Using the following patch that removes the reference_to_pointer_iterator
from breakpoint_range, I would get:

      CXX    breakpoint.o
    /home/smarchi/src/binutils-gdb/gdb/breakpoint.c: In function ‘void breakpoint_program_space_exit(program_space*)’:
    /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:3030:46: error: cannot allocate an object of abstract type ‘breakpoint’
     3030 |   for (breakpoint &b : all_breakpoints_safe ())
          |                                              ^
    In file included from /home/smarchi/src/binutils-gdb/gdb/gdbthread.h:26,
                     from /home/smarchi/src/binutils-gdb/gdb/infrun.h:21,
                     from /home/smarchi/src/binutils-gdb/gdb/gdbarch.h:28,
                     from /home/smarchi/src/binutils-gdb/gdb/arch-utils.h:23,
                     from /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:21:
    /home/smarchi/src/binutils-gdb/gdb/breakpoint.h:619:8: note:   because the following virtual functions are pure within ‘breakpoint’:
      619 | struct breakpoint : public intrusive_list_node<breakpoint>
          |        ^~~~~~~~~~
    /home/smarchi/src/binutils-gdb/gdb/breakpoint.c:250:1: note:     ‘virtual breakpoint::~breakpoint()’
      250 | breakpoint::~breakpoint ()
          | ^~~~~~~~~~

This is because the operator* method of the basic_safe_iterator iterator
wrapper returns a value_type.  So, even if the method of the underlying
iterator (breakpoint_iterator, an intrusive_list iterator) returns a
`breakpoint &`, the method of the wrapper returns a `breakpoint`.

I think it would make sense for iterator wrappers such as
basic_safe_iterator to return the exact same thing as the iterator they
wrap.  At least, it fixes my problem.

Change-Id: Ibbcd390ac03d2fb6ae4854923750c8d7c3c04e8a
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-05-25 09:44:52 -04:00
..
.dir-locals.el Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
.gitattributes gdb, gdbserver, gdbsupport: add .gitattributes files 2020-03-05 15:59:22 +01:00
acinclude.m4 gdb: don't use -Wmissing-prototypes with g++ 2022-01-13 10:25:45 +00:00
aclocal.m4 gdb: use AC_PROG_CC_STDC instead of AM_PROG_CC_STDC 2020-10-31 08:30:57 -04:00
agent.cc Do not cast away const in agent_run_command 2023-02-14 09:01:18 -07:00
agent.h Do not cast away const in agent_run_command 2023-02-14 09:01:18 -07:00
alt-stack.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
array-view.h gdb: move displaced_step_dump_bytes into gdbsupport (and rename) 2023-03-29 08:57:10 +01:00
ax.def Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
block-signals.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
break-common.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
btrace-common.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
btrace-common.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
buildargv.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
byte-vector.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
ChangeLog-2020-2021 gdb: move remaining ChangeLogs to legacy files 2021-07-26 12:20:33 +01:00
check-defines.el Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cleanups.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cleanups.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
common-debug.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
common-debug.h gdbsupport: fix scoped_debug_start_end's move constructor 2023-01-05 15:18:11 -05:00
common-defs.h Set _WIN32_WINNT in common.m4 configure check 2023-01-11 11:00:42 -07:00
common-exceptions.cc Introduce gdb_exception_forced_quit 2023-02-27 16:20:38 -07:00
common-exceptions.h Introduce gdb_exception_forced_quit 2023-02-27 16:20:38 -07:00
common-gdbthread.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
common-inferior.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
common-inferior.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
common-regcache.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
common-regcache.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
common-types.h GDB: Switch to using C++ standard integer type limits 2023-02-10 23:49:19 +00:00
common-utils.cc gdb: Fix building with latest libc++ 2023-04-29 00:35:11 -07:00
common-utils.h gdb: move displaced_step_dump_bytes into gdbsupport (and rename) 2023-03-29 08:57:10 +01:00
common.m4 Set _WIN32_WINNT in common.m4 configure check 2023-01-11 11:00:42 -07:00
compiler-type.m4 Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
config.in gdbsupport: move libxxhash configure check to gdbsupport 2023-01-05 14:38:51 -05:00
configure Set _WIN32_WINNT in common.m4 configure check 2023-01-11 11:00:42 -07:00
configure.ac Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
create-version.sh Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
def-vector.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
default-init-alloc.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
eintr.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
enum-flags.h gdbsupport: ignore -Wenum-constexpr-conversion in enum-flags.h 2023-03-06 21:00:52 -05:00
environ.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
environ.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
errors.cc Move implementation of perror_with_name to gdbsupport 2023-02-10 21:04:45 -05:00
errors.h Move implementation of perror_with_name to gdbsupport 2023-02-10 21:04:45 -05:00
event-loop.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
event-loop.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
event-pipe.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
event-pipe.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
fileio.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
fileio.h gdb, gdbserver, gdbsupport: fix whitespace issues 2023-03-09 16:32:00 -05:00
filestuff.cc gdb, gdbserver, gdbsupport: fix whitespace issues 2023-03-09 16:32:00 -05:00
filestuff.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
filtered-iterator.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
format.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
format.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
forward-scope-exit.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
function-view.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_assert.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_binary_search.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_file.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_locale.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_obstack.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_obstack.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_optional.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_proc_service.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_ref_ptr.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_regex.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_regex.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_select.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_setjmp.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_signals.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_splay_tree.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_string_view.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_string_view.tcc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_sys_time.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_tilde_expand.cc gdb, gdbserver, gdbsupport: fix whitespace issues 2023-03-09 16:32:00 -05:00
gdb_tilde_expand.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_unique_ptr.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_unlinker.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_vecs.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_vecs.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_wait.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_wait.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb-checked-static-cast.h gdbsupport: add support for references to checked_static_cast 2023-05-24 14:53:53 -04:00
gdb-dlfcn.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb-dlfcn.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb-hashtab.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb-hashtab.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb-safe-ctype.h gdb: Fix building with latest libc++ 2023-04-29 00:35:11 -07:00
gdb-sigmask.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb-xfree.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hash_enum.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
host-defs.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
intrusive_list.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
invoke-result.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
iterator-range.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
job-control.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
job-control.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
Makefile.am Remove struct buffer 2023-02-24 11:53:03 -07:00
Makefile.in Remove struct buffer 2023-02-24 11:53:03 -07:00
netstuff.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
netstuff.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
new-op.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
next-iterator.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
observable.h gdb, gdbserver, gdbsupport: fix whitespace issues 2023-03-09 16:32:00 -05:00
offset-type.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
packed.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
parallel-for.h gdb, gdbserver, gdbsupport: fix whitespace issues 2023-03-09 16:32:00 -05:00
pathstuff.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
pathstuff.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
poison.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
preprocessor.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
print-utils.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
print-utils.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
ptid.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
ptid.h gdbsupport: add type definitions for pid, lwp and tid 2023-02-02 10:02:34 -05:00
ptrace.m4 Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
range-chain.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
README
refcounted-object.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
reference-to-pointer-iterator.h gdbsupport: add missing increment/decrement operators to reference_to_pointer_iterator 2023-05-25 08:47:12 -04:00
rsp-low.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
rsp-low.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
run-time-clock.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
run-time-clock.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
safe-iterator.h gdbsupport: make basic_safe_iterator::operator* return the same thing as underlying iterator 2023-05-25 09:44:52 -04:00
safe-strerror.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
scope-exit.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
scoped_fd.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
scoped_ignore_signal.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
scoped_ignore_sigttou.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
scoped_mmap.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
scoped_mmap.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
scoped_restore.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
search.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
search.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
selftest.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
selftest.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
selftest.m4 Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
signals-state-save-restore.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
signals-state-save-restore.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
signals.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
symbol.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
tdesc.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
tdesc.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
thread-pool.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
thread-pool.h Let user C-c when waiting for DWARF index finalization 2023-02-09 07:21:52 -07:00
traits.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
underlying.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
valid-expr.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
version.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
warning.m4 Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
x86-xstate.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
xml-utils.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
xml-utils.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00

This is a helper library that is used by gdb and gdbserver.

To send patches, follow the gdb patch submission instructions in
../gdb/CONTRIBUTE.  For maintainers, see ../gdb/MAINTAINERS.