This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/16286] value.string(length = x) broken for common variable length arrays idiom
- From: "brobecker at gnat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 03 Dec 2013 02:48:45 +0000
- Subject: [Bug python/16286] value.string(length = x) broken for common variable length arrays idiom
- Auto-submitted: auto-generated
- References: <bug-16286-4717 at http dot sourceware dot org/bugzilla/>
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.