python/py-utils.c (host_string_to_python_string): New function.
gdb/ChangeLog: * python/py-utils.c (host_string_to_python_string): New function. * python/python-internal.h (host_string_to_python_string): Declare it. * python/py-*.c (*): Update all calls to PyString_Decode (str, strlen (str), host_charset (), NULL); to use host_string_to_python_string instead.
This commit is contained in:
parent
4ec9d7d564
commit
4ae6cc1962
8 changed files with 30 additions and 21 deletions
|
@ -516,7 +516,7 @@ gdbpy_parameter_value (enum var_types type, void *var)
|
|||
|
||||
if (! str)
|
||||
str = "";
|
||||
return PyString_Decode (str, strlen (str), host_charset (), NULL);
|
||||
return host_string_to_python_string (str);
|
||||
}
|
||||
|
||||
case var_boolean:
|
||||
|
@ -706,7 +706,7 @@ gdbpy_solib_name (PyObject *self, PyObject *args)
|
|||
|
||||
soname = solib_name_from_address (current_program_space, pc);
|
||||
if (soname)
|
||||
str_obj = PyString_Decode (soname, strlen (soname), host_charset (), NULL);
|
||||
str_obj = host_string_to_python_string (soname);
|
||||
else
|
||||
{
|
||||
str_obj = Py_None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue