Apologies... I should have mentioned Windows 7 64bit SP1.
Version 3.2 of FpDebug treats "int3" (opcode $CC) and "int 3" (bytes $CD $03) differently. The former is handled as expected, the latter causes an access violation.
It would be nice if FpDebug treated both forms the same way as they are functionally the same.
refer to the following code:
{$APPTYPE CONSOLE}
{$TYPEDADDRESS ON}
{$LONGSTRINGS OFF}
{$WRITEABLECONST OFF}
{ comment this define out to observe the large difference in compile time }
{$define initlargevar}
program LargeInitialization;
type
TRANGE = 0..(1024 * 1024) - 1;
TRECORD = record
count : int32;
elements : array[TRANGE]
of record
FieldA : int32;
FieldB : int32;
end;
end;
function main() : boolean;
var
LargeVar : TRECORD {$ifdef initlargevar} = () {$endif} ;
begin
result := FALSE;
LargeVar.count := LargeVar.count; { just do something }
result := TRUE;
end;
begin
main();
end.
when that code is compiled, it produces an 8 MB executable because the compiler instead of generating the 3 assembly instructions it takes to initialize the "LargeVar", it creates an 8 MB "private" variable in the initialized data segment which it then copies into the local.
The compiler should simply generate the few assembly instructions it takes to initialize the variable.
MINSTACKSIZE ignores all characters it finds after a number yet this behavior is not documented.
specify something like {$MINSTACKSIZE 7 * 1024 * 1024} in a program and only the 7 is used and no warning whatsoever is issued about the rest of the characters being ignored.
follow the steps to reproduce
it is not documented that $MINSTACKSIZE ignores everything after the first number it finds.
document the behavior.
none necessary
Allow importing external variables by ordinal in Windows (using "external index <ordinal_number>"
allow a declaration such as : var Free : pchar; external comctl32 index 73;
where "comctl32" has already been defined as a constant, i.e, const comctl32 = 'comctl32.dll';
importing external functions by ordinal only is already supported, it makes sense that for symmetry external variables may also be imported by ordinal.
import a function by ordinal to verify that "index" is allowed
function AddMRUData
(
{ _in_ } InListHandle : THANDLE;
{ _in_ const } InData : pointer;
{ _in_ } InDataSize : DWORD
)
: longint; stdcall; external comctl32 index 167; { ordinal only !! }
the "index" option is missing - missing options result in incomplete information for the user.
having the "index" appear as an option.
add "index" as a valid option for a declaration of an external function
declare a variant record using the same tag for each variant
type
SomeRecord = record
case Integer of
1: (a: Integer);
1: (b: char);
1: (c: double);
1: (d: boolean);
end;
the compiler accepts a questionable definition.
the compiler should refuse duplicate tag values