summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-11-08 15:26:45 +0000
committerPedro Alves <palves@redhat.com>2016-11-08 15:26:45 +0000
commit3d8b0d9483f6eabc2c1739ac3dd64c30061a6a72 (patch)
tree49ecee971eec1598978089c9c177648d53637d42
parentb3ced9bad2d8d5eb9ebabc5f8f7c6ab871f63748 (diff)
downloadbinutils-gdb-3d8b0d9483f6eabc2c1739ac3dd64c30061a6a72.tar.gz
Use ui_file_as_string in gdb/cli/cli-setshow.c
gdb/ChangeLog: 2016-11-08 Pedro Alves <palves@redhat.com> * cli/cli-setshow.c (do_show_command): Adjust to use ui_file_as_string and std::string.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/cli/cli-setshow.c7
2 files changed, 8 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 51a12069611..ae21b12d337 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2016-11-08 Pedro Alves <palves@redhat.com>
+ * cli/cli-setshow.c (do_show_command): Adjust to use
+ ui_file_as_string and std::string.
+
+2016-11-08 Pedro Alves <palves@redhat.com>
+
* remote.c (escape_buffer): Use ui_file_as_string and return
std::string.
(putpkt_binary, read_frame): Adjust to use std::string.
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index eb17158dcb9..d2ec1dfb33d 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);