diff options
author | Pedro Alves <palves@redhat.com> | 2016-11-08 15:26:45 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2016-11-08 15:26:45 +0000 |
commit | c92aed165e8af79f51c5165f98f12389bb59a121 (patch) | |
tree | 68b7aecd264ec7bcdc148d5a71c7459a62c03a09 /gdb/python/py-unwind.c | |
parent | 02030646c2a799614d31e52008403d8be067ac5d (diff) | |
download | binutils-gdb-c92aed165e8af79f51c5165f98f12389bb59a121.tar.gz |
Use ui_file_as_string in gdb/python/
gdb/ChangeLog:
2016-11-08 Pedro Alves <palves@redhat.com>
* python/py-arch.c (archpy_disassemble): Use ui_file_as_string and
std::string.
* python/py-breakpoint.c (bppy_get_commands): Use
ui_file_as_string and std::string.
* python/py-frame.c (frapy_str): Likewise.
* python/py-type.c (typy_str): Likewise.
* python/py-unwind.c (unwind_infopy_str): Likewise.
* python/py-value.c (valpy_str): Likewise.
Diffstat (limited to 'gdb/python/py-unwind.c')
-rw-r--r-- | gdb/python/py-unwind.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c index 92ce1382082..64c3123c2fd 100644 --- a/gdb/python/py-unwind.c +++ b/gdb/python/py-unwind.c @@ -236,12 +236,9 @@ unwind_infopy_str (PyObject *self) } fprintf_unfiltered (strfile, ")"); } - { - char *s = ui_file_xstrdup (strfile, NULL); - result = PyString_FromString (s); - xfree (s); - } + std::string s = ui_file_as_string (strfile); + result = PyString_FromString (s.c_str ()); ui_file_delete (strfile); return result; } |