]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb, gdbserver: propagate use of target_desc unique pointers
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 17 Nov 2025 21:48:25 +0000 (16:48 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Mon, 1 Dec 2025 21:25:11 +0000 (16:25 -0500)
commit1a5362ce51ef79ffb61caa20c93284dc368dc74a
treec90af417b1b0312a2d8dd899441b12f199263999
parentd9be86b031bab8cc8f00d1c60b0e37249b61bc89
gdb, gdbserver: propagate use of target_desc unique pointers

Propagate the use of target_desc unique pointers further.  Basically,
avoid releasing target_desc objects, except in some spots in gdbserver
(e.g. netbsd) where we don't currently have a persistent container for
created target descriptions (and the target desc just leaks).  Introduce
const_target_desc_up to change some `const target_desc *` to a unique
pointer without loss of constness.

Architectures that use the old regformats/regdat.sh don't need to be
changed, because their target_desc objects are statically allocated in
the generated files.

I was able to built-test these native configs:

 - Linux AArch64
 - Linux ARC
 - Linux AMD64
 - Linux ARM
 - Linux LoongArch
 - Linux M68K
 - Linux Microblaze
 - Linux MIPS (32 and 64)
 - Linux or1k
 - Linux PPC (32 and 64)
 - Linux RISC-V
 - Linux s390x
 - Linux SH4
 - Linux Sparc (32 and 64)
 - Linux Xtensa
 - FreeBSD AMD64
 - NetBSD AMD64
 - Windows i686
 - Windows AMD64

For the rest, I did my best by staring at the code long enough.  I
probably missed or messed some spots, but that shouldn't be difficult to
fix.

Change-Id: I8db8790c57942edd2bfe890987157e2dc0c67879
Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
126 files changed:
gdb/aarch32-tdep.c
gdb/aarch64-tdep.c
gdb/alpha-tdep.c
gdb/amd64-tdep.c
gdb/arch/aarch32.c
gdb/arch/aarch32.h
gdb/arch/aarch64.c
gdb/arch/aarch64.h
gdb/arch/amd64-linux-tdesc.c
gdb/arch/amd64.c
gdb/arch/amd64.h
gdb/arch/arm.c
gdb/arch/arm.h
gdb/arch/i386-linux-tdesc.c
gdb/arch/i386.c
gdb/arch/i386.h
gdb/arch/loongarch.c
gdb/arch/ppc-linux-common.c
gdb/arch/ppc-linux-tdesc.h
gdb/arch/tic6x.c
gdb/arch/tic6x.h
gdb/arm-tdep.c
gdb/features/alpha.c
gdb/features/microblaze-linux.c
gdb/features/microblaze-with-stack-protect.c
gdb/features/microblaze.c
gdb/features/mips-dsp-linux.c
gdb/features/mips-linux.c
gdb/features/mips64-dsp-linux.c
gdb/features/mips64-linux.c
gdb/features/nds32.c
gdb/features/or1k-linux.c
gdb/features/or1k.c
gdb/features/rs6000/powerpc-32.c
gdb/features/rs6000/powerpc-32l.c
gdb/features/rs6000/powerpc-403.c
gdb/features/rs6000/powerpc-403gc.c
gdb/features/rs6000/powerpc-405.c
gdb/features/rs6000/powerpc-505.c
gdb/features/rs6000/powerpc-601.c
gdb/features/rs6000/powerpc-602.c
gdb/features/rs6000/powerpc-603.c
gdb/features/rs6000/powerpc-604.c
gdb/features/rs6000/powerpc-64.c
gdb/features/rs6000/powerpc-64l.c
gdb/features/rs6000/powerpc-7400.c
gdb/features/rs6000/powerpc-750.c
gdb/features/rs6000/powerpc-860.c
gdb/features/rs6000/powerpc-altivec32.c
gdb/features/rs6000/powerpc-altivec32l.c
gdb/features/rs6000/powerpc-altivec64.c
gdb/features/rs6000/powerpc-altivec64l.c
gdb/features/rs6000/powerpc-e500.c
gdb/features/rs6000/powerpc-e500l.c
gdb/features/rs6000/powerpc-isa205-32l.c
gdb/features/rs6000/powerpc-isa205-64l.c
gdb/features/rs6000/powerpc-isa205-altivec32l.c
gdb/features/rs6000/powerpc-isa205-altivec64l.c
gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.c
gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.c
gdb/features/rs6000/powerpc-isa205-vsx32l.c
gdb/features/rs6000/powerpc-isa205-vsx64l.c
gdb/features/rs6000/powerpc-isa207-htm-vsx32l.c
gdb/features/rs6000/powerpc-isa207-htm-vsx64l.c
gdb/features/rs6000/powerpc-isa207-vsx32l.c
gdb/features/rs6000/powerpc-isa207-vsx64l.c
gdb/features/rs6000/powerpc-vsx32.c
gdb/features/rs6000/powerpc-vsx32l.c
gdb/features/rs6000/powerpc-vsx64.c
gdb/features/rs6000/powerpc-vsx64l.c
gdb/features/rs6000/rs6000.c
gdb/features/rx.c
gdb/features/s390-gs-linux64.c
gdb/features/s390-linux32.c
gdb/features/s390-linux32v1.c
gdb/features/s390-linux32v2.c
gdb/features/s390-linux64.c
gdb/features/s390-linux64v1.c
gdb/features/s390-linux64v2.c
gdb/features/s390-te-linux64.c
gdb/features/s390-tevx-linux64.c
gdb/features/s390-vx-linux64.c
gdb/features/s390x-gs-linux64.c
gdb/features/s390x-linux64.c
gdb/features/s390x-linux64v1.c
gdb/features/s390x-linux64v2.c
gdb/features/s390x-te-linux64.c
gdb/features/s390x-tevx-linux64.c
gdb/features/s390x-vx-linux64.c
gdb/features/sparc/sparc32-solaris.c
gdb/features/sparc/sparc64-solaris.c
gdb/features/z80.c
gdb/i386-tdep.c
gdb/microblaze-tdep.c
gdb/mips-linux-nat.c
gdb/mips-linux-tdep.h
gdb/nds32-tdep.c
gdb/or1k-tdep.c
gdb/ppc-linux-nat.c
gdb/ppc-tdep.h
gdb/rs6000-aix-nat.c
gdb/rs6000-aix-tdep.c
gdb/rs6000-tdep.c
gdb/rx-tdep.c
gdb/s390-linux-nat.c
gdb/s390-linux-tdep.c
gdb/s390-linux-tdep.h
gdb/s390-tdep.c
gdb/s390-tdep.h
gdb/target-descriptions.c
gdb/z80-tdep.c
gdbserver/linux-aarch32-tdesc.cc
gdbserver/linux-aarch64-tdesc.cc
gdbserver/linux-arc-low.cc
gdbserver/linux-arm-tdesc.cc
gdbserver/linux-ppc-ipa.cc
gdbserver/linux-ppc-low.cc
gdbserver/linux-tic6x-low.cc
gdbserver/netbsd-aarch64-low.cc
gdbserver/netbsd-amd64-low.cc
gdbserver/netbsd-i386-low.cc
gdbserver/tdesc.cc
gdbserver/win32-i386-low.cc
gdbserver/win32-low.cc
gdbserver/win32-low.h
gdbsupport/tdesc.h