mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 06:19:17 +02:00
FpDebug: fix finding breakpoint addresses for generics. Related to https:/bugs.freepascal.org/view.php?id=37658
This commit is contained in:
parent
92d902d141
commit
b94af816fe
@ -486,6 +486,8 @@ type
|
|||||||
Name: PChar;
|
Name: PChar;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
PDWarfLineMap = ^TDWarfLineMap;
|
||||||
|
|
||||||
{ TDWarfLineMap }
|
{ TDWarfLineMap }
|
||||||
|
|
||||||
TDWarfLineMap = object
|
TDWarfLineMap = object
|
||||||
@ -512,6 +514,8 @@ type
|
|||||||
FLinePageList: Array of PLineMapPage;
|
FLinePageList: Array of PLineMapPage;
|
||||||
FHighNumberMap: TLineNumberAddrMap;
|
FHighNumberMap: TLineNumberAddrMap;
|
||||||
FHighNumberMin, FHighNumberMax: Cardinal;
|
FHighNumberMin, FHighNumberMax: Cardinal;
|
||||||
|
|
||||||
|
FNextMap: PDWarfLineMap; // https:/bugs.freepascal.org/view.php?id=37658
|
||||||
protected
|
protected
|
||||||
function CheckIsSameProc(const IsList: Boolean; const FndAddr: TDBGPtr;
|
function CheckIsSameProc(const IsList: Boolean; const FndAddr: TDBGPtr;
|
||||||
const ADbgInfo: TFpDwarfInfo; const ALine: Cardinal): Boolean;
|
const ADbgInfo: TFpDwarfInfo; const ALine: Cardinal): Boolean;
|
||||||
@ -536,7 +540,6 @@ type
|
|||||||
): Boolean; inline;
|
): Boolean; inline;
|
||||||
// NoData: only return True/False, but nothing in AResultList
|
// NoData: only return True/False, but nothing in AResultList
|
||||||
end;
|
end;
|
||||||
PDWarfLineMap = ^TDWarfLineMap;
|
|
||||||
{%endregion Line Info / Section "debug_line"}
|
{%endregion Line Info / Section "debug_line"}
|
||||||
|
|
||||||
{%region Base classes for handling Symbols in unit FPDbgDwarf}
|
{%region Base classes for handling Symbols in unit FPDbgDwarf}
|
||||||
@ -3625,6 +3628,7 @@ procedure TDWarfLineMap.Init;
|
|||||||
begin
|
begin
|
||||||
SetLength(FLinePageList, 32);
|
SetLength(FLinePageList, 32);
|
||||||
FHighNumberMap := nil;
|
FHighNumberMap := nil;
|
||||||
|
FNextMap := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDWarfLineMap.Free;
|
procedure TDWarfLineMap.Free;
|
||||||
@ -3925,6 +3929,7 @@ var
|
|||||||
IsList, OffsetExist: Boolean;
|
IsList, OffsetExist: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
try
|
||||||
|
|
||||||
if (ALine >= MAX_PAGE_LINE) and not ASkipHighLines then begin
|
if (ALine >= MAX_PAGE_LINE) and not ASkipHighLines then begin
|
||||||
Result := GetAddressesForHighLine(ALine, AResultList, NoData, AFindSibling, AFoundLine,
|
Result := GetAddressesForHighLine(ALine, AResultList, NoData, AFindSibling, AFoundLine,
|
||||||
@ -4076,6 +4081,14 @@ begin
|
|||||||
SetLength(AResultList, k + j);
|
SetLength(AResultList, k + j);
|
||||||
move(PDBGPtr(FndAddr)[1], AResultList[k], j*SizeOf(TDBGPtr));
|
move(PDBGPtr(FndAddr)[1], AResultList[k], j*SizeOf(TDBGPtr));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
finally
|
||||||
|
if (FNextMap <> nil) and (FNextMap <> pointer(1)) and
|
||||||
|
FNextMap^.GetAddressesForLine(ALine, AResultList, NoData, AFindSibling, AFoundLine,
|
||||||
|
AMaxSiblingDistance, ADbgInfo, ASkipHighLines)
|
||||||
|
then
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TFpDwarfInfo }
|
{ TFpDwarfInfo }
|
||||||
@ -4430,8 +4443,19 @@ begin
|
|||||||
FLineNumberMapDone := True;
|
FLineNumberMapDone := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if FLineNumberMap.TryGetValue(AFileName, Result) then
|
if FLineNumberMap.TryGetValue(AFileName, Result) then begin
|
||||||
|
if Result^.FNextMap <> nil then
|
||||||
|
exit;
|
||||||
|
Result^.FNextMap := pointer(1);
|
||||||
|
BaseName := ExtractFileName(AFileName);
|
||||||
|
if BaseName = AFileName then
|
||||||
|
exit;
|
||||||
|
if FLineNumberMap.TryGetValue(BaseName, Result^.FNextMap) then
|
||||||
|
Result^.FNextMap^.FNextMap := pointer(1)
|
||||||
|
else
|
||||||
|
Result^.FNextMap := pointer(1);
|
||||||
exit;
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
BaseName := ExtractFileName(AFileName);
|
BaseName := ExtractFileName(AFileName);
|
||||||
if FLineNumberMap.TryGetValue(BaseName, Result) then
|
if FLineNumberMap.TryGetValue(BaseName, Result) then
|
||||||
|
Loading…
Reference in New Issue
Block a user