Remove cleanups from tracefile.c
authorTom Tromey <tom@tromey.com>
Thu, 7 Jun 2018 22:06:41 +0000 (16:06 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 10 Jun 2018 13:31:22 +0000 (07:31 -0600)
commitd14b92bf8a7f4c57eb6c5fca559c7bbb8a747358
tree695a939fb5a678e5413f85d44cb328c1040cde8b
parent835dcf92618e294d3c6c2bedd94af712809c96a3
Remove cleanups from tracefile.c

This removes cleanups from tracefile.c, by introducing a unique_ptr
specialization.

This code could be made even simpler via a deeper C++-ification, but I
have not attempted that.

Tested by the buildbot.

gdb/ChangeLog
2018-06-10  Tom Tromey  <tom@tromey.com>

* tracefile.c (struct trace_file_writer_deleter): New.
<operator()>: Rename from trace_file_writer_xfree.
(trace_file_writer_up): New typedef.
(tsave_command, trace_save_tfile, trace_save_ctf): Update.
gdb/ChangeLog
gdb/tracefile.c