From 772bc3236b936a2f51e3e8f2d50f52171e39eaaf Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 7 Jan 2025 12:54:05 +0100 Subject: [PATCH] FpDebug: Linux, fix reading proc/maps to get loaded libraries. (cherry picked from commit 6f1cd0c4b5c5203bfe50c11b210ab697015bc8eb) --- components/fpdebug/fpdbglinuxclasses.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/fpdebug/fpdbglinuxclasses.pas b/components/fpdebug/fpdbglinuxclasses.pas index 4dbb69bb6c..8d4ed934e4 100644 --- a/components/fpdebug/fpdbglinuxclasses.pas +++ b/components/fpdebug/fpdbglinuxclasses.pas @@ -1116,10 +1116,10 @@ begin BlockLength:=64*1024; TotalBytesRead := 0; repeat - SetLength(Buf, TotalBytesRead + BlockLength); - BytesRead := FS.Read(Buf[TotalBytesRead+1], BlockLength); - TotalBytesRead:=TotalBytesRead+BytesRead; - until BytesRead <= BlockLength; + SetLength(Buf, TotalBytesRead + BlockLength); + BytesRead := FS.Read(Buf[TotalBytesRead+1], BlockLength); + TotalBytesRead:=TotalBytesRead+BytesRead; + until BytesRead <= 0; SetLength(Buf, TotalBytesRead); finally FS.Free;