diff --git a/components/lazdebuggers/lazdebuggerlldb/lldbdebugger.pas b/components/lazdebuggers/lazdebuggerlldb/lldbdebugger.pas index 1cc4e97797..117b8d0e5a 100644 --- a/components/lazdebuggers/lazdebuggerlldb/lldbdebugger.pas +++ b/components/lazdebuggers/lazdebuggerlldb/lldbdebugger.pas @@ -1237,11 +1237,16 @@ end; procedure TLldbDebuggerCommandLocals.DoExecute; begin + if FLocals = nil then begin + Finished; + exit; + end; + if FLocalsInstr <> nil then begin FLocalsInstr.OnFinish := nil; ReleaseRefAndNil(FLocalsInstr); end; - FLocalsInstr := TLldbInstructionLocals.Create(); + FLocalsInstr := TLldbInstructionLocals.Create(FLocals.ThreadId, FLocals.StackFrame); FLocalsInstr.OnFinish := @LocalsInstructionFinished; QueueInstruction(FLocalsInstr); end; diff --git a/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas b/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas index 0e159ff028..67eb507e2b 100644 --- a/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas +++ b/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas @@ -276,7 +276,7 @@ type function ProcessInputFromDbg(const AData: String): Boolean; override; procedure SendCommandDataToDbg(); override; public - constructor Create; + constructor Create(AThread, AFrame: Integer); destructor Destroy; override; property Res: TStringList read FRes; end; @@ -1025,9 +1025,9 @@ begin Queue.SendDataToDBG(Self, 'version'); // end marker // do not sent before new prompt end; -constructor TLldbInstructionLocals.Create; +constructor TLldbInstructionLocals.Create(AThread, AFrame: Integer); begin - inherited Create('frame variable -P 1 -D 5'); // TODO: make -D 5 configurable + inherited Create('frame variable -P 1 -D 5', AThread, AFrame); // TODO: make -D 5 configurable FRes := TStringList.Create; end;