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/16196] New: lazy string vs "print elements"


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

            Bug ID: 16196
           Summary: lazy string vs "print elements"
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com

Bug 10633 says this is fixed, and the printing may be, but there's an
optimization to be had here.
read_string doesn't obey fetchlimit if len != -1.
So if one is printing an uninitialized string, or just a very long string,
gdb will read the whole thing, even if "print elements" is much smaller.

Plus I found another issue:
- long -> int conversion in the extracted lazy string length loses precision
  [which while one wouldn't expect to have 4G strings, pretty printing an
uninitialized object should have more consistent behaviour]

Repro:
create long c++ string, set target debug 1, and print the string.
How many bytes are read from the target?

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