added warning for setting breakpoint, when no debugger is specified

git-svn-id: trunk@8284 -
This commit is contained in:
mattias 2005-12-09 10:13:28 +00:00
parent 61d3fe6aa4
commit 6a279a35e4
4 changed files with 27 additions and 8 deletions

View File

@ -96,8 +96,8 @@ type
function Evaluate(const AExpression: String; var AResult: String
): Boolean; virtual; abstract; // Evaluates the given expression, returns true if valid
function DoCreateBreakPoint(const AFilename: string; ALine: integer
): TModalResult; virtual; abstract;
function DoCreateBreakPoint(const AFilename: string; ALine: integer;
WarnIfNoDebugger: boolean): TModalResult; virtual; abstract;
function DoDeleteBreakPoint(const AFilename: string; ALine: integer
): TModalResult; virtual; abstract;
function DoDeleteBreakPointAtMark(const ASourceMark: TSourceMark

View File

@ -138,7 +138,7 @@ type
procedure ClearDebugOutputLog;
function InitDebugger: Boolean; override;
function DoPauseProject: TModalResult; override;
function DoStepIntoProject: TModalResult; override;
function DoStepOverProject: TModalResult; override;
@ -152,8 +152,8 @@ type
function Evaluate(const AExpression: String;
var AResult: String): Boolean; override;
function DoCreateBreakPoint(const AFilename: string;
ALine: integer): TModalResult; override;
function DoCreateBreakPoint(const AFilename: string; ALine: integer;
WarnIfNoDebugger: boolean): TModalResult; override;
function DoDeleteBreakPoint(const AFilename: string;
ALine: integer): TModalResult; override;
@ -1647,6 +1647,7 @@ begin
then begin
if FDebugger <> nil
then FreeDebugger;
DebugLn('TDebugManager.InitDebugger debugger class not found');
Exit;
end;
@ -1834,8 +1835,21 @@ begin
end;
function TDebugManager.DoCreateBreakPoint(const AFilename: string;
ALine: integer): TModalResult;
ALine: integer; WarnIfNoDebugger: boolean): TModalResult;
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);
Result := mrOK
end;

View File

@ -2070,6 +2070,11 @@ resourcestring
lisTheFileWasNotFoundDoYouWantToLocateItYourself = 'The file %s%s%s%swas '
+'not found.%sDo you want to locate it yourself ?%s';
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';
lisTheLaunchingApplicationDoesNotExistsOrIsNotExecuta = 'The launching '
+'application %s%s%'

View File

@ -1748,7 +1748,7 @@ begin
// find breakpoint mark at line
BreakPtMark := SourceEditorMarks.FindBreakPointMark(FEditor,Line);
if BreakPtMark = nil then
DebugBoss.DoCreateBreakPoint(Filename,Line)
DebugBoss.DoCreateBreakPoint(Filename,Line,true)
else
DebugBoss.DoDeleteBreakPointAtMark(BreakPtMark);
end;
@ -4453,7 +4453,7 @@ begin
ASrcEdit:=GetActiveSE;
if ASrcEdit=nil then exit;
DebugBoss.DoCreateBreakPoint(ASrcEdit.Filename,
ASrcEdit.EditorComponent.CaretY);
ASrcEdit.EditorComponent.CaretY,true);
end;
procedure TSourceNotebook.CompleteCodeMenuItemClick(Sender: TObject);