This is the mail archive of the archer@sourceware.org mailing list for the Archer project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Phil> I decided to take a crack at the mechanics of this change this
Phil> morning. This produces the following hunks (in rough). I can see how
Phil> just borrowing the underlying data from the PyObject avoids an
Phil> allocation (the results of PyString_AsString must not be deallocated,
Phil> etc). Is this what you had in mind?
* python/lib/gdb/libstdcxx/v6/printers.py (StdStringPrinter.to_string): Extract length from header. Use in string extraction. * python/python-internal.h (apply_varobj_pretty_printer): Update definition. (python_string_to_target_python_string): Add definition. * python/python-utils.c (unicode_to_encoded_python_string) (unicode_to_target_python_string) (python_string_to_target_python_string): New Functions. * python/python.c : (print_string_repr): Refactor to logic to account for PyObject returned strings. (pretty_print_one_value): Likewise (apply_varobj_pretty_printer): Likewise. * varobj.c (value_get_print_value): Refactor logic to account for PyObject returned strings.
* gdb.python/python-prettyprint.c: Add counted null string structure. * gdb.python/python-prettyprint.exp: Print null string. Test for embedded nulls. * gdb.python/python-prettyprint.py (pp_ns): New Function.
Attachment:
strings_as_pyobjects.patch
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |