]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/objfiles: make objfile::sections yield references
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 27 Aug 2025 14:38:13 +0000 (10:38 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 29 Aug 2025 15:47:16 +0000 (11:47 -0400)
commitb340cd71e610c9f1caa5a20137c5cd279f6683a2
treeadfc80452457223470d0919649d45a6d56ad024b
parent0c2b3861935465b5e8b55765a442424a6d67643c
gdb/objfiles: make objfile::sections yield references

I wrote this as a preparatory patch while attempting to make
objfile::section_iterator use filtered_iterator.  It turned out not so
easy, so I have put it aside for now.  But now I have this patch, so I
thought I'd send it by itself.

Since the `obj_section *` yielded by the iterator can't be nullptr, I
think it makes sense for the iterator to yield references instead.
Just like you would get if you iterated on an std::vector<obj_section>.

Change-Id: I7bbee50ed52599e64c4f3b06bdbbde597feba9aa
21 files changed:
gdb/arm-tdep.c
gdb/exec.c
gdb/gcore.c
gdb/hppa-bsd-tdep.c
gdb/hppa-linux-tdep.c
gdb/hppa-tdep.c
gdb/ia64-tdep.c
gdb/machoread.c
gdb/maint.c
gdb/minsyms.c
gdb/objfiles.c
gdb/objfiles.h
gdb/printcmd.c
gdb/solib-aix.c
gdb/solib-dsbt.c
gdb/solib-frv.c
gdb/solib-svr4.c
gdb/symfile.c
gdb/symtab.c
gdb/xstormy16-tdep.c
gdb/z80-tdep.c