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-breakpoint.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-breakpoint.c')
-rw-r--r-- | gdb/python/py-breakpoint.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c index 964ec62..611a41e 100644 --- a/gdb/python/py-breakpoint.c +++ b/gdb/python/py-breakpoint.c @@ -392,7 +392,7 @@ bppy_get_location (PyObject *self, void *closure) str = event_location_to_string (obj->bp->location); if (! str) str = ""; - return PyString_Decode (str, strlen (str), host_charset (), NULL); + return host_string_to_python_string (str); } /* Python function to get the breakpoint expression. */ @@ -414,7 +414,7 @@ bppy_get_expression (PyObject *self, void *closure) if (! str) str = ""; - return PyString_Decode (str, strlen (str), host_charset (), NULL); + return host_string_to_python_string (str); } /* Python function to get the condition expression of a breakpoint. */ @@ -430,7 +430,7 @@ bppy_get_condition (PyObject *self, void *closure) if (! str) Py_RETURN_NONE; - return PyString_Decode (str, strlen (str), host_charset (), NULL); + return host_string_to_python_string (str); } /* Returns 0 on success. Returns -1 on error, with a python exception set. @@ -515,7 +515,7 @@ bppy_get_commands (PyObject *self, void *closure) ui_out_redirect (current_uiout, NULL); cmdstr = ui_file_xstrdup (string_file, &length); make_cleanup (xfree, cmdstr); - result = PyString_Decode (cmdstr, strlen (cmdstr), host_charset (), NULL); + result = host_string_to_python_string (cmdstr); do_cleanups (chain); return result; } |