FpDebug: line/address lookup, fix uninitialized result for "file-found", used for pending breakpoints

This commit is contained in:
Martin 2024-06-05 17:51:52 +02:00
parent 8ee632a157
commit c030c1af73

View File

@ -2309,6 +2309,7 @@ function TDbgInstance.GetLineAddresses(AFileName: String; ALine: Cardinal;
var
FoundLine: Integer;
begin
FLastLineAddressesFoundFile := False;
if Assigned(DbgInfo) and DbgInfo.HasInfo then
Result := DbgInfo.GetLineAddresses(AFileName, ALine, AResultList, AFindSibling, @FoundLine, @FLastLineAddressesFoundFile, AMaxSiblingDistance)
else
@ -2747,13 +2748,15 @@ function TDbgProcess.GetLineAddresses(AFileName: String; ALine: Cardinal;
var
Lib: TDbgLibrary;
begin
FLastLineAddressesFoundFile := False;
if ASymInstance <> nil then begin
if ASymInstance = self then begin
Result := inherited GetLineAddresses(AFileName, ALine, AResultList, AFindSibling, AMaxSiblingDistance);
end
else begin
Result := ASymInstance.GetLineAddresses(AFileName, ALine, AResultList, AFindSibling, AMaxSiblingDistance);
FLastLineAddressesFoundFile := ASymInstance.FLastLineAddressesFoundFile;
if ASymInstance.FLastLineAddressesFoundFile then
FLastLineAddressesFoundFile := True;
end;
exit;
end;