From c3983639323fd66e13a9ce12534ae84a6ff200d8 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 2 Dec 2023 14:05:58 +0100 Subject: [PATCH] FpDebug: fix :refcnt for fpc 3.3.1 --- components/fpdebug/fpdbgdwarffreepascal.pas | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/fpdebug/fpdbgdwarffreepascal.pas b/components/fpdebug/fpdbgdwarffreepascal.pas index 592b71006d..1737f04593 100644 --- a/components/fpdebug/fpdbgdwarffreepascal.pas +++ b/components/fpdebug/fpdbgdwarffreepascal.pas @@ -1886,8 +1886,15 @@ begin if not IsReadableLoc(Addr) then exit; - Addr:= Addr - (AddressSize * 2); - Result := Context.ReadSignedInt(Addr, SizeVal(AddressSize), ARefCount); + if TFpDwarfFreePascalSymbolClassMap(TypeInfo.CompilationUnit.DwarfSymbolClassMap).FCompilerVersion >= $030301 + then begin + Addr:= Addr - AddressSize - 4; + Result := Context.ReadSignedInt(Addr, SizeVal(4), ARefCount); + end + else begin + Addr:= Addr - (AddressSize * 2); + Result := Context.ReadSignedInt(Addr, SizeVal(AddressSize), ARefCount); + end; end; function TFpValueDwarfV3FreePascalString.ObtainDynamicCodePage(Addr: TFpDbgMemLocation; out