FpDebug: test watches for Pointer

git-svn-id: trunk@61754 -
This commit is contained in:
martin 2019-08-24 20:39:56 +00:00
parent 280666f480
commit b8f6c44020
3 changed files with 13 additions and 1 deletions

View File

@ -629,6 +629,9 @@ procedure TTestWatches.TestWatchesValue;
//t.Add(p+'Comp_2'+e, weFloat(-150.125+n, 'Comp' ));
t.Add(AName, p+'Currency_2'+e, weFloat(-125.123+n, 'Currency' ))^.AddFlag([ehNotImplementedData]);
t.Add(AName, p+'Ptr1'+e, wePointerAddr(nil, 'Pointer'));
t.Add(AName, p+'Ptr2'+e, wePointerAddr(Pointer(1000+n), 'Pointer'));
t.Add(AName, p+'Char'+e, weChar(AChr1));
t.Add(AName, p+'Char2'+e, weChar(#0));
t.Add(AName, p+'Char3'+e, weChar(' '));
@ -950,7 +953,10 @@ begin
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'
t.Add( 'TClass1', weMatch('type class\(TObject\).*FInt: (integer|longint).*end', skType)).AddFlag(ehNoTypeInfo);
t.Add( 'TClass1', weMatch('type class\(TObject\).*_vptr\$TOBJECT: *Pointer.*end', skType)).AddFlag(ehNoTypeInfo);
t.Add( 'TFunc1', weMatch('type function *\(SomeValue.*\) *: *Boolean', skType)).AddFlag(ehNoTypeInfo);
t.Add( 'TIntStatArray', weMatch('type array *\[1\.\.5\] *of (integer|longint)', skType)).AddFlag(ehNoTypeInfo);
t.Add( 'TIntDynArray', weMatch('type array of (integer|longint)', skType)).AddFlag(ehNoTypeInfo);

View File

@ -42,6 +42,9 @@
//pre__Comp_2{e} _OP_ Comp (-150.125 + ADD); //@@ //_pre3_Comp_2;
pre__Currency_2{e} _OP_ Currency (-125.123 + ADD); //@@ _pre3_Currency_2;
pre__Ptr1{e} _OP_ Pointer (0 ); //@@ _pre3_Ptr1;
pre__Ptr2{e} _OP_ Pointer (1000 + ADD); //@@ _pre3_Ptr2;
// **** Char and String types ****
pre__Char{e} _OP_ char (CHR1 ); //@@ _pre3_Char;

View File

@ -1448,7 +1448,10 @@ begin
Result := True;
Expect := AContext.Expectation;
e := '\$0*'+IntToHex(PtrUInt(Expect.ExpPointerValue), 8);
if Expect.ExpPointerValue = nil then
e := 'nil'
else
e := '\$0*'+IntToHex(PtrUInt(Expect.ExpPointerValue), 8);
if Expect.ExpTypeName <> '' then
e := Expect.ExpTypeName+'\('+e+'\)';
e := '^'+e;