FpDebug: array / tests

git-svn-id: trunk@44554 -
This commit is contained in:
martin 2014-03-30 14:25:23 +00:00
parent cedbc0d203
commit 759c840e8a
5 changed files with 229 additions and 144 deletions

View File

@ -1925,6 +1925,7 @@ end;
function TFpDbgDwarfValueArray.GetAsCardinal: QWord; function TFpDbgDwarfValueArray.GetAsCardinal: QWord;
begin begin
// TODO cache
if not MemManager.ReadUnsignedInt(OrdOrAddress, AddressSize, Result) then begin if not MemManager.ReadUnsignedInt(OrdOrAddress, AddressSize, Result) then begin
FLastError := MemManager.LastError; FLastError := MemManager.LastError;
Result := 0; Result := 0;
@ -1991,7 +1992,7 @@ begin
if (sfDynArray in t.Flags) and (AsCardinal <> 0) and if (sfDynArray in t.Flags) and (AsCardinal <> 0) and
GetDwarfDataAddress(Addr, TDbgDwarfTypeIdentifier(FOwner)) GetDwarfDataAddress(Addr, TDbgDwarfTypeIdentifier(FOwner))
then begin then begin
if not IsReadableMem(Addr) then if not (IsReadableMem(Addr) and (LocToAddr(Addr) > 4)) then
exit; exit;
Addr.Address := Addr.Address - 4; Addr.Address := Addr.Address - 4;
if MemManager.ReadSignedInt(Addr, 4, i) then begin if MemManager.ReadSignedInt(Addr, 4, i) then begin
@ -2036,19 +2037,30 @@ begin
If not Result then If not Result then
exit; exit;
// TODO ordinal assert(FTypeCastTargetType.Kind = skArray, 'TFpDbgDwarfValueArray.IsValidTypeCast: FTypeCastTargetType.Kind = skArray');
//TODO: shortcut, if FTypeCastTargetType = FTypeCastSourceValue.TypeInfo ?
if (FTypeCastSourceValue.FieldFlags * [svfAddress, svfSize, svfSizeOfPointer] = [svfAddress]) then if (FTypeCastSourceValue.FieldFlags * [svfAddress, svfSize, svfSizeOfPointer] = [svfAddress]) then
exit
else
if (FTypeCastSourceValue.FieldFlags * [svfAddress, svfSize] = [svfAddress, svfSize]) and
(FTypeCastSourceValue.Size = FOwner.FCU.FAddressSize)
then
exit
else
if (FTypeCastSourceValue.FieldFlags * [svfAddress, svfSizeOfPointer] = [svfAddress, svfSizeOfPointer])
then
exit; exit;
if sfDynArray in FTypeCastTargetType.Flags then begin
// dyn array
// TODO ordinal
if (FTypeCastSourceValue.FieldFlags * [svfAddress, svfSize] = [svfAddress, svfSize]) and
(FTypeCastSourceValue.Size = FOwner.FCU.FAddressSize)
then
exit
else
if (FTypeCastSourceValue.FieldFlags * [svfAddress, svfSizeOfPointer] = [svfAddress, svfSizeOfPointer])
then
exit;
end
else begin
// stat array
if (FTypeCastSourceValue.FieldFlags * [svfAddress, svfSize] = [svfAddress, svfSize]) and
(FTypeCastSourceValue.Size = FTypeCastTargetType.Size)
then
exit;
end;
Result := False; Result := False;
end; end;

View File

@ -174,10 +174,17 @@ type
property AsWideString: WideString read GetAsWideString; property AsWideString: WideString read GetAsWideString;
property AsFloat: Extended read GetAsFloat; property AsFloat: Extended read GetAsFloat;
property Address: TFpDbgMemLocation read GetAddress; // Address of variable (* * Address/Size
property Size: Integer read GetSize; // Size of variable Address of the variable (as returned by the "@" address of operator
property DataAddress: TFpDbgMemLocation read GetDataAddress; // Address of Data, if avail (e.g. String, TObject, ..., BUT NOT record) * DataAddress/DataSize
property DataSize: Integer read GetDataSize; // Sive of Data, if avail (e.g. String, TObject, ..., BUT NOT record) Address of Data, if avail and diff from Address (e.g. String, TObject, DynArray, ..., BUT NOT record)
Otherwise same as Address/Size
For pointers, this is the address of the pointed-to data
*)
property Address: TFpDbgMemLocation read GetAddress;
property Size: Integer read GetSize;
property DataAddress: TFpDbgMemLocation read GetDataAddress; //
property DataSize: Integer read GetDataSize;
property HasBounds: Boolean read GetHasBounds; property HasBounds: Boolean read GetHasBounds;
property OrdLowBound: Int64 read GetOrdLowBound; // need typecast for QuadWord property OrdLowBound: Int64 read GetOrdLowBound; // need typecast for QuadWord
@ -658,12 +665,12 @@ end;
function TFpDbgValue.GetDataAddress: TFpDbgMemLocation; function TFpDbgValue.GetDataAddress: TFpDbgMemLocation;
begin begin
Result := InvalidLoc; Result := Address;
end; end;
function TFpDbgValue.GetDataSize: Integer; function TFpDbgValue.GetDataSize: Integer;
begin begin
Result := 0; Result := Size;
end; end;
function TFpDbgValue.GetSize: Integer; function TFpDbgValue.GetSize: Integer;

View File

@ -2139,7 +2139,7 @@ begin
end end
else else
if tmp.Kind = skPointer then begin if tmp.Kind = skPointer then begin
if (svfDataAddress in tmp.FieldFlags) and (IsReadableLoc(tmp.DataAddress)) and if (svfDataAddress in tmp.FieldFlags) and (IsReadableLoc(tmp.DataAddress)) and // TODO, what if Not readable addr
(tmp.TypeInfo <> nil) //and (tmp.TypeInfo.TypeInfo <> nil) (tmp.TypeInfo <> nil) //and (tmp.TypeInfo.TypeInfo <> nil)
then begin then begin
//TODO: maybe introduce a method TypeCastFromAddress, so we can skip the twp2 object //TODO: maybe introduce a method TypeCastFromAddress, so we can skip the twp2 object

View File

@ -323,6 +323,36 @@ var
ArrayGlob_PStatDynClass1: PArrayStatDynClass; ArrayGlob_PStatDynClass1: PArrayStatDynClass;
ArrayGlob_PStatDynRec1: PArrayStatDynRec; ArrayGlob_PStatDynRec1: PArrayStatDynRec;
// copy of Pointers, to be used as Var Param
ArrayGlob_P2DynAInt1: PArrayDynInt;
ArrayGlob_P2StatAInt1: PArrayStatIntParam1;
ArrayGlob_P2StatAInt2: PArrayStatIntParam2;
ArrayGlob_P2DynInt1, ArrayGlob_P2DynInt2: PArrayDynInt;
ArrayGlob_P2DynClass1: PArrayDynClass;
ArrayGlob_P2DynRec1: PArrayDynRec;
ArrayGlob_P2DynRec2: PArrayDynRec2;
ArrayGlob_P2DynDynInt1: PArrayDynDynInt;
ArrayGlob_P2DynDynClass1: PArrayDynDynClass;
ArrayGlob_P2DynDynRec1: PArrayDynDynRec;
ArrayGlob_P2DynStatInt1: PArrayDynStatInt;
ArrayGlob_P2DynStatClass1: PArrayDynStatClass;
ArrayGlob_P2DynStatRec1: PArrayDynStatRec;
ArrayGlob_P2StatInt1: PArrayStatInt;
ArrayGlob_P2StatClass1: PArrayStatClass;
ArrayGlob_P2StatRec1: PArrayStatRec;
ArrayGlob_P2StatStatInt1: PArrayStatStatInt;
ArrayGlob_P2StatStatClass1: PArrayStatStatClass;
ArrayGlob_P2StatStatRec1: PArrayStatStatRec;
ArrayGlob_P2StatDynInt1: PArrayStatDynInt;
ArrayGlob_P2StatDynClass1: PArrayStatDynClass;
ArrayGlob_P2StatDynRec1: PArrayStatDynRec;
procedure Test1; procedure Test1;
implementation implementation
@ -963,6 +993,38 @@ begin
{%endregion ArrayGlob } {%endregion ArrayGlob }
// copy for var param
ArrayGlob_P2DynAInt1 := ArrayGlob_PDynAInt1;
ArrayGlob_P2StatAInt1 := ArrayGlob_PStatAInt1;
ArrayGlob_P2StatAInt2 := ArrayGlob_PStatAInt2;
ArrayGlob_P2DynInt1 := ArrayGlob_PDynInt1;
ArrayGlob_P2DynInt2 := ArrayGlob_PDynInt2;
ArrayGlob_P2DynClass1 := ArrayGlob_PDynClass1;
ArrayGlob_P2DynRec1 := ArrayGlob_PDynRec1;
ArrayGlob_P2DynRec2 := ArrayGlob_PDynRec2;
ArrayGlob_P2DynDynInt1 := ArrayGlob_PDynDynInt1;
ArrayGlob_P2DynDynClass1 := ArrayGlob_PDynDynClass1;
ArrayGlob_P2DynDynRec1 := ArrayGlob_PDynDynRec1;
ArrayGlob_P2DynStatInt1 := ArrayGlob_PDynStatInt1;
ArrayGlob_P2DynStatClass1 := ArrayGlob_PDynStatClass1;
ArrayGlob_P2DynStatRec1 := ArrayGlob_PDynStatRec1;
ArrayGlob_P2StatInt1 := ArrayGlob_PStatInt1;
ArrayGlob_P2StatClass1 := ArrayGlob_PStatClass1;
ArrayGlob_P2StatRec1 := ArrayGlob_PStatRec1;
ArrayGlob_P2StatStatInt1 := ArrayGlob_PStatStatInt1;
ArrayGlob_P2StatStatClass1 := ArrayGlob_PStatStatClass1;
ArrayGlob_P2StatStatRec1 := ArrayGlob_PStatStatRec1;
ArrayGlob_P2StatDynInt1 := ArrayGlob_PStatDynInt1;
ArrayGlob_P2StatDynClass1 := ArrayGlob_PStatDynClass1;
ArrayGlob_P2StatDynRec1 := ArrayGlob_PStatDynRec1;
ArrayClass1 := TArrayClass1.Create; ArrayClass1 := TArrayClass1.Create;
ArrayClass1.Test1Method( ArrayClass1.Test1Method(
ArrayGlob_DynAInt1, ArrayGlob_DynAInt1,
@ -1056,35 +1118,35 @@ begin
ArrayGlob_StatDynRec1, ArrayGlob_StatDynRec1,
// Pointer // Pointer
ArrayGlob_PDynAInt1, ArrayGlob_P2DynAInt1,
ArrayGlob_PStatAInt1, ArrayGlob_P2StatAInt1,
ArrayGlob_PStatAInt2, ArrayGlob_P2StatAInt2,
ArrayGlob_PDynInt1, ArrayGlob_P2DynInt1,
ArrayGlob_PDynInt2, ArrayGlob_P2DynInt2,
ArrayGlob_PDynClass1, ArrayGlob_P2DynClass1,
ArrayGlob_PDynRec1, ArrayGlob_P2DynRec1,
ArrayGlob_PDynRec2, ArrayGlob_P2DynRec2,
ArrayGlob_PDynDynInt1, ArrayGlob_P2DynDynInt1,
ArrayGlob_PDynDynClass1, ArrayGlob_P2DynDynClass1,
ArrayGlob_PDynDynRec1, ArrayGlob_P2DynDynRec1,
ArrayGlob_PDynStatInt1, ArrayGlob_P2DynStatInt1,
ArrayGlob_PDynStatClass1, ArrayGlob_P2DynStatClass1,
ArrayGlob_PDynStatRec1, ArrayGlob_P2DynStatRec1,
ArrayGlob_PStatInt1, ArrayGlob_P2StatInt1,
ArrayGlob_PStatClass1, ArrayGlob_P2StatClass1,
ArrayGlob_PStatRec1, ArrayGlob_P2StatRec1,
ArrayGlob_PStatStatInt1, ArrayGlob_P2StatStatInt1,
ArrayGlob_PStatStatClass1, ArrayGlob_P2StatStatClass1,
ArrayGlob_PStatStatRec1, ArrayGlob_P2StatStatRec1,
ArrayGlob_PStatDynInt1, ArrayGlob_P2StatDynInt1,
ArrayGlob_PStatDynClass1, ArrayGlob_P2StatDynClass1,
ArrayGlob_PStatDynRec1 ArrayGlob_P2StatDynRec1
); );
end; end;

View File

@ -14,7 +14,7 @@ const
BREAK_LINE_TestWatchesUnitSimple_2 = 189; BREAK_LINE_TestWatchesUnitSimple_2 = 189;
BREAK_LINE_TestWatchesUnitSimple_3 = 196; BREAK_LINE_TestWatchesUnitSimple_3 = 196;
BREAK_LINE_TestWatchesUnitArray = 808; BREAK_LINE_TestWatchesUnitArray = 838;
type type
@ -459,7 +459,7 @@ end;
procedure TTestWatches.AddExpectArray_1; procedure TTestWatches.AddExpectArray_1;
var var
i: Integer; i, i2: Integer;
s,s2: String; s,s2: String;
r: PWatchExpectation; r: PWatchExpectation;
begin begin
@ -472,131 +472,135 @@ begin
{%region Fields / Glob / ... } {%region Fields / Glob / ... }
for i := 0 to 4 do begin for i := 0 to 4 do begin
case i of case i of
0,5: s := 'Field_'; 0: s := 'Field_';
1,6: s := 'ArrayGlob_'; 1: s := 'ArrayGlob_';
2,7: s := 'Arg_'; 2: s := 'Arg_';
3,8: s := 'VArg_'; 3: s := 'VArg_';
4,9: s := 'Local_'; 4: s := 'Local_';
end; end;
s2 := '';
if i >= 5 then s2 := '^';
if i <> 2 then begin // open array / TODO r := AddFmtDef(Format('@%sDynInt1', [s]), 'replaceme', skPointer, '', [fTpMtch]);
AddFmtDef(Format('%sDynAInt1%1:s', [s,s2]), '^[\(L].*?100, 101, 102', skArray, '', [fTpMtch]); if i = 3 then UpdResMinFpc(r, stSymAll, 020600);
AddSimpleInt(Format('%sDynAInt1%1:s[0]', [s,s2]), 100, M_Int); r^.OnBeforeTest := @AdjustArrayExpectToAddress;
AddSimpleInt(Format('%sDynAInt1%1:s[1]', [s,s2]), 101, M_Int); r^.UserData := pointer(ptruint(Length(FCurrentExpect^)));
AddFmtDef(Format('%sDynAInt1%1:s[0][0]', [s,s2]), 'Error', skNone, '', [fTpMtch, IgnKind, fTExpectError]); // ERROR AddFmtDef(Format('%sPDynInt1', [s]), '\$[0-9A-F]', skPointer, '', [fTpMtch]);
r := AddFmtDef(Format('@%sStatInt1', [s]), 'replaceme', skPointer, '', [fTpMtch]);
if i = 3 then UpdResMinFpc(r, stSymAll, 020600);
r^.OnBeforeTest := @AdjustArrayExpectToAddress;
r^.UserData := pointer(ptruint(Length(FCurrentExpect^)));
AddFmtDef(Format('%sPStatInt1', [s]), '\$[0-9A-F]', skPointer, '', [fTpMtch]);
for i2 := 0 to 1 do begin
s2 := '';
if i2 = 1 then begin
s := s + 'P';
s2 := '^';
end;
if not (i in [2,3]) then begin // open array / TODO
AddFmtDef(Format('%sDynAInt1%1:s', [s,s2]), '^[\(L].*?100, 101, 102', skArray, '', [fTpMtch]);
AddSimpleInt(Format('%sDynAInt1%1:s[0]', [s,s2]), 100, M_Int);
AddSimpleInt(Format('%sDynAInt1%1:s[1]', [s,s2]), 101, M_Int);
AddFmtDef(Format('%sDynAInt1%1:s[0][0]', [s,s2]), 'Error', skNone, '', [fTpMtch, IgnKind, fTExpectError]); // ERROR
end; end;
AddFmtDef(Format('%sStatAInt1%1:s', [s,s2]), '^[\(L].*?6600, 6601, 6602', AddFmtDef(Format('%sStatAInt1%1:s', [s,s2]), '^[\(L].*?6600, 6601, 6602',
skArray, '', [fTpMtch]); skArray, '', [fTpMtch]);
AddSimpleInt(Format('%sStatAInt1%1:s[4]', [s,s2]), 6600, M_Int); AddSimpleInt(Format('%sStatAInt1%1:s[4]', [s,s2]), 6600, M_Int);
AddSimpleInt(Format('%sStatAInt1%1:s[9]', [s,s2]), 6699, M_Int); AddSimpleInt(Format('%sStatAInt1%1:s[9]', [s,s2]), 6699, M_Int);
AddFmtDef(Format('%sStatAInt1%1:s[3]', [s,s2]), '', skSimple, M_Int, [fTpMtch]); // Just do not crash AddFmtDef(Format('%sStatAInt1%1:s[3]', [s,s2]), '', skSimple, M_Int, [fTpMtch]); // Just do not crash
AddFmtDef(Format('%sStatAInt1%1:s[10]', [s,s2]), '', skSimple, M_Int, [fTpMtch]); // Just do not crash AddFmtDef(Format('%sStatAInt1%1:s[10]', [s,s2]), '', skSimple, M_Int, [fTpMtch]); // Just do not crash
AddFmtDef(Format('%sStatAInt1%1:s[-1]', [s,s2]), '', skSimple, M_Int, [fTpMtch]); // Just do not crash AddFmtDef(Format('%sStatAInt1%1:s[-1]', [s,s2]), '', skSimple, M_Int, [fTpMtch]); // Just do not crash
AddFmtDef(Format('%sStatAInt2%1:s', [s,s2]), '^[\(L].*?3300, 3301, 3302', AddFmtDef(Format('%sStatAInt2%1:s', [s,s2]), '^[\(L].*?3300, 3301, 3302',
skArray, '', [fTpMtch]); skArray, '', [fTpMtch]);
AddSimpleInt(Format('%sStatAInt2%1:s[-4]', [s,s2]), 3300, M_Int); AddSimpleInt(Format('%sStatAInt2%1:s[-4]', [s,s2]), 3300, M_Int);
AddSimpleInt(Format('%sStatAInt2%1:s[0]', [s,s2]), 3304, M_Int); AddSimpleInt(Format('%sStatAInt2%1:s[0]', [s,s2]), 3304, M_Int);
AddFmtDef(Format('%sDynInt2%1:s', [s,s2]), '^nil', skArray, '', [fTpMtch]); AddFmtDef(Format('%sDynInt2%1:s', [s,s2]), '^nil', skArray, '', [fTpMtch]);
r := AddFmtDef(Format('TArrayDynInt(%sDynInt2%1:s)', [s,s2]), '^nil', skArray, '', [fTpMtch]); r := AddFmtDef(Format('TArrayDynInt(%sDynInt2%1:s)', [s,s2]), '^nil', skArray, '', [fTpMtch]);
if i in [3] then UpdResMinFpc(r, stSymAll, 020600); if i in [3] then UpdResMinFpc(r, stSymAll, 020600);
r := AddSimpleInt(Format('QWord(%sDynInt2%1:s)', [s,s2]), 0, 'QWord'); r := AddSimpleInt(Format('QWord(%sDynInt2%1:s)', [s,s2]), 0, 'QWord');
if i in [3] then UpdResMinFpc(r, stSymAll, 020600); if i in [3] then UpdResMinFpc(r, stSymAll, 020600);
AddFmtDef(Format('%sDynInt1%1:s', [s,s2]), '^[\(L].*?5511, 5512, 5513, 5514, -5511', AddFmtDef(Format('%sDynInt1%1:s', [s,s2]), '^[\(L].*?5511, 5512, 5513, 5514, -5511',
skArray, '', [fTpMtch]); skArray, '', [fTpMtch]);
AddSimpleInt(Format('%sDynInt1%1:s[0]', [s,s2]), 5511, M_Int); AddSimpleInt(Format('%sDynInt1%1:s[0]', [s,s2]), 5511, M_Int);
AddSimpleInt(Format('%sDynInt1%1:s[19]', [s,s2]), 5500, M_Int); AddSimpleInt(Format('%sDynInt1%1:s[19]', [s,s2]), 5500, M_Int);
r := AddFmtDef(Format('TArrayDynInt(%sDynInt1%1:s)', [s,s2]), '^[\(L].*?5511, 5512, 5513, 5514, -5511', r := AddFmtDef(Format('TArrayDynInt(%sDynInt1%1:s)', [s,s2]), '^[\(L].*?5511, 5512, 5513, 5514, -5511',
skArray, '', [fTpMtch]); skArray, '', [fTpMtch]);
if i in [3] then UpdResMinFpc(r, stSymAll, 020600); if i in [3] then UpdResMinFpc(r, stSymAll, 020600);
r := AddSimpleInt(Format('TArrayDynInt(%sDynInt1%1:s)[0]', [s,s2]), 5511, M_Int); r := AddSimpleInt(Format('TArrayDynInt(%sDynInt1%1:s)[0]', [s,s2]), 5511, M_Int);
if i in [3] then UpdResMinFpc(r, stSymAll, 020600); if i in [3] then UpdResMinFpc(r, stSymAll, 020600);
AddFmtDef(Format('%sDynClass1%1:s', [s,s2]), '^[\(L].*?'+ AddFmtDef(Format('%sDynClass1%1:s', [s,s2]), '^[\(L].*?'+
'\(.*?Field_INT1 = 98700;.*?Field_INT2 = 98701;.*?Field_DYNAINT1 = \(9900, 9901\);.*?\), ' + '\(.*?Field_INT1 = 98700;.*?Field_INT2 = 98701;.*?Field_DYNAINT1 = \(9900, 9901\);.*?\), ' +
'\(.*?Field_INT1 = 88700;.*?Field_INT2 = 88701;.*?Field_DYNAINT1 = \(8900, 8901\);.*?\), ' + '\(.*?Field_INT1 = 88700;.*?Field_INT2 = 88701;.*?Field_DYNAINT1 = \(8900, 8901\);.*?\), ' +
'\(.*?Field_INT1 = 78700;.*?Field_INT2 = 78701;.*?Field_DYNAINT1 = \(7900, 7901, 7902\);.*?\)', '\(.*?Field_INT1 = 78700;.*?Field_INT2 = 78701;.*?Field_DYNAINT1 = \(7900, 7901, 7902\);.*?\)',
skArray, '', [fTpMtch]); skArray, '', [fTpMtch]);
AddFmtDef(Format('%sDynClass1%1:s[0]', [s,s2]), AddFmtDef(Format('%sDynClass1%1:s[0]', [s,s2]),
'\(.*?Field_INT1 = 98700;.*?Field_INT2 = 98701;.*?Field_DYNAINT1 = \(9900, 9901\);.*?\), ', '\(.*?Field_INT1 = 98700;.*?Field_INT2 = 98701;.*?Field_DYNAINT1 = \(9900, 9901\);.*?\), ',
skClass, 'TArrayClass1', [fTpMtch]); skClass, 'TArrayClass1', [fTpMtch]);
AddFmtDef(Format('%sDynClass1%1:s[1]', [s,s2]), AddFmtDef(Format('%sDynClass1%1:s[1]', [s,s2]),
'\(.*?Field_INT1 = 88700;.*?Field_INT2 = 88701;.*?Field_DYNAINT1 = \(8900, 8901\);.*?\), ', '\(.*?Field_INT1 = 88700;.*?Field_INT2 = 88701;.*?Field_DYNAINT1 = \(8900, 8901\);.*?\), ',
skClass, 'TArrayClass1', [fTpMtch]); skClass, 'TArrayClass1', [fTpMtch]);
AddSimpleInt(Format('%sDynClass1%1:s[0].Field_INT1', [s,s2]), 98700, M_Int); AddSimpleInt(Format('%sDynClass1%1:s[0].Field_INT1', [s,s2]), 98700, M_Int);
AddFmtDef(Format('%sDynRec1%1:s', [s,s2]), '^[\(L].*?'+ AddFmtDef(Format('%sDynRec1%1:s', [s,s2]), '^[\(L].*?'+
'\(.*?FieldINT1 = 200;.*?FieldINT2 = 201;.*?\), ' + '\(.*?FieldINT1 = 200;.*?FieldINT2 = 201;.*?\), ' +
'\(.*?FieldINT1 = 210;.*?FieldINT2 = 211;.*?\), ' + '\(.*?FieldINT1 = 210;.*?FieldINT2 = 211;.*?\), ' +
'\(.*?FieldINT1 = 220;.*?FieldINT2 = 221;.*?\)', '\(.*?FieldINT1 = 220;.*?FieldINT2 = 221;.*?\)',
skArray, '', [fTpMtch]); skArray, '', [fTpMtch]);
if i <> 2 then // open array / TODO if not (i in [2,3]) then // open array / TODO
AddFmtDef(Format('%sDynRec2%1:s', [s,s2]), '^[\(L].*?'+ AddFmtDef(Format('%sDynRec2%1:s', [s,s2]), '^[\(L].*?'+
'\(.*?FieldByte1 = 200;.*?FieldByte2 = 201;.*?\), ' + '\(.*?FieldByte1 = 200;.*?FieldByte2 = 201;.*?\), ' +
'\(.*?FieldByte1 = 210;.*?FieldByte2 = 211;.*?\), ' + '\(.*?FieldByte1 = 210;.*?FieldByte2 = 211;.*?\), ' +
'\(.*?FieldByte1 = 220;.*?FieldByte2 = 221;.*?\)', '\(.*?FieldByte1 = 220;.*?FieldByte2 = 221;.*?\)',
skArray, '', [fTpMtch]); skArray, '', [fTpMtch]);
AddFmtDef(Format('%sDynDynInt1%1:s', [s,s2]), '^[\(L].*?'+ AddFmtDef(Format('%sDynDynInt1%1:s', [s,s2]), '^[\(L].*?'+
'\(1000, 1001, 1002\), ' + '\(1010, 1011, 1012\), ' + '\(1020, 1021, 1022\)', '\(1000, 1001, 1002\), ' + '\(1010, 1011, 1012\), ' + '\(1020, 1021, 1022\)',
skArray, '', [fTpMtch]); skArray, '', [fTpMtch]);
AddSimpleInt(Format('%sDynDynInt1%1:s[0][0]', [s,s2]), 1000, M_Int); AddSimpleInt(Format('%sDynDynInt1%1:s[0][0]', [s,s2]), 1000, M_Int);
AddSimpleInt(Format('%sDynDynInt1%1:s[0,0]', [s,s2]), 1000, M_Int); AddSimpleInt(Format('%sDynDynInt1%1:s[0,0]', [s,s2]), 1000, M_Int);
AddSimpleInt(Format('%0:sDynDynInt1%1:s[%0:sDynDynInt1%1:s[3,0], %0:sDynDynInt1%1:s[3,1]]', [s,s2]), 1012, M_Int); AddSimpleInt(Format('%0:sDynDynInt1%1:s[%0:sDynDynInt1%1:s[3,0], %0:sDynDynInt1%1:s[3,1]]', [s,s2]), 1012, M_Int);
AddSimpleInt(Format('%0:sDynDynInt1%1:s[%0:sDynDynInt1%1:s[3,0]][%0:sDynDynInt1%1:s[3,1]]', [s,s2]), 1012, M_Int); AddSimpleInt(Format('%0:sDynDynInt1%1:s[%0:sDynDynInt1%1:s[3,0]][%0:sDynDynInt1%1:s[3,1]]', [s,s2]), 1012, M_Int);
//AddFmtDef(Format('%0:sDynDynInt1%1:s[%0:sDynDynInt1%1:s[3,0].NoMember, %0:sDynDynInt1%1:s[3,1]]', [s,s2]), 'Error', skNone, '', [fTpMtch, IgnKind, fTExpectError]); // ERROR //AddFmtDef(Format('%0:sDynDynInt1%1:s[%0:sDynDynInt1%1:s[3,0].NoMember, %0:sDynDynInt1%1:s[3,1]]', [s,s2]), 'Error', skNone, '', [fTpMtch, IgnKind, fTExpectError]); // ERROR
AddFmtDef(Format('%sDynDynClass1%1:s', [s,s2]), '^[^\(G]*?\('+ // not GDB: AddFmtDef(Format('%sDynDynClass1%1:s', [s,s2]), '^[^\(G]*?\('+ // not GDB:
'\(\(.*?Field_INT1 = 5000;.*?\), \(.*?Field_INT1 = 5001;.*?\)\), ' + '\(\(.*?Field_INT1 = 5000;.*?\), \(.*?Field_INT1 = 5001;.*?\)\), ' +
'\(nil, \(.*?Field_INT1 = 5011;.*?\)\), ' + '\(nil, \(.*?Field_INT1 = 5011;.*?\)\), ' +
'\(nil, nil\)', '\(nil, nil\)',
skArray, '', [fTpMtch]); skArray, '', [fTpMtch]);
//// ////
AddFmtDef(Format('%sStatStatInt1%1:s', [s,s2]), '^[\(L].*?'+ AddFmtDef(Format('%sStatStatInt1%1:s', [s,s2]), '^[\(L].*?'+
'\(4091, 4092, 4093\), ' + '\(4081, 4082, 4083\), ' + '\(4071, 4072, 4073\), ', '\(4091, 4092, 4093\), ' + '\(4081, 4082, 4083\), ' + '\(4071, 4072, 4073\), ',
skArray, '', [fTpMtch]); skArray, '', [fTpMtch]);
AddSimpleInt(Format('%sStatStatInt1%1:s[-9,1]', [s,s2]), 4091, M_Int); AddSimpleInt(Format('%sStatStatInt1%1:s[-9,1]', [s,s2]), 4091, M_Int);
r := AddFmtDef(Format('TArrayStatStatInt(%sStatStatInt1%1:s)', [s,s2]), '^[\(L].*?'+ r := AddFmtDef(Format('TArrayStatStatInt(%sStatStatInt1%1:s)', [s,s2]), '^[\(L].*?'+
'\(4091, 4092, 4093\), ' + '\(4081, 4082, 4083\), ' + '\(4071, 4072, 4073\), ', '\(4091, 4092, 4093\), ' + '\(4081, 4082, 4083\), ' + '\(4071, 4072, 4073\), ',
skArray, '', [fTpMtch]); skArray, '', [fTpMtch]);
if i in [3] then UpdResMinFpc(r, stSymAll, 020600); if i in [3] then UpdResMinFpc(r, stSymAll, 020600);
r := AddSimpleInt(Format('TArrayStatStatInt(%sStatStatInt1%1:s)[-9,1]', [s,s2]), 4091, M_Int); r := AddSimpleInt(Format('TArrayStatStatInt(%sStatStatInt1%1:s)[-9,1]', [s,s2]), 4091, M_Int);
if i in [3] then UpdResMinFpc(r, stSymAll, 020600); if i in [3] then UpdResMinFpc(r, stSymAll, 020600);
end; // i2
if i in [0..4] then begin end; // i
r := AddFmtDef(Format('@%sDynInt1', [s]), 'replaceme', skPointer, '', [fTpMtch]);
if i = 3 then UpdResMinFpc(r, stSymAll, 020600);
r^.OnBeforeTest := @AdjustArrayExpectToAddress;
r^.UserData := pointer(ptruint(Length(FCurrentExpect^)));
AddFmtDef(Format('%sPDynInt1', [s]), '\$[0-9A-F]', skPointer, '', [fTpMtch]);
r := AddFmtDef(Format('@%sStatInt1', [s]), 'replaceme', skPointer, '', [fTpMtch]);
if i = 3 then UpdResMinFpc(r, stSymAll, 020600);
r^.OnBeforeTest := @AdjustArrayExpectToAddress;
r^.UserData := pointer(ptruint(Length(FCurrentExpect^)));
AddFmtDef(Format('%sPStatInt1', [s]), '\$[0-9A-F]', skPointer, '', [fTpMtch]);
end;
end;
{%endregion Fields } {%endregion Fields }
end; end;