diff options
author | Pedro Alves <palves@redhat.com> | 2016-11-08 15:26:45 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2016-11-08 15:26:45 +0000 |
commit | 7b01d34b2a62fb8cda96fe40c755f99e63b8ba4f (patch) | |
tree | 8ba9fe472c1b411daeaf3cf95b43b41701a10686 /gdb/top.c | |
parent | db1ec11fff1a46f7046bcbd971a42632d2ea795c (diff) | |
download | gdb-7b01d34b2a62fb8cda96fe40c755f99e63b8ba4f.zip gdb-7b01d34b2a62fb8cda96fe40c755f99e63b8ba4f.tar.gz gdb-7b01d34b2a62fb8cda96fe40c755f99e63b8ba4f.tar.bz2 |
Use ui_file_as_string in gdb/top.c
Yet another cleanup is eliminated.
gdb/ChangeLog:
2016-11-08 Pedro Alves <palves@redhat.com>
* top.c (quit_confirm): Use ui_file_as_string and std::string.
Diffstat (limited to 'gdb/top.c')
-rw-r--r-- | gdb/top.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1576,8 +1576,6 @@ quit_confirm (void) { struct ui_file *stb; struct cleanup *old_chain; - char *str; - int qr; /* Don't even ask if we're only debugging a core file inferior. */ if (!have_live_inferiors ()) @@ -1591,12 +1589,11 @@ quit_confirm (void) iterate_over_inferiors (print_inferior_quit_action, stb); fprintf_filtered (stb, _("\nQuit anyway? ")); - str = ui_file_xstrdup (stb, NULL); - make_cleanup (xfree, str); + std::string str = ui_file_as_string (stb); - qr = query ("%s", str); do_cleanups (old_chain); - return qr; + + return query ("%s", str.c_str ()); } /* Prepare to exit GDB cleanly by undoing any changes made to the |