LazDebuggerFp: Trigger DefaultContext in thread to cache it. (Avoid calling GetInstructionPointerRegisterValue outside the debug-thread)

(cherry picked from commit 24c378f797)
This commit is contained in:
Martin 2021-10-13 20:28:38 +02:00
parent 357120fb44
commit 7667dc1bad

View File

@ -2411,6 +2411,7 @@ begin
exit; exit;
end; end;
end; end;
FDebugger.FDbgController.DefaultContext; // Make sure it is avail and cached / so it can be called outside the thread
if CurrentThread = nil then if CurrentThread = nil then
exit; exit;
@ -3810,7 +3811,8 @@ begin
result.SrcLine:=0; result.SrcLine:=0;
if AnAddress=0 then if AnAddress=0 then
result.Address := FDbgController.CurrentThread.GetInstructionPointerRegisterValue result.Address := FDbgController.DefaultContext.Address // DefaultContext has the InstrPtr cached
//result.Address := FDbgController.CurrentThread.GetInstructionPointerRegisterValue
else else
result.Address := AnAddress; result.Address := AnAddress;