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/16286] value.string(length = x) broken for common variable length arrays idiom


https://sourceware.org/bugzilla/show_bug.cgi?id=16286

--- Comment #8 from dje at google dot com ---
(In reply to Tom Tromey from comment #7)
> (In reply to dje from comment #4)
> 
> > I recognize the problem, but error checking and clipping of the length needs
> > to be done in python before invoking value.string().
> 
> I'd rather we not advise users to do this.
> Instead gdb should do the throttling.
> lazy_string is intended to help with this problem;
> also perhaps some other fix is possible in the value printing code.

value.string() can be invoked for any purpose the user chooses, not just
printing.  It can also be invoked when building a pretty-printed result out of
pieces (where a lazy string is problematic).  So if we add a knob, it needs to
be more general than for just printing.  I'm then left with wondering what kind
of knob?  Should it just be for value.string() or should it be more general? 
And is it something we want in the API?

It's kinda like adding a knob to malloc() or write() or whatever that says
"Naaaa... the user can't really mean he wants to do that with 2GB (or 20GB or
whatever)."  Such a knob would never pass muster, so I'm left with wondering if
it's really something we want in the Python API.  If someone else submits a
patch, and presents a compelling reason for it, that's fine by me (I'm not
opposed to it per se, but I'm not ready to submit one myself).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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