diff --git a/components/fpdebug/fpdbgclasses.pp b/components/fpdebug/fpdbgclasses.pp index 2619ecfb69..2008434e26 100644 --- a/components/fpdebug/fpdbgclasses.pp +++ b/components/fpdebug/fpdbgclasses.pp @@ -1625,10 +1625,14 @@ procedure TGenericBreakPointTargetHandler.MaskBreakpointsInReadData(const AAdres const ASize: Cardinal; var AData); var MapEnumData: TFpBreakPointMap.TFpBreakPointMapEnumerationData; + offset: TDbgPtr; begin for MapEnumData in BreakMap do begin if not HPtr(MapEnumData.TargetHandlerDataPtr)^.ErrorSetting and (MapEnumData.Location >= AAdress) and (MapEnumData.Location < (AAdress+ASize)) then - P_BRK_STORE(@AData)[MapEnumData.Location-AAdress] := HPtr(MapEnumData.TargetHandlerDataPtr)^.OrigValue; + begin + offset := MapEnumData.Location - AAdress; + P_BRK_STORE(@AData + offset)^ := HPtr(MapEnumData.TargetHandlerDataPtr)^.OrigValue; + end; end; end;