mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 05:39:17 +02:00
FpDebug: Improve partial mem-read. Check early if the address is readable at all.
This commit is contained in:
parent
faf2fe7a80
commit
8970a4768b
@ -2378,6 +2378,7 @@ var
|
||||
SizeRemaining, sz: Cardinal;
|
||||
Offs: Integer;
|
||||
APartAddr: TDBGPtr;
|
||||
Dummy: QWord;
|
||||
begin
|
||||
// subclasses can do better implementation if checking for error reasons, such as part_read
|
||||
APartSize := ASize;
|
||||
@ -2390,6 +2391,11 @@ begin
|
||||
APartAddr := AAdress;
|
||||
APartSize := 0;
|
||||
|
||||
// check if the address is readable at all
|
||||
Result := ReadData(AAdress, 1, Dummy);
|
||||
if not Result then
|
||||
exit;
|
||||
|
||||
while SizeRemaining > 0 do begin
|
||||
Result := False;
|
||||
sz := SizeRemaining;
|
||||
|
@ -1080,6 +1080,7 @@ function TFpDbgMemReaderBase.ReadMemoryPartial(AnAddress: TDbgPtr;
|
||||
var
|
||||
SizeRemaining, sz: Cardinal;
|
||||
Offs: Integer;
|
||||
Dummy: QWord;
|
||||
begin
|
||||
ABytesRead := ASize;
|
||||
Result := ReadMemory(AnAddress, ASize, ADest);
|
||||
@ -1090,6 +1091,11 @@ begin
|
||||
Offs := 0;
|
||||
ABytesRead := 0;
|
||||
|
||||
// check if the address is readable at all
|
||||
Result := ReadMemory(AnAddress, 1, @Dummy);
|
||||
if not Result then
|
||||
exit;
|
||||
|
||||
while SizeRemaining > 0 do begin
|
||||
Result := False;
|
||||
sz := SizeRemaining;
|
||||
|
Loading…
Reference in New Issue
Block a user