• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revision7b01d34b2a62fb8cda96fe40c755f99e63b8ba4f (tree)
Time2016-11-09 00:26:45
AuthorPedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

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.

Change Summary

Incremental Difference

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
11 2016-11-08 Pedro Alves <palves@redhat.com>
22
3+ * top.c (quit_confirm): Use ui_file_as_string and std::string.
4+
5+2016-11-08 Pedro Alves <palves@redhat.com>
6+
37 * gdbcmd.h (execute_command_to_string): Now returns std::string.
48 (lookup_struct_elt_type): Adjust to use std::string.
59 * top.c (execute_command_to_string): Use ui_file_as_string and
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1576,8 +1576,6 @@ quit_confirm (void)
15761576 {
15771577 struct ui_file *stb;
15781578 struct cleanup *old_chain;
1579- char *str;
1580- int qr;
15811579
15821580 /* Don't even ask if we're only debugging a core file inferior. */
15831581 if (!have_live_inferiors ())
@@ -1591,12 +1589,11 @@ quit_confirm (void)
15911589 iterate_over_inferiors (print_inferior_quit_action, stb);
15921590 fprintf_filtered (stb, _("\nQuit anyway? "));
15931591
1594- str = ui_file_xstrdup (stb, NULL);
1595- make_cleanup (xfree, str);
1592+ std::string str = ui_file_as_string (stb);
15961593
1597- qr = query ("%s", str);
15981594 do_cleanups (old_chain);
1599- return qr;
1595+
1596+ return query ("%s", str.c_str ());
16001597 }
16011598
16021599 /* Prepare to exit GDB cleanly by undoing any changes made to the