[fpc-devel] Record types with unbounded trailing data
Michael Van Canneyt
michael at freepascal.org
Mon Jun 24 11:28:25 CEST 2019
On Mon, 24 Jun 2019, Martin Frb wrote:
> On 24/06/2019 06:41, Michael Van Canneyt wrote:
>>
>> If you want to get rid of warnings, define it as
>> LOGPALETTE = record
>> palVersion : WORD;
>> palNumEntries : WORD;
>> palPalEntry : array[0..(MAXINT div sizeof(PALETTEENTRY)] of
>> PALETTEENTRY;
>> end;
>
> Which of course can prevent debugging to work.
>
> Older gdb will crash (out of mem).
> Newer ones have a mem limit, and will simply give an error.
>
> Gdb even has issues to get individual fields of such large structures.
In the other case [0..0] it will presumably refuse to show more than 1 entry ?
As I said, it is a dummy structure, so expecting it to work without tricks is IMO futile.
And that apparently extends to debugging as well...
Michael.
More information about the fpc-devel
mailing list