mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 13:29:37 +02:00
added warning for setting breakpoint, when no debugger is specified
git-svn-id: trunk@8284 -
This commit is contained in:
parent
61d3fe6aa4
commit
6a279a35e4
@ -96,8 +96,8 @@ type
|
|||||||
function Evaluate(const AExpression: String; var AResult: String
|
function Evaluate(const AExpression: String; var AResult: String
|
||||||
): Boolean; virtual; abstract; // Evaluates the given expression, returns true if valid
|
): Boolean; virtual; abstract; // Evaluates the given expression, returns true if valid
|
||||||
|
|
||||||
function DoCreateBreakPoint(const AFilename: string; ALine: integer
|
function DoCreateBreakPoint(const AFilename: string; ALine: integer;
|
||||||
): TModalResult; virtual; abstract;
|
WarnIfNoDebugger: boolean): TModalResult; virtual; abstract;
|
||||||
function DoDeleteBreakPoint(const AFilename: string; ALine: integer
|
function DoDeleteBreakPoint(const AFilename: string; ALine: integer
|
||||||
): TModalResult; virtual; abstract;
|
): TModalResult; virtual; abstract;
|
||||||
function DoDeleteBreakPointAtMark(const ASourceMark: TSourceMark
|
function DoDeleteBreakPointAtMark(const ASourceMark: TSourceMark
|
||||||
|
@ -138,7 +138,7 @@ type
|
|||||||
procedure ClearDebugOutputLog;
|
procedure ClearDebugOutputLog;
|
||||||
|
|
||||||
function InitDebugger: Boolean; override;
|
function InitDebugger: Boolean; override;
|
||||||
|
|
||||||
function DoPauseProject: TModalResult; override;
|
function DoPauseProject: TModalResult; override;
|
||||||
function DoStepIntoProject: TModalResult; override;
|
function DoStepIntoProject: TModalResult; override;
|
||||||
function DoStepOverProject: TModalResult; override;
|
function DoStepOverProject: TModalResult; override;
|
||||||
@ -152,8 +152,8 @@ type
|
|||||||
function Evaluate(const AExpression: String;
|
function Evaluate(const AExpression: String;
|
||||||
var AResult: String): Boolean; override;
|
var AResult: String): Boolean; override;
|
||||||
|
|
||||||
function DoCreateBreakPoint(const AFilename: string;
|
function DoCreateBreakPoint(const AFilename: string; ALine: integer;
|
||||||
ALine: integer): TModalResult; override;
|
WarnIfNoDebugger: boolean): TModalResult; override;
|
||||||
|
|
||||||
function DoDeleteBreakPoint(const AFilename: string;
|
function DoDeleteBreakPoint(const AFilename: string;
|
||||||
ALine: integer): TModalResult; override;
|
ALine: integer): TModalResult; override;
|
||||||
@ -1647,6 +1647,7 @@ begin
|
|||||||
then begin
|
then begin
|
||||||
if FDebugger <> nil
|
if FDebugger <> nil
|
||||||
then FreeDebugger;
|
then FreeDebugger;
|
||||||
|
DebugLn('TDebugManager.InitDebugger debugger class not found');
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1834,8 +1835,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TDebugManager.DoCreateBreakPoint(const AFilename: string;
|
function TDebugManager.DoCreateBreakPoint(const AFilename: string;
|
||||||
ALine: integer): TModalResult;
|
ALine: integer; WarnIfNoDebugger: boolean): TModalResult;
|
||||||
begin
|
begin
|
||||||
|
if WarnIfNoDebugger
|
||||||
|
and ((FindDebuggerClass(EnvironmentOptions.DebuggerClass)=nil)
|
||||||
|
or (not FileIsExecutable(EnvironmentOptions.DebuggerFilename)))
|
||||||
|
then begin
|
||||||
|
if QuestionDlg(lisDbgMangNoDebuggerSpecified,
|
||||||
|
Format(lisDbgMangThereIsNoDebuggerSpecifiedSettingBreakpointsHaveNo, [#13]
|
||||||
|
),
|
||||||
|
mtWarning, [mrCancel, mrIgnore, lisDbgMangSetTheBreakpointAnyway], 0)
|
||||||
|
<>mrIgnore
|
||||||
|
then
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
FBreakPoints.Add(AFilename, ALine);
|
FBreakPoints.Add(AFilename, ALine);
|
||||||
Result := mrOK
|
Result := mrOK
|
||||||
end;
|
end;
|
||||||
|
@ -2070,6 +2070,11 @@ resourcestring
|
|||||||
lisTheFileWasNotFoundDoYouWantToLocateItYourself = 'The file %s%s%s%swas '
|
lisTheFileWasNotFoundDoYouWantToLocateItYourself = 'The file %s%s%s%swas '
|
||||||
+'not found.%sDo you want to locate it yourself ?%s';
|
+'not found.%sDo you want to locate it yourself ?%s';
|
||||||
lisRunToFailed = 'Run-to failed';
|
lisRunToFailed = 'Run-to failed';
|
||||||
|
lisDbgMangNoDebuggerSpecified = 'No debugger specified';
|
||||||
|
lisDbgMangThereIsNoDebuggerSpecifiedSettingBreakpointsHaveNo = 'There is no '
|
||||||
|
+'debugger specified.%sSetting breakpoints have no effect until you setup '
|
||||||
|
+'a Debugger in the debugger options dialog in the menu.';
|
||||||
|
lisDbgMangSetTheBreakpointAnyway = 'Set the breakpoint anyway';
|
||||||
lisLaunchingApplicationInvalid = 'Launching application invalid';
|
lisLaunchingApplicationInvalid = 'Launching application invalid';
|
||||||
lisTheLaunchingApplicationDoesNotExistsOrIsNotExecuta = 'The launching '
|
lisTheLaunchingApplicationDoesNotExistsOrIsNotExecuta = 'The launching '
|
||||||
+'application %s%s%'
|
+'application %s%s%'
|
||||||
|
@ -1748,7 +1748,7 @@ begin
|
|||||||
// find breakpoint mark at line
|
// find breakpoint mark at line
|
||||||
BreakPtMark := SourceEditorMarks.FindBreakPointMark(FEditor,Line);
|
BreakPtMark := SourceEditorMarks.FindBreakPointMark(FEditor,Line);
|
||||||
if BreakPtMark = nil then
|
if BreakPtMark = nil then
|
||||||
DebugBoss.DoCreateBreakPoint(Filename,Line)
|
DebugBoss.DoCreateBreakPoint(Filename,Line,true)
|
||||||
else
|
else
|
||||||
DebugBoss.DoDeleteBreakPointAtMark(BreakPtMark);
|
DebugBoss.DoDeleteBreakPointAtMark(BreakPtMark);
|
||||||
end;
|
end;
|
||||||
@ -4453,7 +4453,7 @@ begin
|
|||||||
ASrcEdit:=GetActiveSE;
|
ASrcEdit:=GetActiveSE;
|
||||||
if ASrcEdit=nil then exit;
|
if ASrcEdit=nil then exit;
|
||||||
DebugBoss.DoCreateBreakPoint(ASrcEdit.Filename,
|
DebugBoss.DoCreateBreakPoint(ASrcEdit.Filename,
|
||||||
ASrcEdit.EditorComponent.CaretY);
|
ASrcEdit.EditorComponent.CaretY,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceNotebook.CompleteCodeMenuItemClick(Sender: TObject);
|
procedure TSourceNotebook.CompleteCodeMenuItemClick(Sender: TObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user