projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use ui_file_as_string in gdb/python/
[deliverable/binutils-gdb.git]
/
gdb
/
python
/
py-type.c
diff --git
a/gdb/python/py-type.c
b/gdb/python/py-type.c
index 03cc8d9ecad20bbcb2752c9b5091664ec79060ea..da9dadd2fb07be053d7c75660cd4a506144909d9 100644
(file)
--- a/
gdb/python/py-type.c
+++ b/
gdb/python/py-type.c
@@
-1010,8
+1010,7
@@
typy_template_argument (PyObject *self, PyObject *args)
static PyObject *
typy_str (PyObject *self)
{
static PyObject *
typy_str (PyObject *self)
{
- char *thetype = NULL;
- long length = 0;
+ std::string thetype;
PyObject *result;
TRY
PyObject *result;
TRY
@@
-1025,18
+1024,17
@@
typy_str (PyObject *self)
LA_PRINT_TYPE (type_object_to_type (self), "", stb, -1, 0,
&type_print_raw_options);
LA_PRINT_TYPE (type_object_to_type (self), "", stb, -1, 0,
&type_print_raw_options);
- thetype = ui_file_
xstrdup (stb, &length
);
+ thetype = ui_file_
as_string (stb
);
do_cleanups (old_chain);
}
CATCH (except, RETURN_MASK_ALL)
{
do_cleanups (old_chain);
}
CATCH (except, RETURN_MASK_ALL)
{
- xfree (thetype);
GDB_PY_HANDLE_EXCEPTION (except);
}
END_CATCH
GDB_PY_HANDLE_EXCEPTION (except);
}
END_CATCH
- result = PyUnicode_Decode (thetype
, length, host_charset (), NULL);
-
xfree (thetype
);
+ result = PyUnicode_Decode (thetype
.c_str (), thetype.length (),
+
host_charset (), NULL
);
return result;
}
return result;
}
This page took
0.023964 seconds
and
4
git commands to generate.