mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-18 15:43:08 +08:00
Return gdbpy_ref from some Python string functions
This changes python_string_to_unicode, python_string_to_target_python_string, and host_string_to_python_string to return gdbpy_ref. gdb/ChangeLog 2018-11-04 Tom Tromey <tom@tromey.com> * python/python.c (gdbpy_parameter_value): Update. * python/python-internal.h (python_string_to_unicode) (python_string_to_target_python_string) (host_string_to_python_string): Return gdbpy_ref. * python/py-utils.c (python_string_to_unicode) (unicode_to_encoded_python_string) (unicode_to_target_python_string) (python_string_to_target_string) (python_string_to_target_python_string): Return gdbpy_ref. (python_string_to_host_string): Update. (host_string_to_python_string): Return gdbpy_ref. * python/py-symtab.c (stpy_get_filename, stpy_get_producer) (stpy_fullname): Update. * python/py-progspace.c (pspy_get_filename, pspy_solib_name): Update. * python/py-prettyprint.c (print_string_repr): Update. * python/py-objfile.c (objfpy_get_filename, objfpy_get_username) (objfpy_get_build_id): Update. * python/py-breakpoint.c (bppy_get_location) (bppy_get_expression, bppy_get_condition, bppy_get_commands): Update.
This commit is contained in:
@ -83,7 +83,8 @@ pspy_get_filename (PyObject *self, void *closure)
|
||||
struct objfile *objfile = obj->pspace->symfile_object_file;
|
||||
|
||||
if (objfile)
|
||||
return host_string_to_python_string (objfile_name (objfile));
|
||||
return (host_string_to_python_string (objfile_name (objfile))
|
||||
.release ());
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
@ -373,7 +374,7 @@ pspy_solib_name (PyObject *o, PyObject *args)
|
||||
soname = solib_name_from_address (self->pspace, pc);
|
||||
if (soname == nullptr)
|
||||
Py_RETURN_NONE;
|
||||
return host_string_to_python_string (soname);
|
||||
return host_string_to_python_string (soname).release ();
|
||||
}
|
||||
|
||||
/* Return the innermost lexical block containing the specified pc value,
|
||||
|
Reference in New Issue
Block a user