mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 15:57:18 +01:00
FpDebug: error checks
git-svn-id: trunk@44929 -
This commit is contained in:
parent
04283997b4
commit
6a9ea0f2ff
@ -57,6 +57,7 @@ type
|
||||
FExpressionPart: TFpPascalExpressionPart;
|
||||
FValid: Boolean;
|
||||
function GetResultValue: TFpDbgValue;
|
||||
function GetValid: Boolean;
|
||||
procedure Parse;
|
||||
procedure SetError(AMsg: String); // deprecated;
|
||||
procedure SetError(AnErrorCode: TFpErrorCode; AData: array of const);
|
||||
@ -71,7 +72,7 @@ type
|
||||
function DebugDump(AWithResults: Boolean = False): String;
|
||||
procedure ResetEvaluation;
|
||||
property Error: TFpError read FError;
|
||||
property Valid: Boolean read FValid;
|
||||
property Valid: Boolean read GetValid;
|
||||
// Set by GetResultValue
|
||||
property HasPCharIndexAccess: Boolean read FHasPCharIndexAccess;
|
||||
// handle pchar as string (adjust index)
|
||||
@ -1689,8 +1690,16 @@ function TFpPascalExpression.GetResultValue: TFpDbgValue;
|
||||
begin
|
||||
if (FExpressionPart = nil) or (not Valid) then
|
||||
Result := nil
|
||||
else
|
||||
else begin
|
||||
Result := FExpressionPart.ResultValue;
|
||||
if (Result = nil) and (not IsError(FError)) then
|
||||
SetError(fpErrAnyError, ['Internal eval error']);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFpPascalExpression.GetValid: Boolean;
|
||||
begin
|
||||
Result := FValid and (not IsError(FError));
|
||||
end;
|
||||
|
||||
procedure TFpPascalExpression.SetError(AMsg: String);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user