mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-24 04:39:29 +01:00
FpDebug: added nil,true,false
git-svn-id: trunk@44881 -
This commit is contained in:
parent
e645bd4e95
commit
a8caa85052
@ -266,6 +266,7 @@ type
|
|||||||
function GetKind: TDbgSymbolKind; override;
|
function GetKind: TDbgSymbolKind; override;
|
||||||
function GetFieldFlags: TFpDbgValueFieldFlags; override;
|
function GetFieldFlags: TFpDbgValueFieldFlags; override;
|
||||||
function GetAsBool: Boolean; override;
|
function GetAsBool: Boolean; override;
|
||||||
|
function GetAsCardinal: QWord; override;
|
||||||
public
|
public
|
||||||
constructor Create(AValue: Boolean);
|
constructor Create(AValue: Boolean);
|
||||||
end;
|
end;
|
||||||
@ -795,7 +796,7 @@ end;
|
|||||||
|
|
||||||
function TFpDbgValueConstBool.GetFieldFlags: TFpDbgValueFieldFlags;
|
function TFpDbgValueConstBool.GetFieldFlags: TFpDbgValueFieldFlags;
|
||||||
begin
|
begin
|
||||||
Result := [{svfOrdinal, }svfBoolean];
|
Result := [svfOrdinal, svfBoolean];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFpDbgValueConstBool.GetAsBool: Boolean;
|
function TFpDbgValueConstBool.GetAsBool: Boolean;
|
||||||
@ -803,6 +804,14 @@ begin
|
|||||||
Result := FValue;
|
Result := FValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TFpDbgValueConstBool.GetAsCardinal: QWord;
|
||||||
|
begin
|
||||||
|
if FValue then
|
||||||
|
Result := 1
|
||||||
|
else
|
||||||
|
Result := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TFpDbgValueConstBool.Create(AValue: Boolean);
|
constructor TFpDbgValueConstBool.Create(AValue: Boolean);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|||||||
@ -1357,14 +1357,38 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TFpPascalExpressionPartIdentifer.DoGetResultValue: TFpDbgValue;
|
function TFpPascalExpressionPartIdentifer.DoGetResultValue: TFpDbgValue;
|
||||||
|
var
|
||||||
|
s: String;
|
||||||
|
tmp: TFpDbgValueConstAddress;
|
||||||
begin
|
begin
|
||||||
Result := FExpression.GetDbgSymbolForIdentifier(GetText);
|
s := GetText;
|
||||||
|
Result := FExpression.GetDbgSymbolForIdentifier(s);
|
||||||
if Result = nil then begin
|
if Result = nil then begin
|
||||||
SetError(fpErrSymbolNotFound, [GetText]);
|
s := LowerCase(s);
|
||||||
exit;
|
if s = 'nil' then begin
|
||||||
end;
|
tmp := TFpDbgValueConstAddress.Create(NilLoc);
|
||||||
|
Result := TFpPasParserValueAddressOf.Create(tmp, Expression.Context);
|
||||||
|
tmp.ReleaseReference;
|
||||||
|
{$IFDEF WITH_REFCOUNT_DEBUG}Result.DbgRenameReference(nil, 'DoGetResultValue');{$ENDIF}
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if s = 'true' then begin
|
||||||
|
Result := TFpDbgValueConstBool.Create(True);
|
||||||
|
{$IFDEF WITH_REFCOUNT_DEBUG}Result.DbgRenameReference(nil, 'DoGetResultValue');{$ENDIF}
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if s = 'false' then begin
|
||||||
|
Result := TFpDbgValueConstBool.Create(False);
|
||||||
|
{$IFDEF WITH_REFCOUNT_DEBUG}Result.DbgRenameReference(nil, 'DoGetResultValue');{$ENDIF}
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
SetError(fpErrSymbolNotFound, [GetText]);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
|
||||||
Result.AddReference{$IFDEF WITH_REFCOUNT_DEBUG}(nil, 'DoGetResultValue'){$ENDIF};
|
else
|
||||||
|
Result.AddReference{$IFDEF WITH_REFCOUNT_DEBUG}(nil, 'DoGetResultValue'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetFirstToken(AText: PChar): String;
|
function GetFirstToken(AText: PChar): String;
|
||||||
@ -1530,12 +1554,18 @@ var
|
|||||||
if (TokenEndPtr^ = DecimalSeparator) and (TokenEndPtr[1] <> '.') then begin
|
if (TokenEndPtr^ = DecimalSeparator) and (TokenEndPtr[1] <> '.') then begin
|
||||||
inc(TokenEndPtr);
|
inc(TokenEndPtr);
|
||||||
while TokenEndPtr^ in ['0'..'9'] do inc(TokenEndPtr);
|
while TokenEndPtr^ in ['0'..'9'] do inc(TokenEndPtr);
|
||||||
AddPart(TFpPascalExpressionPartConstantNumberFloat);
|
if TokenEndPtr^ in ['a'..'z', 'A'..'Z', '_'] then
|
||||||
|
SetError(fpErrPasParserUnexpectedToken, [GetFirstToken(CurPtr), PosFromPChar(CurPtr)])
|
||||||
|
else
|
||||||
|
AddPart(TFpPascalExpressionPartConstantNumberFloat);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
AddPart(TFpPascalExpressionPartConstantNumber);
|
if TokenEndPtr^ in ['a'..'z', 'A'..'Z', '_'] then
|
||||||
|
SetError(fpErrPasParserUnexpectedToken, [GetFirstToken(CurPtr), PosFromPChar(CurPtr)])
|
||||||
|
else
|
||||||
|
AddPart(TFpPascalExpressionPartConstantNumber);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure HandleComma;
|
procedure HandleComma;
|
||||||
@ -1720,6 +1750,7 @@ begin
|
|||||||
if FResultValDone then
|
if FResultValDone then
|
||||||
exit;
|
exit;
|
||||||
FResultValue := DoGetResultValue;
|
FResultValue := DoGetResultValue;
|
||||||
|
{$IFDEF WITH_REFCOUNT_DEBUG}FResultValue.DbgRenameReference(nil, 'DoGetResultValue', @FResultValue, 'DoGetResultValue');{$ENDIF}
|
||||||
FResultValDone := True;
|
FResultValDone := True;
|
||||||
Result := FResultValue;
|
Result := FResultValue;
|
||||||
end;
|
end;
|
||||||
@ -1866,7 +1897,7 @@ destructor TFpPascalExpressionPart.Destroy;
|
|||||||
begin
|
begin
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
//FResultType.ReleaseReference{$IFDEF WITH_REFCOUNT_DEBUG}(nil, 'DoGetResultType'){$ENDIF};
|
//FResultType.ReleaseReference{$IFDEF WITH_REFCOUNT_DEBUG}(nil, 'DoGetResultType'){$ENDIF};
|
||||||
FResultValue.ReleaseReference{$IFDEF WITH_REFCOUNT_DEBUG}(nil, 'DoGetResultValue'){$ENDIF};
|
FResultValue.ReleaseReference{$IFDEF WITH_REFCOUNT_DEBUG}(@FResultValue, 'DoGetResultValue'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFpPascalExpressionPart.HandleNextPart(APart: TFpPascalExpressionPart): TFpPascalExpressionPart;
|
function TFpPascalExpressionPart.HandleNextPart(APart: TFpPascalExpressionPart): TFpPascalExpressionPart;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user