This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB 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]

[Bug python/10633] std::string pretty printer should respect 'print elements' limit


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]