LazDebuggerLldb: make debugln optional

git-svn-id: trunk@60643 -
This commit is contained in:
martin 2019-03-10 03:03:40 +00:00
parent 6d0a2c7637
commit a0c7eac2b7

View File

@ -831,7 +831,7 @@ const
i := pos('.', AReason);
if i = 0 then i := Length(AReason)+1;
Result := StrToIntDef(copy(AReason, 12, i-12), -1);
debugln(['DoBreakPointHit ', AReason, ' / ', Result]);
debugln(DBG_VERBOSE, ['DoBreakPointHit ', AReason, ' / ', Result]);
end;
procedure DoException;
@ -1025,7 +1025,7 @@ begin
if Instr <> nil then begin
ALine := '';
debugln(['Reading exception info']);
debugln(DBG_VERBOSE, ['Reading exception info']);
assert(InstructionQueue.RunningInstruction = nil, 'InstructionQueue.RunningInstruction = nil');
QueueInstruction(Instr);
Instr.ReleaseReference;
@ -1036,7 +1036,7 @@ begin
// STEP 1: Process 10992 stopped
if (FState = crRunning) and StrMatches(ALine, ['Process ', 'stopped']) then begin
FState := crReadingThreads;
debugln(['Reading thread info']);
debugln(DBG_VERBOSE, ['Reading thread info']);
FThreadInstr := TLldbInstructionThreadListReader.Create();
FThreadInstr.OnSuccess := @ThreadInstructionSucceeded;
QueueInstruction(FThreadInstr);
@ -1046,7 +1046,7 @@ begin
// STEP 2: * thread #1, stop reason = breakpoint 6.1
if StrMatches(ALine, ['* thread #', ', stop reason = ', ''], found) then begin
FState := crStopped;
debugln(['Reading stopped thread']);
debugln(DBG_VERBOSE, ['Reading stopped thread']);
SetDebuggerLocation(0, 0, '', '', '', 0);
if StrStartsWith(found[1], 'breakpoint ') then begin
FCurBrkId := GetBreakPointId(found[1])
@ -1672,7 +1672,7 @@ var
Instr: TLldbInstruction;
en: Boolean;
begin
debugln(['TLldbBreakPoint.SetBreakPoint ']);
debugln(DBG_VERBOSE, ['TLldbBreakPoint.SetBreakPoint ']);
if FCurrentInstruction <> nil then begin
if (FBreakID <> 0) or (not FCurrentInstruction.IsRunning) then begin
@ -1985,7 +1985,7 @@ end;
procedure TLldbDebuggerCommandQueue.QueueCommand(AValue: TLldbDebuggerCommand);
begin
debugln(['CommandQueue.QueueCommand ', AValue.ClassName]);
debugln(DBG_VERBOSE, ['CommandQueue.QueueCommand ', AValue.ClassName]);
Insert(Count, AValue);
Run;
end;
@ -2016,7 +2016,7 @@ begin
FRunningCommand := Items[0];
FRunningCommand.AddReference;
Delete(0);
DebugLnEnter(['||||||||>>> CommandQueue.Run ', FRunningCommand.ClassName, ', ', dbgs(fDebugger.State), ' Cnt:',Count]);
DebugLnEnter(DBG_VERBOSE, ['||||||||>>> CommandQueue.Run ', FRunningCommand.ClassName, ', ', dbgs(fDebugger.State), ' Cnt:',Count]);
FRunningCommand.Execute;
// debugger and queue may get destroyed at the end of execute
end;
@ -2025,10 +2025,10 @@ procedure TLldbDebuggerCommandQueue.CommandFinished(
ACommand: TLldbDebuggerCommand);
begin
if FRunningCommand = ACommand then begin
DebugLnExit(['||||||||<<< CommandQueue.Run ', FRunningCommand.ClassName, ', ', dbgs(fDebugger.State), ' Cnt:',Count]);
DebugLnExit(DBG_VERBOSE, ['||||||||<<< CommandQueue.Run ', FRunningCommand.ClassName, ', ', dbgs(fDebugger.State), ' Cnt:',Count]);
ReleaseRefAndNil(FRunningCommand);
end//;
else DebugLn(['|||||||| TLldbDebuggerCommandQueue.CommandFinished >> unknown ???', ', ', dbgs(fDebugger.State), ' Cnt:',Count]);
else DebugLn(DBG_VERBOSE, ['|||||||| TLldbDebuggerCommandQueue.CommandFinished >> unknown ???', ', ', dbgs(fDebugger.State), ' Cnt:',Count]);
if not(FDebugger.State in [dsError, dsDestroying, dsNone]) then
Run;
end;
@ -2044,7 +2044,7 @@ begin
while Count > 0 do
Delete(0);
if FRunningCommand <> nil then begin
DebugLnExit(['<<< CommandQueue.Run (Destroy)', FRunningCommand.ClassName, ', ', fDebugger.State]);
DebugLnExit(DBG_VERBOSE, ['<<< CommandQueue.Run (Destroy)', FRunningCommand.ClassName, ', ', fDebugger.State]);
ReleaseRefAndNil(FRunningCommand);
end;
inherited Destroy;
@ -2068,12 +2068,12 @@ end;
procedure TLldbDebuggerCommandQueue.LockQueueRun;
begin
inc(FLockQueueRun);
debugln(['TLldbDebuggerCommandQueue.LockQueueRun ',FLockQueueRun]);
debugln(DBG_VERBOSE, ['TLldbDebuggerCommandQueue.LockQueueRun ',FLockQueueRun]);
end;
procedure TLldbDebuggerCommandQueue.UnLockQueueRun;
begin
debugln(['TLldbDebuggerCommandQueue.UnLockQueueRun ',FLockQueueRun]);
debugln(DBG_VERBOSE, ['TLldbDebuggerCommandQueue.UnLockQueueRun ',FLockQueueRun]);
dec(FLockQueueRun);
if FLockQueueRun = 0 then Run;
end;
@ -2603,7 +2603,7 @@ function TLldbDebugger.LldbRun: Boolean;
var
Cmd: TLldbDebuggerCommandRunLaunch;
begin
DebugLn('*** Run');
DebugLn(DBG_VERBOSE, '*** Run');
Result := True;
if State in [dsPause, dsInternalPause, dsRun] then begin // dsRun in case of exception
@ -2690,7 +2690,7 @@ function TLldbDebugger.LldbStop: Boolean;
var
Cmd: TLldbDebuggerCommandStop;
begin
DebugLn('*** Stop');
DebugLn(DBG_VERBOSE, '*** Stop');
Result := True;
CommandQueue.CancelAll;
@ -2726,7 +2726,7 @@ var
Instr: TLldbInstruction;
s: String;
begin
debugln(['-----------------------------------------', AVariable]);
debugln(DBG_VERBOSE, ['-----------------------------------------', AVariable]);
if ASet then
Instr := TLldbInstructionSettingSet.Create('target.env-vars', AVariable, False, True)
else begin
@ -2828,7 +2828,7 @@ begin
else
if (State = dsRun)
then begin
debugln(['********** WARNING: breakpoint hit, but nothing known about it ABreakId=', BrkId]);
debugln(DBG_VERBOSE, ['********** WARNING: breakpoint hit, but nothing known about it ABreakId=', BrkId]);
end;
end;
@ -2965,7 +2965,7 @@ end;
destructor TLldbDebugger.Destroy;
begin
debugln(['!!!!!!!!!!!!!!! TLldbDebugger.Destroy ']);
debugln(DBG_VERBOSE, ['!!!!!!!!!!!!!!! TLldbDebugger.Destroy ']);
FBreakErrorBreak.Remove;
FRunErrorBreak.Remove;
FExceptionBreak.Remove;
@ -2999,12 +2999,12 @@ end;
procedure TLldbDebugger.Done;
begin
DebugLnEnter('!!! TLldbDebugger.Done;');
DebugLnEnter(DBG_VERBOSE, '!!! TLldbDebugger.Done;');
// TODO: cancel all commands
TerminateLldb;
inherited Done;
DebugLnExit('!!! TLldbDebugger.Done;');
DebugLnExit(DBG_VERBOSE, '!!! TLldbDebugger.Done;');
end;
class function TLldbDebugger.RequiredCompilerOpts(ATargetCPU, ATargetOS: String