From 9a9d87e6618957c4ed81009c95801e3f3e9a1c8d Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 14 Jan 2019 23:05:10 +0000 Subject: [PATCH] FpDebug: fix cache when cross debugging a 64bit target from a 32bit IDE. (affects FpLldb) git-svn-id: trunk@60085 - --- components/debuggerintf/dbgintfbasetypes.pas | 1 + components/fpdebug/fpdmemorytools.pas | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/components/debuggerintf/dbgintfbasetypes.pas b/components/debuggerintf/dbgintfbasetypes.pas index d7ae79533c..0a4c514113 100644 --- a/components/debuggerintf/dbgintfbasetypes.pas +++ b/components/debuggerintf/dbgintfbasetypes.pas @@ -16,6 +16,7 @@ type datatype pointing to data on the target *) TDBGPtr = type QWord; + PDBGPtr = ^TDBGPtr; TDBGPtrArray = Array of TDBGPtr; (* TDbgSymbolKind diff --git a/components/fpdebug/fpdmemorytools.pas b/components/fpdebug/fpdmemorytools.pas index 64d323a2b7..8db1cc611b 100644 --- a/components/fpdebug/fpdmemorytools.pas +++ b/components/fpdebug/fpdmemorytools.pas @@ -682,12 +682,12 @@ begin else Result := 0; end; -function CompareKey(Item1, Item2: Pointer): Integer; +function CompareKey(Key, Item2: Pointer): Integer; begin - If {%H-}TDBGPtr(Item1) > TFpDbgMemCacheSimple(Item2).CacheAddress + If PDBGPtr(Key)^ > TFpDbgMemCacheSimple(Item2).CacheAddress then Result := 1 else - If {%H-}TDBGPtr(Item1) < TFpDbgMemCacheSimple(Item2).CacheAddress + If PDBGPtr(Key)^ < TFpDbgMemCacheSimple(Item2).CacheAddress then Result := -1 else Result := 0; end; @@ -710,7 +710,7 @@ var Node: TAVLTreeNode; begin Result := False; - Node := FCaches.FindNearestKey({%H-}Pointer(AnAddress), @CompareKey); + Node := FCaches.FindNearestKey(@AnAddress, @CompareKey); if Node = nil then exit; @@ -729,7 +729,7 @@ function TFpDbgMemCacheManagerSimple.ReadMemory(AnAddress: TDbgPtr; var Node: TAVLTreeNode; begin - Node := FCaches.FindNearestKey({%H-}Pointer(AnAddress), @CompareKey); + Node := FCaches.FindNearestKey(@AnAddress, @CompareKey); if Node = nil then exit(inherited ReadMemory(AnAddress, ASize, ADest));