From d062000bf33c31c16e90cacb4ab8647590d0ac92 Mon Sep 17 00:00:00 2001 From: joost Date: Mon, 25 Aug 2014 20:50:08 +0000 Subject: [PATCH] FpDebug: Another fix for the length of DW_FORM_ref_addr in Dwarf v3 git-svn-id: trunk@46075 - --- components/fpdebug/fpdbgdwarfdataclasses.pas | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/fpdebug/fpdbgdwarfdataclasses.pas b/components/fpdebug/fpdbgdwarfdataclasses.pas index 84d28a2647..adf2a10564 100644 --- a/components/fpdebug/fpdbgdwarfdataclasses.pas +++ b/components/fpdebug/fpdbgdwarfdataclasses.pas @@ -3970,9 +3970,10 @@ function TDwarfCompilationUnit.ReadAddressAtPointer(var AData: Pointer; AIncPointer: Boolean): TFpDbgMemLocation; begin // do not need mem reader, address is in dwarf. Should be in correct format - if FAddressSize = 4 // TODO Dwarf3 depends on FIsDwarf64 - then Result := TargetLoc(PLongWord(AData)^) - else Result := TargetLoc(PQWord(AData)^); + if ((Version>2) and IsDwarf64) or ((version < 3) and (FAddressSize = 8)) then + Result := TargetLoc(PQWord(AData)^) + else + Result := TargetLoc(PLongWord(AData)^); if AIncPointer then inc(AData, FAddressSize); end;