FpDebug: Fixed the index-calculation for Dwarf-3 encoded strings

git-svn-id: trunk@46096 -
This commit is contained in:
joost 2014-08-31 16:12:38 +00:00
parent 27c60931ec
commit 5bc5c42c07

View File

@ -4215,7 +4215,7 @@ begin
if InformationEntry.ReadValue(DW_AT_bit_stride, FStrideInBits) then if InformationEntry.ReadValue(DW_AT_bit_stride, FStrideInBits) then
exit; exit;
CreateMembers; // TODO Can we get here without that already done? CreateMembers;
if (FMembers.Count > 0) and // TODO: stride for diff member if (FMembers.Count > 0) and // TODO: stride for diff member
(TDbgDwarfSymbolBase(FMembers[0]).InformationEntry.ReadValue(DW_AT_byte_stride, FStrideInBits)) (TDbgDwarfSymbolBase(FMembers[0]).InformationEntry.ReadValue(DW_AT_byte_stride, FStrideInBits))
then begin then begin
@ -4303,6 +4303,7 @@ function TFpDwarfSymbolTypeArray.GetMemberAddress(AValObject: TFpDwarfValue;
AIndex: array of Int64): TFpDbgMemLocation; AIndex: array of Int64): TFpDbgMemLocation;
var var
Idx, Offs, Factor: Int64; Idx, Offs, Factor: Int64;
LowBound, HighBound: int64;
i: Integer; i: Integer;
bsize: Integer; bsize: Integer;
m: TFpDwarfSymbol; m: TFpDwarfSymbol;
@ -4336,7 +4337,8 @@ begin
for i := Length(AIndex) - 1 downto 0 do begin for i := Length(AIndex) - 1 downto 0 do begin
Idx := AIndex[i]; Idx := AIndex[i];
m := TFpDwarfSymbol(FMembers[i]); m := TFpDwarfSymbol(FMembers[i]);
if m.HasBounds then begin if ((m is TFpDwarfSymbolType) and (TFpDwarfSymbolType(m).GetValueBounds(AValObject, LowBound, HighBound))) or
m.HasBounds then begin
Idx := Idx - m.OrdLowBound; Idx := Idx - m.OrdLowBound;
end; end;
Offs := Offs + Idx * bsize * Factor; Offs := Offs + Idx * bsize * Factor;