FPDebug: more Value handling / pointers

git-svn-id: trunk@43886 -
This commit is contained in:
martin 2014-02-05 02:30:45 +00:00
parent 3ab0ac8feb
commit 64b56efefb
3 changed files with 19 additions and 5 deletions

View File

@ -1918,6 +1918,9 @@ end;
function TDbgDwarfNumericSymbolValue.CanUseTypeCastAddress: Boolean;
begin
Result := True;
if (FTypeCastSource.FieldFlags * [svfAddress, svfSize, svfSizeOfPointer] = [svfAddress]) then
exit
else
if (FTypeCastSource.FieldFlags * [svfAddress, svfSize] = [svfAddress, svfSize]) and
(FTypeCastSource.Size = FSize)
then

View File

@ -590,7 +590,7 @@ begin
FSigned := ASigned;
end;
{ TPasParserTypeCastSymbolValue }
{ TPasParserWrapperSymbolValue }
function TPasParserWrapperSymbolValue.GetKind: TDbgSymbolKind;
begin
@ -1698,13 +1698,17 @@ begin
else
if tmp.Kind = skPointer then begin
if (svfDataAddress in tmp.FieldFlags) and (tmp.DataAddress <> 0) and
(tmp.TypeInfo <> nil) and (tmp.TypeInfo.TypeInfo <> nil)
(tmp.TypeInfo <> nil) //and (tmp.TypeInfo.TypeInfo <> nil)
then begin
//TODO: maybe introduce a method TypeCastFromAddress, so we can skip the twp2 object
tmp2 := TPasParserDerefPointerSymbolValue.Create(tmp);
Result := tmp.TypeInfo.TypeInfo.TypeCastValue(tmp2);
if (tmp.TypeInfo.TypeInfo <> nil) then
Result := tmp.TypeInfo.TypeInfo.TypeCastValue(tmp2)
else
Result := tmp2;
{$IFDEF WITH_REFCOUNT_DEBUG} if Result <> nil then Result.DbgRenameReference(nil, 'DoGetResultValue'){$ENDIF};
tmp2.ReleaseReference;
if (tmp.TypeInfo.TypeInfo <> nil) then
tmp2.ReleaseReference;
end;
end
//if tmp.Kind = skArray then // dynarray

View File

@ -427,7 +427,14 @@ begin
ExpResult(svfInteger, -299);
ExpFlags([svfInteger, svfOrdinal, svfAddress], [svfDataAddress]); // svfSize;
// TODO Integer(pointer(pi)^)
StartTest('LongInt(pointer(pi)^)', skInteger, [ttHasType]);
ExpResult(svfInteger, -299);
ExpFlags([svfInteger, svfOrdinal, svfAddress], [svfDataAddress]); // svfSize;
StartTest('LongInt(GlobTestSetup1Pointer^)', skInteger, [ttHasType]);
ExpResult(svfInteger, -299);
ExpFlags([svfInteger, svfOrdinal, svfAddress], [svfDataAddress]); // svfSize;
///////////////////////////
finally