]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/inferior.c
Fix leaks by clearing registers and frame caches.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 30 Apr 2019 20:18:48 +0000 (22:18 +0200)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 4 May 2019 05:22:01 +0000 (07:22 +0200)
commit66452beb773568c7f60dbc6b7c70f671a8c9cf4b
tree9607e4db13f6abac22064fa6f0ee8b585940f661
parentbde09ab7026edf3d79122872b79c6a8f164ee0ff
Fix leaks by clearing registers and frame caches.

Valgrind reports leaks such as the below in the tests:
gdb.threads/corethreads.exp
gdb.threads/gcore-thread.exp
gdb.ada/task_switch_in_core.exp
gdb.trace/tfile.exp
gdb.base/siginfo-thread.exp

==12701== 1,123 (72 direct, 1,051 indirect) bytes in 1 blocks are definitely lost in loss record 2,928 of 3,247
==12701==    at 0x4C2C4CC: operator new(unsigned long) (vg_replace_malloc.c:344)
==12701==    by 0x5CF771: get_thread_arch_aspace_regcache(ptid_t, gdbarch*, address_space*) (regcache.c:330)
==12701==    by 0x5CF92A: get_thread_regcache (regcache.c:366)
==12701==    by 0x5CF92A: get_current_regcache() (regcache.c:372)
==12701==    by 0x4C7964: get_current_frame() (frame.c:1587)
==12701==    by 0x4C7A3C: get_selected_frame(char const*) (frame.c:1651)
==12701==    by 0x669EAD: print_thread_info_1(ui_out*, char const*, int, int, int) (thread.c:1151)
==12701==    by 0x66A9A1: info_threads_command(char const*, int) (thread.c:1217)
==12701==    by 0x40A878: cmd_func(cmd_list_element*, char const*, int) (cli-decode.c:1892)
...

Fix these leaks by clearing registers and frame caches.
This leak and fix is similar to the leak fixed by 799efbe8e01
gdb/ChangeLog
gdb/corelow.c
gdb/inferior.c