From 4ae6cc19626d010005fbfbfba72952d26cc7c728 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Tue, 29 Mar 2016 23:48:35 -0700 Subject: 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. --- gdb/python/py-progspace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gdb/python/py-progspace.c') diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c index 62a5c7a..e1258c7 100644 --- a/gdb/python/py-progspace.c +++ b/gdb/python/py-progspace.c @@ -71,9 +71,7 @@ pspy_get_filename (PyObject *self, void *closure) struct objfile *objfile = obj->pspace->symfile_object_file; if (objfile) - return PyString_Decode (objfile_name (objfile), - strlen (objfile_name (objfile)), - host_charset (), NULL); + return host_string_to_python_string (objfile_name (objfile)); } Py_RETURN_NONE; } -- cgit v1.1