From 73fda9538048d83a1e347dd871482a1d0af8f6c3 Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 3 Oct 2010 21:01:27 +0000 Subject: [PATCH] Debugger: Added type-cast to fix a range check issue. Issue #0017537,#0016318,#0016132 Based on patch by Juha Manninen in 0017537 git-svn-id: trunk@27554 - --- debugger/debugger.pp | 2 ++ debugger/gdbmidebugger.pp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debugger/debugger.pp b/debugger/debugger.pp index 207f5f386d..0bb5ca7d71 100644 --- a/debugger/debugger.pp +++ b/debugger/debugger.pp @@ -42,6 +42,8 @@ uses type // datatype pointing to data on the target TDBGPtr = type QWord; + // Signed datatype with size of TDBGPtr + TDBGPtrInt = type Int64; TDBGLocationRec = record Address: TDBGPtr; diff --git a/debugger/gdbmidebugger.pp b/debugger/gdbmidebugger.pp index 612194e38d..c5e0628ff8 100644 --- a/debugger/gdbmidebugger.pp +++ b/debugger/gdbmidebugger.pp @@ -1538,7 +1538,7 @@ end; function DisasmSortCompare(AItem1, AItem2: Pointer): Integer; begin - Result := PGDBMIDisasm(AItem1)^.Address - PGDBMIDisasm(AItem2)^.Address; + Result := TDBGPtrInt(PGDBMIDisasm(AItem1)^.Address) - TDBGPtrInt(PGDBMIDisasm(AItem2)^.Address); end; function TGDBMIDebugger.GDBDisassemble(AAddr: TDbgPtr; ABackward: Boolean; out ANextAddr: TDbgPtr; out ADump, AStatement, AFile: String; out ALine: Integer): Boolean;