forked from Imagelibrary/binutils-gdb
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.
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2016-11-08 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* top.c (quit_confirm): Use ui_file_as_string and std::string.
|
||||||
|
|
||||||
2016-11-08 Pedro Alves <palves@redhat.com>
|
2016-11-08 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* gdbcmd.h (execute_command_to_string): Now returns std::string.
|
* gdbcmd.h (execute_command_to_string): Now returns std::string.
|
||||||
|
|||||||
@@ -1576,8 +1576,6 @@ quit_confirm (void)
|
|||||||
{
|
{
|
||||||
struct ui_file *stb;
|
struct ui_file *stb;
|
||||||
struct cleanup *old_chain;
|
struct cleanup *old_chain;
|
||||||
char *str;
|
|
||||||
int qr;
|
|
||||||
|
|
||||||
/* Don't even ask if we're only debugging a core file inferior. */
|
/* Don't even ask if we're only debugging a core file inferior. */
|
||||||
if (!have_live_inferiors ())
|
if (!have_live_inferiors ())
|
||||||
@@ -1591,12 +1589,11 @@ quit_confirm (void)
|
|||||||
iterate_over_inferiors (print_inferior_quit_action, stb);
|
iterate_over_inferiors (print_inferior_quit_action, stb);
|
||||||
fprintf_filtered (stb, _("\nQuit anyway? "));
|
fprintf_filtered (stb, _("\nQuit anyway? "));
|
||||||
|
|
||||||
str = ui_file_xstrdup (stb, NULL);
|
std::string str = ui_file_as_string (stb);
|
||||||
make_cleanup (xfree, str);
|
|
||||||
|
|
||||||
qr = query ("%s", str);
|
|
||||||
do_cleanups (old_chain);
|
do_cleanups (old_chain);
|
||||||
return qr;
|
|
||||||
|
return query ("%s", str.c_str ());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prepare to exit GDB cleanly by undoing any changes made to the
|
/* Prepare to exit GDB cleanly by undoing any changes made to the
|
||||||
|
|||||||
Reference in New Issue
Block a user