Use ui_file_as_string in gdb/python/
[deliverable/binutils-gdb.git] / gdb / python / py-frame.c
index 6bdac08579f3639ef47a1b524b63f039d42dd07b..a66f88555ff6096939c908b494143cb79f8a5e11 100644 (file)
@@ -80,17 +80,13 @@ frame_object_to_frame_info (PyObject *obj)
 static PyObject *
 frapy_str (PyObject *self)
 {
-  char *s;
   PyObject *result;
   struct ui_file *strfile;
 
   strfile = mem_fileopen ();
   fprint_frame_id (strfile, ((frame_object *) self)->frame_id);
-  s = ui_file_xstrdup (strfile, NULL);
-  result = PyString_FromString (s);
-  xfree (s);
-
-  return result;
+  std::string s = ui_file_as_string (strfile);
+  return PyString_FromString (s.c_str ());
 }
 
 /* Implementation of gdb.Frame.is_valid (self) -> Boolean.
This page took 0.023414 seconds and 4 git commands to generate.