This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v2 20/31] Use ui_file_as_string in gdb/cli/cli-setshow.c
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 19 Oct 2016 02:12:08 +0100
- Subject: [PATCH v2 20/31] Use ui_file_as_string in gdb/cli/cli-setshow.c
- Authentication-results: sourceware.org; auth=none
- References: <1476839539-8374-1-git-send-email-palves@redhat.com>
gdb/ChangeLog:
yyyy-mm-yy Pedro Alves <palves@redhat.com>
* cli/cli-setshow.c (do_show_command): Adjust to use
ui_file_as_string and std::string.
---
gdb/cli/cli-setshow.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index eb17158..d2ec1df 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -653,13 +653,12 @@ do_show_command (const char *arg, int from_tty, struct cmd_list_element *c)
ui_out_field_stream (uiout, "value", stb);
else
{
- char *value = ui_file_xstrdup (stb, NULL);
+ std::string value = ui_file_as_string (stb);
- make_cleanup (xfree, value);
if (c->show_value_func != NULL)
- c->show_value_func (gdb_stdout, from_tty, c, value);
+ c->show_value_func (gdb_stdout, from_tty, c, value.c_str ());
else
- deprecated_show_value_hack (gdb_stdout, from_tty, c, value);
+ deprecated_show_value_hack (gdb_stdout, from_tty, c, value.c_str ());
}
do_cleanups (old_chain);
--
2.5.5