mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 09:36:10 +02:00
LazDebugger(Fp)Lldb: fix stackframe when switching between threads
git-svn-id: trunk@60413 -
This commit is contained in:
parent
2de7b11832
commit
dff24e8451
@ -415,7 +415,7 @@ type
|
|||||||
TLldbCallStack = class(TCallStackSupplier)
|
TLldbCallStack = class(TCallStackSupplier)
|
||||||
protected
|
protected
|
||||||
//procedure Clear;
|
//procedure Clear;
|
||||||
//procedure DoThreadChanged;
|
procedure DoThreadChanged;
|
||||||
procedure ParentRequestEntries(ACallstack: TCallStackBase);
|
procedure ParentRequestEntries(ACallstack: TCallStackBase);
|
||||||
public
|
public
|
||||||
procedure RequestAtLeastCount(ACallstack: TCallStackBase;
|
procedure RequestAtLeastCount(ACallstack: TCallStackBase;
|
||||||
@ -1409,6 +1409,8 @@ begin
|
|||||||
|
|
||||||
if CurrentThreads <> nil
|
if CurrentThreads <> nil
|
||||||
then CurrentThreads.CurrentThreadId := ANewId;
|
then CurrentThreads.CurrentThreadId := ANewId;
|
||||||
|
|
||||||
|
TLldbCallStack(Debugger.CallStack).DoThreadChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLldbThreads.GetFramePointerForThread(AnId: Integer): TDBGPtr;
|
function TLldbThreads.GetFramePointerForThread(AnId: Integer): TDBGPtr;
|
||||||
@ -1509,6 +1511,25 @@ end;
|
|||||||
|
|
||||||
{ TLldbCallStack }
|
{ TLldbCallStack }
|
||||||
|
|
||||||
|
procedure TLldbCallStack.DoThreadChanged;
|
||||||
|
var
|
||||||
|
tid, idx: Integer;
|
||||||
|
cs: TCallStackBase;
|
||||||
|
begin
|
||||||
|
if (Debugger = nil) or not(Debugger.State in [dsPause, dsInternalPause]) then begin
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TLldbDebugger(Debugger).FCurrentStackFrame := 0;
|
||||||
|
tid := Debugger.Threads.CurrentThreads.CurrentThreadId;
|
||||||
|
cs := TCallStackBase(CurrentCallStackList.EntriesForThreads[tid]);
|
||||||
|
idx := cs.CurrentIndex; // CURRENT
|
||||||
|
if idx < 0 then idx := 0;
|
||||||
|
|
||||||
|
TLldbDebugger(Debugger).FCurrentStackFrame := idx;
|
||||||
|
cs.CurrentIndex := idx;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TLldbCallStack.ParentRequestEntries(ACallstack: TCallStackBase);
|
procedure TLldbCallStack.ParentRequestEntries(ACallstack: TCallStackBase);
|
||||||
begin
|
begin
|
||||||
inherited RequestEntries(ACallstack);
|
inherited RequestEntries(ACallstack);
|
||||||
@ -1556,7 +1577,9 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ACallstack.CurrentIndex := 0; // will be used, if thread is changed
|
if ACallstack.ThreadId = TLldbDebugger(Debugger).FCurrentThreadId
|
||||||
|
then ACallstack.CurrentIndex := TLldbDebugger(Debugger).FCurrentStackFrame
|
||||||
|
else ACallstack.CurrentIndex := 0; // will be used, if thread is changed
|
||||||
ACallstack.SetCurrentValidity(ddsValid);
|
ACallstack.SetCurrentValidity(ddsValid);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user