mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-15 00:59:07 +02:00
Fp based/mixed debuggers: Fix context caching / clean up logging
git-svn-id: trunk@58352 -
This commit is contained in:
parent
a11d49bd4b
commit
4295b09fdb
@ -908,7 +908,7 @@ begin
|
|||||||
Addr := GetLocationForContext(AThreadId, AStackFrame);
|
Addr := GetLocationForContext(AThreadId, AStackFrame);
|
||||||
|
|
||||||
if Addr = 0 then begin
|
if Addr = 0 then begin
|
||||||
debugln(DBG_VERBOSE, ['GetInfoContextForContext NOT FOUND for ', AThreadId, ', ', AStackFrame]);
|
debugln(DBG_VERBOSE, ['GetInfoContextForContext ADDR NOT FOUND for ', AThreadId, ', ', AStackFrame]);
|
||||||
Result := nil;
|
Result := nil;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -930,6 +930,11 @@ begin
|
|||||||
DebugLn(DBG_VERBOSE, ['* FDwarfInfo.FindContext ', dbgs(Addr)]);
|
DebugLn(DBG_VERBOSE, ['* FDwarfInfo.FindContext ', dbgs(Addr)]);
|
||||||
Result := FDwarfInfo.FindContext(AThreadId, AStackFrame, Addr);
|
Result := FDwarfInfo.FindContext(AThreadId, AStackFrame, Addr);
|
||||||
|
|
||||||
|
if Result = nil then begin
|
||||||
|
debugln(DBG_VERBOSE, ['GetInfoContextForContext CTX NOT FOUND for ', AThreadId, ', ', AStackFrame]);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
ReleaseRefAndNil(FLastContext[MAX_CTX_CACHE-1]);
|
ReleaseRefAndNil(FLastContext[MAX_CTX_CACHE-1]);
|
||||||
move(FLastContext[0], FLastContext[1], (MAX_CTX_CACHE-1) + SizeOf(FLastContext[0]));
|
move(FLastContext[0], FLastContext[1], (MAX_CTX_CACHE-1) + SizeOf(FLastContext[0]));
|
||||||
FLastContext[0] := Result;
|
FLastContext[0] := Result;
|
||||||
|
@ -378,22 +378,25 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
InStr := TLldbInstructionMemory.Create(AnAddress, ASize);
|
InStr := TLldbInstructionMemory.Create(AnAddress, ASize);
|
||||||
InStr.AddReference;
|
InStr.AddReference;
|
||||||
FDebugger.DebugInstructionQueue.QueueInstruction(InStr);
|
try
|
||||||
while not InStr.IsCompleted do begin
|
FDebugger.DebugInstructionQueue.QueueInstruction(InStr);
|
||||||
Application.ProcessMessages;
|
while not InStr.IsCompleted do begin
|
||||||
sleep(30);
|
Application.ProcessMessages;
|
||||||
|
sleep(30);
|
||||||
|
end;
|
||||||
|
|
||||||
|
debugln(['TFpLldbDbgMemReader.ReadMemory got mem ', AnAddress, ' ', ASize, ' ', Length(InStr.Res)]);
|
||||||
|
|
||||||
|
if Length(InStr.Res) <> ASize then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
for i := 0 to ASize - 1 do begin
|
||||||
|
PByte(ADest + i)^ := InStr.Res[i];
|
||||||
|
end;
|
||||||
|
|
||||||
|
finally
|
||||||
|
InStr.ReleaseReference;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
debugln(['TFpLldbDbgMemReader.ReadMemory got mem ', AnAddress, ' ', ASize, ' ', Length(InStr.Res)]);
|
|
||||||
|
|
||||||
if Length(InStr.Res) <> ASize then
|
|
||||||
exit;
|
|
||||||
|
|
||||||
for i := 0 to ASize - 1 do begin
|
|
||||||
PByte(ADest + i)^ := InStr.Res[i];
|
|
||||||
end;
|
|
||||||
|
|
||||||
InStr.ReleaseReference;
|
|
||||||
Result := True;
|
Result := True;
|
||||||
|
|
||||||
debugln(DBG_VERBOSE, ['TFpLldbDbgMemReader.ReadMemory ', dbgs(AnAddress), ' ', dbgMemRange(ADest, ASize)]);
|
debugln(DBG_VERBOSE, ['TFpLldbDbgMemReader.ReadMemory ', dbgs(AnAddress), ' ', dbgMemRange(ADest, ASize)]);
|
||||||
@ -413,7 +416,6 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
Reg: TRegisters;
|
Reg: TRegisters;
|
||||||
RegVObj: TRegisterDisplayValue;
|
RegVObj: TRegisterDisplayValue;
|
||||||
InStr: TLldbInstructionRegister;
|
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
@ -855,7 +857,7 @@ begin
|
|||||||
Addr := GetLocationForContext(AThreadId, AStackFrame);
|
Addr := GetLocationForContext(AThreadId, AStackFrame);
|
||||||
|
|
||||||
if Addr = 0 then begin
|
if Addr = 0 then begin
|
||||||
debugln(DBG_VERBOSE, ['GetInfoContextForContext NOT FOUND for ', AThreadId, ', ', AStackFrame]);
|
debugln(DBG_VERBOSE, ['GetInfoContextForContext ADDR NOT FOUND for ', AThreadId, ', ', AStackFrame]);
|
||||||
Result := nil;
|
Result := nil;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -877,6 +879,11 @@ begin
|
|||||||
DebugLn(DBG_VERBOSE, ['* FDwarfInfo.FindContext ', dbgs(Addr)]);
|
DebugLn(DBG_VERBOSE, ['* FDwarfInfo.FindContext ', dbgs(Addr)]);
|
||||||
Result := FDwarfInfo.FindContext(AThreadId, AStackFrame, Addr);
|
Result := FDwarfInfo.FindContext(AThreadId, AStackFrame, Addr);
|
||||||
|
|
||||||
|
if Result = nil then begin
|
||||||
|
debugln(DBG_VERBOSE, ['GetInfoContextForContext CTX NOT FOUND for ', AThreadId, ', ', AStackFrame]);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
ReleaseRefAndNil(FLastContext[MAX_CTX_CACHE-1]);
|
ReleaseRefAndNil(FLastContext[MAX_CTX_CACHE-1]);
|
||||||
move(FLastContext[0], FLastContext[1], (MAX_CTX_CACHE-1) + SizeOf(FLastContext[0]));
|
move(FLastContext[0], FLastContext[1], (MAX_CTX_CACHE-1) + SizeOf(FLastContext[0]));
|
||||||
FLastContext[0] := Result;
|
FLastContext[0] := Result;
|
||||||
|
Loading…
Reference in New Issue
Block a user