diff options
author | Doug Evans <dje@google.com> | 2016-03-29 23:48:35 -0700 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2016-03-29 23:48:35 -0700 |
commit | 4ae6cc19626d010005fbfbfba72952d26cc7c728 (patch) | |
tree | 79b99d5476876b4bd92ac2d0f0b6c67589ca67ec /gdb/python/py-symtab.c | |
parent | 4ec9d7d56427e9fa49fd705599bb2ff0c3c5f3c1 (diff) | |
download | binutils-4ae6cc19626d010005fbfbfba72952d26cc7c728.zip binutils-4ae6cc19626d010005fbfbfba72952d26cc7c728.tar.gz binutils-4ae6cc19626d010005fbfbfba72952d26cc7c728.tar.bz2 |
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.
Diffstat (limited to 'gdb/python/py-symtab.c')
-rw-r--r-- | gdb/python/py-symtab.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/python/py-symtab.c b/gdb/python/py-symtab.c index d084969..c3c94e5 100644 --- a/gdb/python/py-symtab.c +++ b/gdb/python/py-symtab.c @@ -108,8 +108,7 @@ stpy_get_filename (PyObject *self, void *closure) STPY_REQUIRE_VALID (self, symtab); filename = symtab_to_filename_for_display (symtab); - str_obj = PyString_Decode (filename, strlen (filename), - host_charset (), NULL); + str_obj = host_string_to_python_string (filename); return str_obj; } @@ -140,8 +139,7 @@ stpy_get_producer (PyObject *self, void *closure) { const char *producer = COMPUNIT_PRODUCER (cust); - return PyString_Decode (producer, strlen (producer), - host_charset (), NULL); + return host_string_to_python_string (producer); } Py_RETURN_NONE; @@ -157,7 +155,7 @@ stpy_fullname (PyObject *self, PyObject *args) fullname = symtab_to_fullname (symtab); - return PyString_Decode (fullname, strlen (fullname), host_charset (), NULL); + return host_string_to_python_string (fullname); } /* Implementation of gdb.Symtab.is_valid (self) -> Boolean. |