mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 14:39:13 +02:00
FpDebug: Linux, check if thread is known.
(cherry picked from commit 9fd6981814
)
This commit is contained in:
parent
87ee0b11eb
commit
fb6f4faa98
@ -410,6 +410,14 @@ var
|
|||||||
process_vm_lib: TLibHandle = 0;
|
process_vm_lib: TLibHandle = 0;
|
||||||
process_vm_readv: Tprocess_vm_readv = nil;
|
process_vm_readv: Tprocess_vm_readv = nil;
|
||||||
|
|
||||||
|
function dbgsThreadId(AThread: TDbgThread): string;
|
||||||
|
begin
|
||||||
|
if AThread = nil then
|
||||||
|
result := 'nil'
|
||||||
|
else
|
||||||
|
result := inttostr(AThread.ID);
|
||||||
|
end;
|
||||||
|
|
||||||
Function WIFSTOPPED(Status: Integer): Boolean;
|
Function WIFSTOPPED(Status: Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
WIFSTOPPED:=((Status and $FF)=$7F);
|
WIFSTOPPED:=((Status and $FF)=$7F);
|
||||||
@ -1669,12 +1677,12 @@ begin
|
|||||||
if (FSOLibEventBreakpoint <> nil) and not FSOLibEventBreakpoint.Enabled then
|
if (FSOLibEventBreakpoint <> nil) and not FSOLibEventBreakpoint.Enabled then
|
||||||
FSOLibEventBreakpoint.Enabled:=True;
|
FSOLibEventBreakpoint.Enabled:=True;
|
||||||
{$IFDEF DebuglnLinuxDebugEvents}
|
{$IFDEF DebuglnLinuxDebugEvents}
|
||||||
debuglnEnter(['>>>>> TDbgLinuxProcess.Continue TID:', AThread.ID, ' SingleStep:', SingleStep ]); try
|
debuglnEnter(['>>>>> TDbgLinuxProcess.Continue TID:', dbgsThreadId(AThread), ' SingleStep:', SingleStep ]); try
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FSingleSteppingThreadID := -1;
|
FSingleSteppingThreadID := -1;
|
||||||
|
|
||||||
// Terminating process and all threads
|
// Terminating process and all threads
|
||||||
if FIsTerminating then begin
|
if FIsTerminating and (AThread <> nil) then begin
|
||||||
fpseterrno(0);
|
fpseterrno(0);
|
||||||
AThread.BeforeContinue;
|
AThread.BeforeContinue;
|
||||||
fpPTrace(PTRACE_KILL, AThread.ID, pointer(1), nil);
|
fpPTrace(PTRACE_KILL, AThread.ID, pointer(1), nil);
|
||||||
@ -1683,7 +1691,7 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if TDbgLinuxThread(AThread).FIsPaused then // in case of deInternal, it may not be paused and can be ignored
|
if (AThread <> nil) and TDbgLinuxThread(AThread).FIsPaused then // in case of deInternal, it may not be paused and can be ignored
|
||||||
AThread.NextIsSingleStep:=SingleStep;
|
AThread.NextIsSingleStep:=SingleStep;
|
||||||
|
|
||||||
// check for pending events in other threads
|
// check for pending events in other threads
|
||||||
@ -1742,7 +1750,7 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if TDbgLinuxThread(AThread).FIsPaused then // in case of deInternal, it may not be paused and can be ignored
|
if (AThread <> nil) and TDbgLinuxThread(AThread).FIsPaused then // in case of deInternal, it may not be paused and can be ignored
|
||||||
if HasInsertedBreakInstructionAtLocation(AThread.GetInstructionPointerRegisterValue) then begin
|
if HasInsertedBreakInstructionAtLocation(AThread.GetInstructionPointerRegisterValue) then begin
|
||||||
TempRemoveBreakInstructionCode(AThread.GetInstructionPointerRegisterValue);
|
TempRemoveBreakInstructionCode(AThread.GetInstructionPointerRegisterValue);
|
||||||
TDbgLinuxThread(AThread).FIsSteppingBreakPoint := True;
|
TDbgLinuxThread(AThread).FIsSteppingBreakPoint := True;
|
||||||
@ -1777,7 +1785,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if TDbgLinuxThread(AThread).FIsPaused then // in case of deInternal, it may not be paused and can be ignored
|
if (AThread <> nil) and TDbgLinuxThread(AThread).FIsPaused then // in case of deInternal, it may not be paused and can be ignored
|
||||||
if not FIsTerminating then begin
|
if not FIsTerminating then begin
|
||||||
fpseterrno(0);
|
fpseterrno(0);
|
||||||
//AThread.BeforeContinue;
|
//AThread.BeforeContinue;
|
||||||
|
Loading…
Reference in New Issue
Block a user