aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2025-03-05 00:06:43 -0500
committerSimon Marchi <simon.marchi@efficios.com>2025-03-05 11:58:31 -0500
commit93258b5fa6eb08b2d06cc3b1ffd93e5ce30eed7c (patch)
treebb614c5ad29c081805552fdb68f6eeba79458549 /gdb/ada-lang.c
parent76ee822b86e86a548d00849202c10fdc0b397ac1 (diff)
downloadbinutils-93258b5fa6eb08b2d06cc3b1ffd93e5ce30eed7c.zip
binutils-93258b5fa6eb08b2d06cc3b1ffd93e5ce30eed7c.tar.gz
binutils-93258b5fa6eb08b2d06cc3b1ffd93e5ce30eed7c.tar.bz2
gdb/dwarf: store dwo_file_up in dwo_file_set
Heap-allocated dwo_file objects, stored in dwarf2_per_bfd::dwo_files, are never freed. They are created in one of the create_dwo_unit_in_dwp_* or lookup_dwo_cutu functions. I confirmed this by running: $ make check TESTS="gdb.cp/anon-ns.exp" RUNTESTFLAGS="--target_board=fission-dwp" $ ./gdb -q -nx --data-directory=data-directory testsuite/outputs/gdb.cp/anon-ns/anon-ns -ex "p main" -ex "file" -batch ... and checking the ASan leak report. I also debugged this invocation of GDB, placed a breakpoint on ~dwo_file, and didn't see any hit. Change the dwo_file set to hold dwo_file_up objects. When the dwarf2_per_bfd object gets destroyed, dwo_file objects will automatically get destroyed. With this change, I see the related leaks disappear in the ASan leak report, and my ~dwo_file breakpoint gets hit when debugging GDB. Change-Id: Icb38539c3f9e553f3625c625a00fc63dd6e9f3c5 Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/ada-lang.c')
0 files changed, 0 insertions, 0 deletions