GNU Binutils with patches for OS216
Révision | 7b01d34b2a62fb8cda96fe40c755f99e63b8ba4f (tree) |
---|---|
l'heure | 2016-11-09 00:26:45 |
Auteur | Pedro Alves <palves@redh...> |
Commiter | Pedro Alves |
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.
@@ -1,5 +1,9 @@ | ||
1 | 1 | 2016-11-08 Pedro Alves <palves@redhat.com> |
2 | 2 | |
3 | + * top.c (quit_confirm): Use ui_file_as_string and std::string. | |
4 | + | |
5 | +2016-11-08 Pedro Alves <palves@redhat.com> | |
6 | + | |
3 | 7 | * gdbcmd.h (execute_command_to_string): Now returns std::string. |
4 | 8 | (lookup_struct_elt_type): Adjust to use std::string. |
5 | 9 | * top.c (execute_command_to_string): Use ui_file_as_string and |
@@ -1576,8 +1576,6 @@ quit_confirm (void) | ||
1576 | 1576 | { |
1577 | 1577 | struct ui_file *stb; |
1578 | 1578 | struct cleanup *old_chain; |
1579 | - char *str; | |
1580 | - int qr; | |
1581 | 1579 | |
1582 | 1580 | /* Don't even ask if we're only debugging a core file inferior. */ |
1583 | 1581 | if (!have_live_inferiors ()) |
@@ -1591,12 +1589,11 @@ quit_confirm (void) | ||
1591 | 1589 | iterate_over_inferiors (print_inferior_quit_action, stb); |
1592 | 1590 | fprintf_filtered (stb, _("\nQuit anyway? ")); |
1593 | 1591 | |
1594 | - str = ui_file_xstrdup (stb, NULL); | |
1595 | - make_cleanup (xfree, str); | |
1592 | + std::string str = ui_file_as_string (stb); | |
1596 | 1593 | |
1597 | - qr = query ("%s", str); | |
1598 | 1594 | do_cleanups (old_chain); |
1599 | - return qr; | |
1595 | + | |
1596 | + return query ("%s", str.c_str ()); | |
1600 | 1597 | } |
1601 | 1598 | |
1602 | 1599 | /* Prepare to exit GDB cleanly by undoing any changes made to the |