mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 13:50:06 +02:00
LazDebuggerLldb: make debugln optional
git-svn-id: trunk@60643 -
This commit is contained in:
parent
6d0a2c7637
commit
a0c7eac2b7
@ -831,7 +831,7 @@ const
|
|||||||
i := pos('.', AReason);
|
i := pos('.', AReason);
|
||||||
if i = 0 then i := Length(AReason)+1;
|
if i = 0 then i := Length(AReason)+1;
|
||||||
Result := StrToIntDef(copy(AReason, 12, i-12), -1);
|
Result := StrToIntDef(copy(AReason, 12, i-12), -1);
|
||||||
debugln(['DoBreakPointHit ', AReason, ' / ', Result]);
|
debugln(DBG_VERBOSE, ['DoBreakPointHit ', AReason, ' / ', Result]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DoException;
|
procedure DoException;
|
||||||
@ -1025,7 +1025,7 @@ begin
|
|||||||
|
|
||||||
if Instr <> nil then begin
|
if Instr <> nil then begin
|
||||||
ALine := '';
|
ALine := '';
|
||||||
debugln(['Reading exception info']);
|
debugln(DBG_VERBOSE, ['Reading exception info']);
|
||||||
assert(InstructionQueue.RunningInstruction = nil, 'InstructionQueue.RunningInstruction = nil');
|
assert(InstructionQueue.RunningInstruction = nil, 'InstructionQueue.RunningInstruction = nil');
|
||||||
QueueInstruction(Instr);
|
QueueInstruction(Instr);
|
||||||
Instr.ReleaseReference;
|
Instr.ReleaseReference;
|
||||||
@ -1036,7 +1036,7 @@ begin
|
|||||||
// STEP 1: Process 10992 stopped
|
// STEP 1: Process 10992 stopped
|
||||||
if (FState = crRunning) and StrMatches(ALine, ['Process ', 'stopped']) then begin
|
if (FState = crRunning) and StrMatches(ALine, ['Process ', 'stopped']) then begin
|
||||||
FState := crReadingThreads;
|
FState := crReadingThreads;
|
||||||
debugln(['Reading thread info']);
|
debugln(DBG_VERBOSE, ['Reading thread info']);
|
||||||
FThreadInstr := TLldbInstructionThreadListReader.Create();
|
FThreadInstr := TLldbInstructionThreadListReader.Create();
|
||||||
FThreadInstr.OnSuccess := @ThreadInstructionSucceeded;
|
FThreadInstr.OnSuccess := @ThreadInstructionSucceeded;
|
||||||
QueueInstruction(FThreadInstr);
|
QueueInstruction(FThreadInstr);
|
||||||
@ -1046,7 +1046,7 @@ begin
|
|||||||
// STEP 2: * thread #1, stop reason = breakpoint 6.1
|
// STEP 2: * thread #1, stop reason = breakpoint 6.1
|
||||||
if StrMatches(ALine, ['* thread #', ', stop reason = ', ''], found) then begin
|
if StrMatches(ALine, ['* thread #', ', stop reason = ', ''], found) then begin
|
||||||
FState := crStopped;
|
FState := crStopped;
|
||||||
debugln(['Reading stopped thread']);
|
debugln(DBG_VERBOSE, ['Reading stopped thread']);
|
||||||
SetDebuggerLocation(0, 0, '', '', '', 0);
|
SetDebuggerLocation(0, 0, '', '', '', 0);
|
||||||
if StrStartsWith(found[1], 'breakpoint ') then begin
|
if StrStartsWith(found[1], 'breakpoint ') then begin
|
||||||
FCurBrkId := GetBreakPointId(found[1])
|
FCurBrkId := GetBreakPointId(found[1])
|
||||||
@ -1672,7 +1672,7 @@ var
|
|||||||
Instr: TLldbInstruction;
|
Instr: TLldbInstruction;
|
||||||
en: Boolean;
|
en: Boolean;
|
||||||
begin
|
begin
|
||||||
debugln(['TLldbBreakPoint.SetBreakPoint ']);
|
debugln(DBG_VERBOSE, ['TLldbBreakPoint.SetBreakPoint ']);
|
||||||
|
|
||||||
if FCurrentInstruction <> nil then begin
|
if FCurrentInstruction <> nil then begin
|
||||||
if (FBreakID <> 0) or (not FCurrentInstruction.IsRunning) then begin
|
if (FBreakID <> 0) or (not FCurrentInstruction.IsRunning) then begin
|
||||||
@ -1985,7 +1985,7 @@ end;
|
|||||||
|
|
||||||
procedure TLldbDebuggerCommandQueue.QueueCommand(AValue: TLldbDebuggerCommand);
|
procedure TLldbDebuggerCommandQueue.QueueCommand(AValue: TLldbDebuggerCommand);
|
||||||
begin
|
begin
|
||||||
debugln(['CommandQueue.QueueCommand ', AValue.ClassName]);
|
debugln(DBG_VERBOSE, ['CommandQueue.QueueCommand ', AValue.ClassName]);
|
||||||
Insert(Count, AValue);
|
Insert(Count, AValue);
|
||||||
Run;
|
Run;
|
||||||
end;
|
end;
|
||||||
@ -2016,7 +2016,7 @@ begin
|
|||||||
FRunningCommand := Items[0];
|
FRunningCommand := Items[0];
|
||||||
FRunningCommand.AddReference;
|
FRunningCommand.AddReference;
|
||||||
Delete(0);
|
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;
|
FRunningCommand.Execute;
|
||||||
// debugger and queue may get destroyed at the end of execute
|
// debugger and queue may get destroyed at the end of execute
|
||||||
end;
|
end;
|
||||||
@ -2025,10 +2025,10 @@ procedure TLldbDebuggerCommandQueue.CommandFinished(
|
|||||||
ACommand: TLldbDebuggerCommand);
|
ACommand: TLldbDebuggerCommand);
|
||||||
begin
|
begin
|
||||||
if FRunningCommand = ACommand then 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);
|
ReleaseRefAndNil(FRunningCommand);
|
||||||
end//;
|
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
|
if not(FDebugger.State in [dsError, dsDestroying, dsNone]) then
|
||||||
Run;
|
Run;
|
||||||
end;
|
end;
|
||||||
@ -2044,7 +2044,7 @@ begin
|
|||||||
while Count > 0 do
|
while Count > 0 do
|
||||||
Delete(0);
|
Delete(0);
|
||||||
if FRunningCommand <> nil then begin
|
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);
|
ReleaseRefAndNil(FRunningCommand);
|
||||||
end;
|
end;
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
@ -2068,12 +2068,12 @@ end;
|
|||||||
procedure TLldbDebuggerCommandQueue.LockQueueRun;
|
procedure TLldbDebuggerCommandQueue.LockQueueRun;
|
||||||
begin
|
begin
|
||||||
inc(FLockQueueRun);
|
inc(FLockQueueRun);
|
||||||
debugln(['TLldbDebuggerCommandQueue.LockQueueRun ',FLockQueueRun]);
|
debugln(DBG_VERBOSE, ['TLldbDebuggerCommandQueue.LockQueueRun ',FLockQueueRun]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLldbDebuggerCommandQueue.UnLockQueueRun;
|
procedure TLldbDebuggerCommandQueue.UnLockQueueRun;
|
||||||
begin
|
begin
|
||||||
debugln(['TLldbDebuggerCommandQueue.UnLockQueueRun ',FLockQueueRun]);
|
debugln(DBG_VERBOSE, ['TLldbDebuggerCommandQueue.UnLockQueueRun ',FLockQueueRun]);
|
||||||
dec(FLockQueueRun);
|
dec(FLockQueueRun);
|
||||||
if FLockQueueRun = 0 then Run;
|
if FLockQueueRun = 0 then Run;
|
||||||
end;
|
end;
|
||||||
@ -2603,7 +2603,7 @@ function TLldbDebugger.LldbRun: Boolean;
|
|||||||
var
|
var
|
||||||
Cmd: TLldbDebuggerCommandRunLaunch;
|
Cmd: TLldbDebuggerCommandRunLaunch;
|
||||||
begin
|
begin
|
||||||
DebugLn('*** Run');
|
DebugLn(DBG_VERBOSE, '*** Run');
|
||||||
Result := True;
|
Result := True;
|
||||||
|
|
||||||
if State in [dsPause, dsInternalPause, dsRun] then begin // dsRun in case of exception
|
if State in [dsPause, dsInternalPause, dsRun] then begin // dsRun in case of exception
|
||||||
@ -2690,7 +2690,7 @@ function TLldbDebugger.LldbStop: Boolean;
|
|||||||
var
|
var
|
||||||
Cmd: TLldbDebuggerCommandStop;
|
Cmd: TLldbDebuggerCommandStop;
|
||||||
begin
|
begin
|
||||||
DebugLn('*** Stop');
|
DebugLn(DBG_VERBOSE, '*** Stop');
|
||||||
Result := True;
|
Result := True;
|
||||||
|
|
||||||
CommandQueue.CancelAll;
|
CommandQueue.CancelAll;
|
||||||
@ -2726,7 +2726,7 @@ var
|
|||||||
Instr: TLldbInstruction;
|
Instr: TLldbInstruction;
|
||||||
s: String;
|
s: String;
|
||||||
begin
|
begin
|
||||||
debugln(['-----------------------------------------', AVariable]);
|
debugln(DBG_VERBOSE, ['-----------------------------------------', AVariable]);
|
||||||
if ASet then
|
if ASet then
|
||||||
Instr := TLldbInstructionSettingSet.Create('target.env-vars', AVariable, False, True)
|
Instr := TLldbInstructionSettingSet.Create('target.env-vars', AVariable, False, True)
|
||||||
else begin
|
else begin
|
||||||
@ -2828,7 +2828,7 @@ begin
|
|||||||
else
|
else
|
||||||
if (State = dsRun)
|
if (State = dsRun)
|
||||||
then begin
|
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;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2965,7 +2965,7 @@ end;
|
|||||||
|
|
||||||
destructor TLldbDebugger.Destroy;
|
destructor TLldbDebugger.Destroy;
|
||||||
begin
|
begin
|
||||||
debugln(['!!!!!!!!!!!!!!! TLldbDebugger.Destroy ']);
|
debugln(DBG_VERBOSE, ['!!!!!!!!!!!!!!! TLldbDebugger.Destroy ']);
|
||||||
FBreakErrorBreak.Remove;
|
FBreakErrorBreak.Remove;
|
||||||
FRunErrorBreak.Remove;
|
FRunErrorBreak.Remove;
|
||||||
FExceptionBreak.Remove;
|
FExceptionBreak.Remove;
|
||||||
@ -2999,12 +2999,12 @@ end;
|
|||||||
|
|
||||||
procedure TLldbDebugger.Done;
|
procedure TLldbDebugger.Done;
|
||||||
begin
|
begin
|
||||||
DebugLnEnter('!!! TLldbDebugger.Done;');
|
DebugLnEnter(DBG_VERBOSE, '!!! TLldbDebugger.Done;');
|
||||||
// TODO: cancel all commands
|
// TODO: cancel all commands
|
||||||
|
|
||||||
TerminateLldb;
|
TerminateLldb;
|
||||||
inherited Done;
|
inherited Done;
|
||||||
DebugLnExit('!!! TLldbDebugger.Done;');
|
DebugLnExit(DBG_VERBOSE, '!!! TLldbDebugger.Done;');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TLldbDebugger.RequiredCompilerOpts(ATargetCPU, ATargetOS: String
|
class function TLldbDebugger.RequiredCompilerOpts(ATargetCPU, ATargetOS: String
|
||||||
|
Loading…
Reference in New Issue
Block a user