FpDebug: tests

This commit is contained in:
Martin 2022-06-12 00:11:33 +02:00
parent 0b051af509
commit 1328b8a1ab
3 changed files with 18 additions and 5 deletions

View File

@ -986,7 +986,7 @@ StartIdxClassConst := t.Count;
t.Add(AName, p+'Enum16A'+e, weEnum('ExValX5', 'TEnum16'));
t.Add(AName, p+'Set'+e, weSet(['EnVal2', 'EnVal4'], 'TSet')).Skip([stDwarf]);
t.Add(AName, p+'Set2'+e, weSet(['EnVal1', 'EnVal4'], '{set}')).Skip([stDwarf])
t.Add(AName, p+'Set2'+e, weSet(['EnVal1', 'EnVal4'])).Skip([stDwarf])
.SkipIf(ALoc = tlParam).SkipIf(ALoc = tlPointer);
t.Add(AName, p+'Set4'+e, weSet(['E4Val02', 'E4Val0A'], 'TSet4')).Skip([stDwarf]);
@ -997,7 +997,7 @@ StartIdxClassConst := t.Count;
t.Add(AName, p+'SmallSet'+e, weSet(['22', '24', '25'], 'TSmallRangeSet')).Skip([stDwarf])
.SkipIf(ALoc = tlParam).SkipIf(ALoc = tlPointer);
t.Add(AName, p+'SmallSet2'+e, weSet(['21', '24', '25'], '{set}')).Skip([stDwarf])
t.Add(AName, p+'SmallSet2'+e, weSet(['21', '24', '25'])).Skip([stDwarf])
.SkipIf(ALoc = tlParam).SkipIf(ALoc = tlPointer);
@ -1212,8 +1212,8 @@ begin
t.Add('SomeFunc1', weMatch('^function *\(SOMEVALUE, Foo: LONGINT; Bar: Word; x: Byte\): *BOOLEAN *AT *\$[0-9A-F]+', skFunction) );
t.Add('SomeProc1', weMatch('^procedure *\(\) *AT *\$[0-9A-F]+', skProcedure) );
t.Add('@SomeFunc1', weMatch('^\^function.*\(\$[0-9A-F]+\)'{' = SomeFunc1'}, skPointer {skFunctionRef}) );
t.Add('@SomeProc1', weMatch('^\^procedure.*\(\$[0-9A-F]+\)'{' = SomeFunc1'}, skPointer {skProcedureRef}) );
t.Add('@SomeFunc1', weMatch('\^.*function.*\$[0-9A-F]+'{' = SomeFunc1'}, skPointer {skFunctionRef}) );
t.Add('@SomeProc1', weMatch('\^.*procedure.*\$[0-9A-F]+'{' = SomeFunc1'}, skPointer {skProcedureRef}) );
// TODO: TClass1 must not contain "<unknown>"
// ' _vptr$TOBJECT: Pointer'
@ -1352,6 +1352,12 @@ if Compiler.Version < 030300 then
t.EvaluateWatches;
t.CheckResults;
// Pointer(1)
// Do not check values. // Just ensure no crash occurs
AddWatches(t, 'glop bad pointer - no crash', 'gvpX_', 001, 'B');
AddWatches(t, 'glob MyClassBadMemc - no crash', 'MyClassBadMem.mc', 001, 'c');
t.EvaluateWatches;
RunToPause(BrkFooBegin);
t.Clear;

View File

@ -447,7 +447,7 @@ type
PMyTestRec = ^TMyTestRec;
var
MyClass1: TMyClass;
MyClass1, MyClassBadMem: TMyClass;
MyNilClass1: TMyClass;
MyClass2: TMyBaseClass; (* LOCATION: field, requires typecast of containing class *)
MyPClass1: PMyClass;
@ -503,6 +503,10 @@ var
// gvp2_Byte: ^Byte; // gvp2_Byte := @gvaByte[1];
TEST_PREPOCESS(WatchesValuePrgIdent.inc, pre__=gvp2_, "_OP_=: ^", (=;//, "_O2_=: ^", _EQ_=, _BLOCK_=TestVar, _BLOCK2_=TestPointer )
(* LOCATION: global var pointer <each type> *) // unreadable mem
// gvpX_Byte: $00000001;
TEST_PREPOCESS(WatchesValuePrgIdent.inc, pre__=gvpX_, "_OP_=: ^", (=;//, "_O2_=: ^", _EQ_=, _BLOCK_=TestVar, _BLOCK2_=TestPointer )
(* LOCATION: global var TYPE alias // NO PRE-ASSIGNED VALUE *)
// gvp_Byte: PxByte;
TEST_PREPOCESS(WatchesValuePrgIdent.inc, pre__=gvpt_, "_OP_={", "_O2_={", "//@@=} :", _pre3_=Px, _BLOCK_=TestVar, _BLOCK2_=TestPointer ) // }
@ -964,6 +968,8 @@ begin
TEST_PREPOCESS(WatchesValuePrgIdent.inc,pre__=MyClass1.mbc, ADD=3, CHR1='D', _OP_=:=, _O2_={, _EQ_=}:=, _pre2_=gc, _BLOCK_=TestAssign)
TEST_PREPOCESS(WatchesValuePrgIdent.inc,pre__=MyClass1.mc, ADD=2, CHR1='C', _OP_=:=, _O2_={, _EQ_=}:=, _pre2_=gc, _BLOCK_=TestAssign)
MyClassBadMem := TMyClass(Pointer(1));
MyNilClass1 := nil;
(* INIT: field in class / baseclass // typecast *)
@ -1018,6 +1024,7 @@ begin
TEST_PREPOCESS(WatchesValuePrgIdent.inc,pre__=gvp_, _OP_={, _O2_={, _pre3_=@gv, "//@@=} :=", _BLOCK_=TestVar, _BLOCK2_=TestPointer) //}
TEST_PREPOCESS(WatchesValuePrgIdent.inc,pre__=gvp2_, _OP_={, _O2_={, _pre3_=@gva, "//@@=} :=", {e3}=[1], _BLOCK_=TestVar, _BLOCK2_=TestPointer) //}
TEST_PREPOCESS(WatchesValuePrgIdent.inc,pre__=gvpX_, _OP_={, _O2_={, "_pre3_=Pointer(1); //", "//@@=} :=", _BLOCK_=TestVar, _BLOCK2_=TestPointer) //}
RecursePtrA1 := @RecursePtrA2;
RecursePtrA2 := @RecursePtrA1;