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] |
This needs an 'else' case to call gdbpy_print_stack.
Also, why the '+ 1' in the computation of 'len'? Won't this make LA_PRINT_STRING print one too many bytes?
Phil> + if (replacement == NULL&& py_str == NULL)
'replacement' cannot be NULL here. You want '*replacement'.
Phil> + thevalue = xmemdup (s, len, len);
Here you do want to copy size+1 bytes, but...
Phil> + LA_PRINT_STRING (stb, thevalue, len, 1, 0,&opts);
... here I think you wan to just print size bytes.
* 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 (pretty_print_one_value): Likewise. (print_string_repr): Refactor to logic to account for PyObject returned strings. (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:
pystring_review.patch
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |