From 44de4b40343352e5fabdb431a5e322de92ce9456 Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 12 May 2015 20:02:18 +0000 Subject: [PATCH] fpdebug: prevent crash if breakpoint at address already exists (can happen if line info is not read correct / generics?) git-svn-id: trunk@49000 - --- components/fpdebug/fpdbgclasses.pp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/fpdebug/fpdbgclasses.pp b/components/fpdebug/fpdbgclasses.pp index f8481f12f3..7d2346d006 100644 --- a/components/fpdebug/fpdbgclasses.pp +++ b/components/fpdebug/fpdbgclasses.pp @@ -650,6 +650,11 @@ end; function TDbgProcess.AddBreak(const ALocation: TDbgPtr): TDbgBreakpoint; begin + if FBreakMap.HasId(ALocation) then begin + debugln(['TDbgProcess.AddBreak breakpoint already exists at ', dbgs(ALocation)]); + Result := nil; + exit; + end; Result := OSDbgClasses.DbgBreakpointClass.Create(Self, ALocation); FBreakMap.Add(ALocation, Result); if (GetInstructionPointerRegisterValue=ALocation) and not assigned(FCurrentBreakpoint) then