This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/10633] std::string pretty printer should respect 'print elements' limit
- From: "pmuldoon at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 14 Sep 2009 09:20:27 -0000
- Subject: [Bug python/10633] std::string pretty printer should respect 'print elements' limit
- References: <20090912003708.10633.ppluzhnikov@google.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From pmuldoon at redhat dot com 2009-09-14 09:20 -------
I took a very brief look at this bug this morning. The reason the std::string
printer is not respecting the "set print element n" directive is that it does
not implement a children(self ...) function. It returns the contents of the
std::string in the to_string(self) pretty printer api.
The elements length code is only checked in the print_children function within
py-prettyprint.c, and so this code immediately returns:
if (! PyObject_HasAttr (printer, gdbpy_children_cst))
return;
Whether std::string should treat each character as a child, or the parent
to_string() should respect options->print_max, I'm not sure. (Though I can't see
a workable solution with to_string gated by print_max, as that would also affect
all kinds of helper/descriptive text that is not a part of the actual value)
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
http://sourceware.org/bugzilla/show_bug.cgi?id=10633
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.