gdb: make inferior::terminal a unique ptr
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 25 Jun 2020 18:44:13 +0000 (14:44 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 25 Jun 2020 18:44:35 +0000 (14:44 -0400)
commit277474eea03e0f77a9d37c69dfab3f0c41812348
tree5e415b1644e846c6076f19f4864301301270fb1a
parentd73be6116811aeaedd1863c2597ede78be3cf4e5
gdb: make inferior::terminal a unique ptr

This changes the inferior::terminal field to be a unique pointer, so its
deallocation is automatically managed.

gdb/ChangeLog:

* inferior.h (struct inferior) <terminal>: Change type to
gdb::unique_xmalloc_ptr<char>.
* inferior.c (inferior::~inferior): Don't free inf->terminal.
* infcmd.c (set_inferior_io_terminal): Don't free terminal
field, adjust to unique pointer.
(get_inferior_io_terminal): Adjust to unique pointer.

Change-Id: Iedb6459b4f9eeae812b0cb9d514b5707d5107cdb
gdb/ChangeLog
gdb/infcmd.c
gdb/inferior.c
gdb/inferior.h