From a8c78c1862e0a990ecc43418572e5ee344eb3bc3 Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 14 Jan 2024 17:41:20 +0100 Subject: [PATCH] FpDebug: Clean up TFpDbgLocationContext.ReadAddress - MemModel does fill in all fields --- components/fpdebug/fpdmemorytools.pas | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/components/fpdebug/fpdmemorytools.pas b/components/fpdebug/fpdmemorytools.pas index 87433e9326..71826a0b0f 100644 --- a/components/fpdebug/fpdmemorytools.pas +++ b/components/fpdebug/fpdmemorytools.pas @@ -618,7 +618,6 @@ begin Result.Address := Result.Address - 1; // Going to ADD some bits back // E.g. b=-1 means (b and 7) = 7 and that means adding 7 bits, instead of substracting 1 Result.BitOffset := ABitOffset and 7; - Result.AddressClass := AnAddr.AddressClass; {$POP} end; @@ -1021,12 +1020,8 @@ end; function TFpDbgLocationContext.ReadAddress(const ALocation: TFpDbgMemLocation; ASize: TFpDbgValueSize): TFpDbgMemLocation; begin - Result := Default(TFpDbgMemLocation); if MemManager.ReadMemory(rdtAddress, ALocation, ASize, @Result.Address, SizeOf(Result.Address), Self) then - begin - Result := MemModel.AddressToTargetLocation(Result.Address); - Result.MType := mlfTargetMem; - end + Result := MemModel.AddressToTargetLocation(Result.Address) else Result := InvalidLoc; end; @@ -1041,13 +1036,9 @@ end; function TFpDbgLocationContext.ReadAddress(const ALocation: TFpDbgMemLocation; ASize: TFpDbgValueSize; out AnAddress: TFpDbgMemLocation): Boolean; begin - AnAddress := Default(TFpDbgMemLocation); Result := MemManager.ReadMemory(rdtAddress, ALocation, ASize, @AnAddress.Address, (SizeOf(AnAddress.Address)), Self); if Result then - begin - AnAddress := MemModel.AddressToTargetLocation(AnAddress.Address); - AnAddress.MType := mlfTargetMem; - end + AnAddress := MemModel.AddressToTargetLocation(AnAddress.Address) else AnAddress := InvalidLoc; end;