mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-29 23:36:06 +08:00
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:
@ -221,6 +221,14 @@ python_string_to_host_string (PyObject *obj)
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Convert a host string to a python string. */
|
||||
|
||||
PyObject *
|
||||
host_string_to_python_string (const char *str)
|
||||
{
|
||||
return PyString_Decode (str, strlen (str), host_charset (), NULL);
|
||||
}
|
||||
|
||||
/* Return true if OBJ is a Python string or unicode object, false
|
||||
otherwise. */
|
||||
|
||||
|
Reference in New Issue
Block a user