Hello,
I was fiddling with bit arrays and was getting some values from GDB, I couldn't make sense of. I wrote the following little test program to see what GDB would say:
program TestBitArray;
type
T1BIT = 0..1;
var
BitArray : bitpacked array[0..8191] of T1BIT;
ByteArray : packed array[0..1023] of byte absolute BitArray;
i : integer;
sum : qword;
begin
sum := 0;
for i := low(BitArray) to high(BitArray) do
begin
inc(sum, BitArray[i]);
end;
writeln(Sum);
sum := 0;
for i := low(ByteArray) to high(ByteArray) do
begin
inc(Sum, ByteArray[i]);
end;
writeln(Sum);
end.
When hovering the mouse over the BitArray variable, GDB shows that some of the elements in the array are not zero (they should be - and are - zero.) The Sum variables confirm that all elements are zero even though GDB shows some of them as not zero.
What the popup display shows is attached to this post.
I figured I'd post this as an FYI. Also, the GDB version I'm using is 7.2, type of Debug Info is "dwarf with sets".