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