From 93e5aaa0f29ed592b6e3b3b126c53ef9e475e719 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 8 Jan 2022 17:33:45 +0100 Subject: [PATCH] Debugger: Fix compiler warnings --- components/debuggerintf/dbgintfdebuggerbase.pp | 2 +- components/lazdebuggergdbmi/gdbmidebugger.pp | 5 ----- .../lazdebuggers/lazdebuggerlldb/lldbdebugger.pas | 10 ++++------ components/lazdebuggers/lazdebuggerlldb/lldbhelper.pas | 2 +- .../lazdebuggers/lazdebuggerlldb/lldbinstructions.pas | 6 +----- 5 files changed, 7 insertions(+), 18 deletions(-) diff --git a/components/debuggerintf/dbgintfdebuggerbase.pp b/components/debuggerintf/dbgintfdebuggerbase.pp index d2f800e80d..878e40ea4c 100644 --- a/components/debuggerintf/dbgintfdebuggerbase.pp +++ b/components/debuggerintf/dbgintfdebuggerbase.pp @@ -6247,7 +6247,7 @@ var begin dummy.Code := nil; dummy.Data := nil; - ReqCmd(ACommand, AParams, dummy); + Result := ReqCmd(ACommand, AParams, dummy); end; class function TDebuggerIntf.GetSupportedCommands: TDBGCommands; diff --git a/components/lazdebuggergdbmi/gdbmidebugger.pp b/components/lazdebuggergdbmi/gdbmidebugger.pp index 4cf3ad5405..bd0dcff4f0 100644 --- a/components/lazdebuggergdbmi/gdbmidebugger.pp +++ b/components/lazdebuggergdbmi/gdbmidebugger.pp @@ -3091,8 +3091,6 @@ var end; procedure DoLogStream(const Line: String); - const - LogWarning = 'warning:'; var Warning: String; begin @@ -6485,12 +6483,9 @@ function TGDBMIDebuggerCommandExecute.ProcessStopped(const AParams: String; end; procedure CheckSehFinallyExited(const AFrame: String); - var - Location: TDBGLocationRec; begin if not (FStepStartedInFinSub = sfsStepStarted) then exit; - Location := FrameToLocation(AFrame); if IsSehFinallyFuncName(FTheDebugger.FCurrentLocation.FuncName) then // check if we left the seh handler exit; diff --git a/components/lazdebuggers/lazdebuggerlldb/lldbdebugger.pas b/components/lazdebuggers/lazdebuggerlldb/lldbdebugger.pas index a991fabe61..8c5ec6c5cb 100644 --- a/components/lazdebuggers/lazdebuggerlldb/lldbdebugger.pas +++ b/components/lazdebuggers/lazdebuggerlldb/lldbdebugger.pas @@ -181,6 +181,7 @@ type procedure TargetCreated(Sender: TObject); protected procedure DoInitialExecute; override; + public constructor Create(AOwner: TLldbDebugger); end; @@ -407,8 +408,9 @@ type private procedure ThreadInstructionSucceeded(Sender: TObject); protected - constructor Create(AOwner: TLldbDebugger); procedure DoExecute; override; + public + constructor Create(AOwner: TLldbDebugger); end; { TLldbThreads } @@ -570,7 +572,6 @@ end; procedure TLldbDebuggerCommandRun.CatchesStackInstructionFinished(Sender: TObject); var - Instr: TLldbInstruction; r: TStringArray; Id, line: Integer; IsCur: Boolean; @@ -973,7 +974,6 @@ const procedure DoBreakPointHit(BrkId: Integer); var - BreakPoint: TLldbBreakPoint; CanContinue: Boolean; begin CanContinue := Debugger.DoBreakpointHit(BrkId); @@ -1408,9 +1408,8 @@ end; procedure TLldbThreads.ReadFromThreadInstruction( Instr: TLldbInstructionThreadList; ACurrentId: Integer); var - i, j, line: Integer; + i, line: Integer; s, func, filename, name, d, fullfile: String; - found, foundFunc, foundArg: TStringArray; TId, CurThrId: LongInt; CurThr: Boolean; Arguments: TStringList; @@ -1506,7 +1505,6 @@ var Instr: TLldbInstructionStackTrace absolute Sender; i, FId, line: Integer; e: TCallStackEntry; - found, foundArg: TStringArray; Arguments: TStringList; It: TMapIterator; s, func, filename, d, fullfile: String; diff --git a/components/lazdebuggers/lazdebuggerlldb/lldbhelper.pas b/components/lazdebuggers/lazdebuggerlldb/lldbhelper.pas index 1a780fc621..0959d4b8bd 100644 --- a/components/lazdebuggers/lazdebuggerlldb/lldbhelper.pas +++ b/components/lazdebuggers/lazdebuggerlldb/lldbhelper.pas @@ -81,7 +81,7 @@ end; function StrMatches(AString: string; const AFind: array of string; out AGapsContent: TStringArray): Boolean; var - FindIdx, FindLen, j, j2, ResIdx: Integer; + FindIdx, FindLen, j, ResIdx: Integer; OpenEnd: Boolean; begin FindLen := Length(AFind); diff --git a/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas b/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas index d0ec28ffab..ab6166e6cf 100644 --- a/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas +++ b/components/lazdebuggers/lazdebuggerlldb/lldbinstructions.pas @@ -729,8 +729,6 @@ end; function TLldbInstructionProcessLaunch.ProcessInputFromDbg(const AData: String ): Boolean; -var - s: String; begin if StrStartsWith(AData, 'Process ') and (pos(' launched:', AData) > 8) then begin SetContentReceieved; @@ -1216,7 +1214,7 @@ function TLldbInstructionRegister.ProcessInputFromDbg(const AData: String var found: TStringArray; i: Integer; - s, reg, val: String; + reg, val: String; begin Result := False; if StrStartsWith(AData, Command) then begin @@ -1453,8 +1451,6 @@ begin end; function TLldbInstructionDisassem.ProcessInputFromDbg(const AData: String): Boolean; -var i: Integer; - Address: TDBGPtr; begin Result := False; if StrStartsWith(AData, Command) then begin