mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-25 16:57:52 +00:00
Garbage collect py-utils.c:target_string_to_unicode.
The strlen in this function looked suspicious, for the function documents that STR is in the target's charset (what if it is utf-32, etc.). On closer inspection, nothing is calling the function, and it's been that way ever since the function was added. gdb/ 2013-03-06 Pedro Alves <palves@redhat.com> * python/py-utils.c (target_string_to_unicode): Delete function. * python/python-internal.h (target_string_to_unicode): Delete declaration.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2013-03-06 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* python/py-utils.c (target_string_to_unicode): Delete function.
|
||||||
|
* python/python-internal.h (target_string_to_unicode): Delete
|
||||||
|
declaration.
|
||||||
|
|
||||||
2013-03-06 Pierre Muller <muller@sourceware.org>
|
2013-03-06 Pierre Muller <muller@sourceware.org>
|
||||||
|
|
||||||
* linespec.c (get_current_search_block): ARI fix, use (void)
|
* linespec.c (get_current_search_block): ARI fix, use (void)
|
||||||
|
|||||||
@@ -204,19 +204,6 @@ python_string_to_host_string (PyObject *obj)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Converts a target string of LENGTH bytes in the target's charset to a
|
|
||||||
Python Unicode string. If LENGTH is -1, convert until a null byte is found.
|
|
||||||
|
|
||||||
Returns NULL on error, with a python exception set. */
|
|
||||||
PyObject *
|
|
||||||
target_string_to_unicode (const gdb_byte *str, int length)
|
|
||||||
{
|
|
||||||
if (length == -1)
|
|
||||||
length = strlen (str);
|
|
||||||
|
|
||||||
return PyUnicode_Decode (str, length, target_charset (python_gdbarch), NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return true if OBJ is a Python string or unicode object, false
|
/* Return true if OBJ is a Python string or unicode object, false
|
||||||
otherwise. */
|
otherwise. */
|
||||||
|
|
||||||
|
|||||||
@@ -335,7 +335,6 @@ char *unicode_to_target_string (PyObject *unicode_str);
|
|||||||
char *python_string_to_target_string (PyObject *obj);
|
char *python_string_to_target_string (PyObject *obj);
|
||||||
PyObject *python_string_to_target_python_string (PyObject *obj);
|
PyObject *python_string_to_target_python_string (PyObject *obj);
|
||||||
char *python_string_to_host_string (PyObject *obj);
|
char *python_string_to_host_string (PyObject *obj);
|
||||||
PyObject *target_string_to_unicode (const gdb_byte *str, int length);
|
|
||||||
int gdbpy_is_string (PyObject *obj);
|
int gdbpy_is_string (PyObject *obj);
|
||||||
char *gdbpy_obj_to_string (PyObject *obj);
|
char *gdbpy_obj_to_string (PyObject *obj);
|
||||||
char *gdbpy_exception_to_string (PyObject *ptype, PyObject *pvalue);
|
char *gdbpy_exception_to_string (PyObject *ptype, PyObject *pvalue);
|
||||||
|
|||||||
Reference in New Issue
Block a user