diff --git a/components/fpdebug/fpdbgdwarf.pas b/components/fpdebug/fpdbgdwarf.pas index 44904e55a8..0b2b28f029 100644 --- a/components/fpdebug/fpdbgdwarf.pas +++ b/components/fpdebug/fpdbgdwarf.pas @@ -1941,8 +1941,10 @@ begin end; Include(FEvaluated, doneUInt); - if (FSize <= 0) or (FSize > SizeOf(Result)) then - Result := inherited GetAsCardinal + if (FSize <= 0) or (FSize > SizeOf(Result)) then begin + Result := 0; + FLastError := CreateError(fpErrorBadFloatSize); + end else if not MemManager.ReadFloat(OrdOrDataAddr, FSize, Result) then begin Result := 0; // TODO: error diff --git a/components/fpdebug/fperrormessages.pas b/components/fpdebug/fperrormessages.pas index f7571828b7..155513135b 100644 --- a/components/fpdebug/fperrormessages.pas +++ b/components/fpdebug/fperrormessages.pas @@ -16,6 +16,7 @@ resourcestring MsgfpErrSymbolNotFound = 'Identifier not found: "%1:s"'; MsgfpErrNoMemberWithName = 'Member not found: %1:s'; MsgfpErrorNotAStructure = 'Cannot get member "%1:s" from none structure type: %2:s'; + MsgfpErrorBadFloatSize = 'Unsupported float value: Unknown precission'; MsgfpErrPasParserInvalidExpression = 'Invalid Expression'; MsgfpErrPasParserUnexpectedToken = 'Unexpected token ''%1:s'' at pos %2:d'; @@ -42,6 +43,7 @@ const fpErrSymbolNotFound = TFpErrorCode(2); fpErrNoMemberWithName = TFpErrorCode(3); fpErrorNotAStructure = TFpErrorCode(4); + fpErrorBadFloatSize = TFpErrorCode(5); fpErrPasParserInvalidExpression = TFpErrorCode(24); fpErrPasParserUnexpectedToken = TFpErrorCode(25); @@ -175,7 +177,8 @@ begin fpErrAnyError: Result := MsgfpErrAnyError; fpErrSymbolNotFound: Result := MsgfpErrSymbolNotFound; fpErrNoMemberWithName: Result := MsgfpErrNoMemberWithName; - fpErrorNotAStructure: Result := MsgfpErrorNotAStructure; + fpErrorNotAStructure: Result := MsgfpErrorNotAStructure; + fpErrorBadFloatSize: Result := MsgfpErrorBadFloatSize; fpErrPasParserInvalidExpression: Result := MsgfpErrPasParserInvalidExpression; fpErrPasParserUnexpectedToken: Result := MsgfpErrPasParserUnexpectedToken;