mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 03:59:12 +02:00
FpDebug: Allow MemManage read extended to other float types. Fixed test for new soft fpu extended
This commit is contained in:
parent
35b94fb26f
commit
4d88956173
@ -1494,11 +1494,6 @@ begin
|
|||||||
rdtEnum, rdtSet: ;
|
rdtEnum, rdtSet: ;
|
||||||
rdtfloat:
|
rdtfloat:
|
||||||
Result := IsByteSize(AConvData.SourceSize) and
|
Result := IsByteSize(AConvData.SourceSize) and
|
||||||
( (AConvData.SourceFullSize = AConvData.DestSize) or
|
|
||||||
( (AConvData.SourceFullSize = SizeOf(Real48)) and
|
|
||||||
(AConvData.SourceSize.Size = SizeOf(Double))
|
|
||||||
)
|
|
||||||
) and
|
|
||||||
( (AConvData.SourceSize.Size = DBG_EXTENDED_SIZE) or
|
( (AConvData.SourceSize.Size = DBG_EXTENDED_SIZE) or
|
||||||
(AConvData.SourceSize.Size = SizeOf(Extended)) or
|
(AConvData.SourceSize.Size = SizeOf(Extended)) or
|
||||||
(AConvData.SourceSize.Size = SizeOf(Double)) or
|
(AConvData.SourceSize.Size = SizeOf(Double)) or
|
||||||
|
@ -6,8 +6,8 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
FpDbgDwarf, FpDbgUtil, FpdMemoryTools, FpDbgInfo, TestHelperClasses,
|
FpDbgDwarf, FpDbgUtil, FpdMemoryTools, FpDbgInfo, TestHelperClasses,
|
||||||
{$ifdef FORCE_LAZLOGGER_DUMMY} LazLoggerDummy {$else} LazLoggerBase {$endif}, LazUTF8, LazClasses, DbgIntfBaseTypes, sysutils, fpcunit,
|
{$ifdef FORCE_LAZLOGGER_DUMMY} LazLoggerDummy {$else} LazLoggerBase {$ENDIF}, LazUTF8, LazClasses,
|
||||||
testregistry;
|
DbgIntfBaseTypes, LazDebuggerIntfFloatTypes, sysutils, fpcunit, testregistry;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ var
|
|||||||
i, j: Integer;
|
i, j: Integer;
|
||||||
TestBaseName: String;
|
TestBaseName: String;
|
||||||
Data: QWord;
|
Data: QWord;
|
||||||
DataExt: Extended;
|
DataExt: TDbgExtended;
|
||||||
DataDouble: Double;
|
DataDouble: Double;
|
||||||
DataSingle: Single;
|
DataSingle: Single;
|
||||||
MemValue: QWord;
|
MemValue: QWord;
|
||||||
@ -77,7 +77,7 @@ var
|
|||||||
GotInt: Int64;
|
GotInt: Int64;
|
||||||
GotUInt: QWord;
|
GotUInt: QWord;
|
||||||
GotAddr: TFpDbgMemLocation;
|
GotAddr: TFpDbgMemLocation;
|
||||||
GotExt: Extended;
|
GotExt: TDbgExtended;
|
||||||
|
|
||||||
|
|
||||||
procedure SetData(Aval: QWord);
|
procedure SetData(Aval: QWord);
|
||||||
@ -254,24 +254,24 @@ begin
|
|||||||
|
|
||||||
FCurrentTestName := 'Extended';
|
FCurrentTestName := 'Extended';
|
||||||
DataExt := 1.7722;
|
DataExt := 1.7722;
|
||||||
GotRes := FDummyContext.ReadFloat(TargetLoc(TDbgPtr(@DataExt)), SizeVal(SizeOf(Extended)), GotExt);
|
GotRes := FDummyContext.ReadFloat(TargetLoc(TDbgPtr(@DataExt)), SizeVal(DBG_EXTENDED_SIZE), GotExt);
|
||||||
AssertTrue(FCurrentTestName + 'Read OK', GotRes);
|
AssertTrue(FCurrentTestName + 'Read OK', GotRes);
|
||||||
AssertEquals(FCurrentTestName + 'target not changed', 1.7722, DataExt);
|
AssertEquals(FCurrentTestName + 'target not changed', 1.7722, double(DataExt));
|
||||||
AssertEquals(FCurrentTestName + 'Val', DataExt, GotExt);
|
AssertEquals(FCurrentTestName + 'Val', double(DataExt), double(GotExt));
|
||||||
|
|
||||||
FCurrentTestName := 'Double';
|
FCurrentTestName := 'Double';
|
||||||
DataDouble := 1.7722;
|
DataDouble := 1.7722;
|
||||||
GotRes := FDummyContext.ReadFloat(TargetLoc(TDbgPtr(@DataDouble)), SizeVal(SizeOf(Double)), GotExt);
|
GotRes := FDummyContext.ReadFloat(TargetLoc(TDbgPtr(@DataDouble)), SizeVal(SizeOf(Double)), GotExt);
|
||||||
AssertTrue(FCurrentTestName + 'Read OK', GotRes);
|
AssertTrue(FCurrentTestName + 'Read OK', GotRes);
|
||||||
AssertEquals(FCurrentTestName + 'target not changed', 1.7722, DataDouble);
|
AssertEquals(FCurrentTestName + 'target not changed', 1.7722, DataDouble);
|
||||||
AssertEquals(FCurrentTestName + 'Val', DataDouble, GotExt);
|
AssertEquals(FCurrentTestName + 'Val', DataDouble, double(GotExt));
|
||||||
|
|
||||||
FCurrentTestName := 'Single';
|
FCurrentTestName := 'Single';
|
||||||
DataSingle := 1.7722;
|
DataSingle := 1.7722;
|
||||||
GotRes := FDummyContext.ReadFloat(TargetLoc(TDbgPtr(@DataSingle)), SizeVal(SizeOf(Single)), GotExt);
|
GotRes := FDummyContext.ReadFloat(TargetLoc(TDbgPtr(@DataSingle)), SizeVal(SizeOf(Single)), GotExt);
|
||||||
AssertTrue(FCurrentTestName + 'Read OK', GotRes);
|
AssertTrue(FCurrentTestName + 'Read OK', GotRes);
|
||||||
AssertEquals(FCurrentTestName + 'target not changed', 1.7722, DataSingle);
|
AssertEquals(FCurrentTestName + 'target not changed', 1.7722, DataSingle);
|
||||||
AssertEquals(FCurrentTestName + 'Val', DataSingle, GotExt);
|
AssertEquals(FCurrentTestName + 'Val', DataSingle, double(GotExt));
|
||||||
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user