summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.sh
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-11-08 15:26:46 +0000
committerPedro Alves <palves@redhat.com>2016-11-08 15:26:46 +0000
commit6f0302493af0ace93943041c3374069c15c363f7 (patch)
treec1add65a939f12b10ee16f28644a460c82007112 /gdb/gdbarch.sh
parent66bbce5bda870c49a68f2b77a29fb96eca72632f (diff)
downloadbinutils-gdb-6f0302493af0ace93943041c3374069c15c363f7.tar.gz
Use ui_file_as_string in gdbarch.sh/gdbarch.c
gdb/ChangeLog: 2016-11-08 Pedro Alves <palves@redhat.com> * gdbarch.sh (verify_gdbarch): Use ui_file_as_string and std::string. * gdbarch.c: Regenerate.
Diffstat (limited to 'gdb/gdbarch.sh')
-rwxr-xr-xgdb/gdbarch.sh8
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 9b94703ef97..28a34781daa 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -1878,7 +1878,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
struct ui_file *log;
struct cleanup *cleanups;
long length;
- char *buf;
log = mem_fileopen ();
cleanups = make_cleanup_ui_file_delete (log);
@@ -1924,12 +1923,11 @@ do
fi
done
cat <<EOF
- buf = ui_file_xstrdup (log, &length);
- make_cleanup (xfree, buf);
- if (length > 0)
+ std::string buf = ui_file_as_string (log);
+ if (!buf.empty ())
internal_error (__FILE__, __LINE__,
_("verify_gdbarch: the following are invalid ...%s"),
- buf);
+ buf.c_str ());
do_cleanups (cleanups);
}
EOF