aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 130f438..81b2f28 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -2910,12 +2910,10 @@ value_get_print_value (struct value *value, enum varobj_display_formats format,
string_print. Otherwise just return the extracted
string as a value. */
- PyObject *py_str
- = python_string_to_target_python_string (output);
+ char *s = python_string_to_target_string (output);
- if (py_str)
+ if (s)
{
- char *s = PyString_AsString (py_str);
char *hint;
hint = gdbpy_get_display_hint (value_formatter);
@@ -2926,10 +2924,10 @@ value_get_print_value (struct value *value, enum varobj_display_formats format,
xfree (hint);
}
- len = PyString_Size (py_str);
+ len = strlen (s);
thevalue = xmemdup (s, len + 1, len + 1);
type = builtin_type (gdbarch)->builtin_char;
- Py_DECREF (py_str);
+ xfree (s);
if (!string_print)
{