Call disassemble_free_target in gdb
authorTom Tromey <tom@tromey.com>
Sat, 11 Jan 2020 18:40:45 +0000 (11:40 -0700)
committerTom Tromey <tom@tromey.com>
Sun, 19 Jan 2020 20:24:32 +0000 (13:24 -0700)
commit4d89c1c79fa53ff2c4e9574148b59d83c21db6d2
tree94022b7b116870b53b48e77ad9ab82d0e49cbd2d
parentc0ab21c22bb28a2e1a42195d3fe9b9de9e7fd66b
Call disassemble_free_target in gdb

Commit 20135676fc4c3912297c313b3e0d3cbd6cc402e3 ("PR24960, Memory leak
from disassembler") added "disassemble_free_target" to opcodes.  This
is used to free target-specific data when finished with a
disassembler.

This patch changes gdb to call this function where needed.

gdb/ChangeLog
2020-01-19  Tom Tromey  <tom@tromey.com>

* disasm.c (~gdb_disassembler): New destructor.
(gdb_buffered_insn_length): Call disassemble_free_target.
* disasm.h (class gdb_disassembler): Declare destructor.  Use
DISABLE_COPY_AND_ASSIGN.

Change-Id: I245ba5b7dec5e5d9f29cd21832c6e2b4fecef047
gdb/ChangeLog
gdb/disasm.c
gdb/disasm.h