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

Joel Brobecker <brobecker at gnat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brobecker at gnat dot com

--- Comment #3 from Joel Brobecker <brobecker at gnat dot com> ---
For the question asked by asm warrior with unnitialized variables, the problem
is not limited to Python. It's a general issue faced by languages that deal
with variable-sized objects. Eg, in Ada:

type Bla (Length : Integer) is record
   Data : array (1 .. Length) of Integer;
end record;

If you try to read an object of this type before it gets initialized, you can
get surprising results, including the crash  asmwarrior mentions, usually
because the length read is a ridiculously large value.

In Ada, we mitigated the problem by setting an artificial limit ('varsize
limit'). Perhaps it's time to generalize the idea to the rest of GDB?

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