mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-09 12:10:43 +01:00
FpDebug: allow changing current thread on Linux
git-svn-id: trunk@63068 -
This commit is contained in:
parent
3370955c2b
commit
e0ebb5cb56
@ -277,7 +277,7 @@ type
|
||||
protected
|
||||
// Helper vars to run in debug-thread
|
||||
FCallStackEntryListThread: TDbgThread;
|
||||
FCallStackEntryListFrameRequired: Integer;
|
||||
FCallStackEntryListFrameRequired, FNewThreadId: Integer;
|
||||
FParamAsString: String;
|
||||
FParamAsStringStackEntry: TDbgCallstackEntry;
|
||||
FParamAsStringPrettyPrinter: TFpPascalPrettyPrinter;
|
||||
@ -291,6 +291,7 @@ type
|
||||
procedure DoFreeBreakpoint;
|
||||
procedure DoFindContext;
|
||||
procedure DoGetParamsAsString;
|
||||
procedure DoChangeCurrentThreadId;
|
||||
//
|
||||
function AddBreak(const ALocation: TDbgPtr; AnEnabled: Boolean = True): TFpDbgBreakpoint; overload;
|
||||
function AddBreak(const AFileName: String; ALine: Cardinal; AnEnabled: Boolean = True): TFpDbgBreakpoint; overload;
|
||||
@ -720,12 +721,17 @@ begin
|
||||
inherited ChangeCurrentThread(ANewId);
|
||||
if not(Debugger.State in [dsPause, dsInternalPause]) then exit;
|
||||
|
||||
{$IFDEF windows}
|
||||
TFpDebugDebugger(Debugger).FDbgController.CurrentThreadId := ANewId;
|
||||
if CurrentThreads <> nil
|
||||
then CurrentThreads.CurrentThreadId := ANewId;
|
||||
if TFpDebugDebugger(Debugger).FDbgController.CurrentProcess.RequiresExecutionInDebuggerThread then
|
||||
begin
|
||||
TFpDebugDebugger(Debugger).FNewThreadId := ANewId;
|
||||
TFpDebugDebugger(Debugger).ExecuteInDebugThread(@TFpDebugDebugger(Debugger).DoChangeCurrentThreadId);
|
||||
end
|
||||
else begin
|
||||
TFpDebugDebugger(Debugger).FDbgController.CurrentThreadId := ANewId;
|
||||
if CurrentThreads <> nil
|
||||
then CurrentThreads.CurrentThreadId := ANewId;
|
||||
end;
|
||||
Changed;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
{ TFpDebugDebuggerProperties }
|
||||
@ -3127,6 +3133,12 @@ begin
|
||||
FParamAsString := FParamAsStringStackEntry.GetParamsAsString(FParamAsStringPrettyPrinter);
|
||||
end;
|
||||
|
||||
procedure TFpDebugDebugger.DoChangeCurrentThreadId;
|
||||
begin
|
||||
FDbgController.CurrentThreadId := FNewThreadId;
|
||||
if Threads.CurrentThreads <> nil
|
||||
then Threads.CurrentThreads.CurrentThreadId := FNewThreadId;
|
||||
end;
|
||||
|
||||
function TFpDebugDebugger.AddBreak(const ALocation: TDbgPtr; AnEnabled: Boolean
|
||||
): TFpDbgBreakpoint;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user