mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 20:19:24 +02:00
IDE: debugger: set breakpoint check debug exe only if needed
git-svn-id: trunk@46936 -
This commit is contained in:
parent
800f8578fa
commit
599eb6c7ed
@ -182,6 +182,7 @@ type
|
|||||||
procedure ClearDebugEventsLog;
|
procedure ClearDebugEventsLog;
|
||||||
|
|
||||||
function InitDebugger(AFlags: TDbgInitFlags = []): Boolean; override;
|
function InitDebugger(AFlags: TDbgInitFlags = []): Boolean; override;
|
||||||
|
function DoSetBreakkPointWarnIfNoDebugger: boolean;
|
||||||
|
|
||||||
function DoPauseProject: TModalResult; override;
|
function DoPauseProject: TModalResult; override;
|
||||||
function DoShowExecutionPoint: TModalResult; override;
|
function DoShowExecutionPoint: TModalResult; override;
|
||||||
@ -2344,6 +2345,25 @@ begin
|
|||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TDebugManager.DoSetBreakkPointWarnIfNoDebugger: boolean;
|
||||||
|
var
|
||||||
|
DbgClass: TDebuggerClass;
|
||||||
|
begin
|
||||||
|
DbgClass:=FindDebuggerClass(EnvironmentOptions.DebuggerConfig.DebuggerClass);
|
||||||
|
if (DbgClass=nil)
|
||||||
|
or (DbgClass.HasExePath
|
||||||
|
and (not FileIsExecutableCached(EnvironmentOptions.GetParsedDebuggerFilename)))
|
||||||
|
then begin
|
||||||
|
if IDEQuestionDialog(lisDbgMangNoDebuggerSpecified,
|
||||||
|
Format(lisDbgMangThereIsNoDebuggerSpecifiedSettingBreakpointsHaveNo,[LineEnding]),
|
||||||
|
mtWarning, [mrCancel, mrIgnore, lisDbgMangSetTheBreakpointAnyway])
|
||||||
|
<>mrIgnore
|
||||||
|
then
|
||||||
|
exit(false);
|
||||||
|
end;
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
// still part of main, should go here when processdebugger is finished
|
// still part of main, should go here when processdebugger is finished
|
||||||
//
|
//
|
||||||
//function TDebugManager.DoRunProject: TModalResult;
|
//function TDebugManager.DoRunProject: TModalResult;
|
||||||
@ -2712,17 +2732,8 @@ function TDebugManager.DoCreateBreakPoint(const AFilename: string; ALine: intege
|
|||||||
WarnIfNoDebugger: boolean; out ABrkPoint: TIDEBreakPoint): TModalResult;
|
WarnIfNoDebugger: boolean; out ABrkPoint: TIDEBreakPoint): TModalResult;
|
||||||
begin
|
begin
|
||||||
ABrkPoint := nil;
|
ABrkPoint := nil;
|
||||||
if WarnIfNoDebugger
|
if WarnIfNoDebugger and not DoSetBreakkPointWarnIfNoDebugger then
|
||||||
and ((FindDebuggerClass(EnvironmentOptions.DebuggerConfig.DebuggerClass)=nil)
|
exit(mrCancel);
|
||||||
or (not FileIsExecutableCached(EnvironmentOptions.GetParsedDebuggerFilename)))
|
|
||||||
then begin
|
|
||||||
if IDEQuestionDialog(lisDbgMangNoDebuggerSpecified,
|
|
||||||
Format(lisDbgMangThereIsNoDebuggerSpecifiedSettingBreakpointsHaveNo,[LineEnding]),
|
|
||||||
mtWarning, [mrCancel, mrIgnore, lisDbgMangSetTheBreakpointAnyway])
|
|
||||||
<>mrIgnore
|
|
||||||
then
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
ABrkPoint := FBreakPoints.Add(AFilename, ALine);
|
ABrkPoint := FBreakPoints.Add(AFilename, ALine);
|
||||||
Result := mrOK;
|
Result := mrOK;
|
||||||
@ -2734,16 +2745,8 @@ begin
|
|||||||
LockCommandProcessing;
|
LockCommandProcessing;
|
||||||
try
|
try
|
||||||
ABrkPoint := nil;
|
ABrkPoint := nil;
|
||||||
if WarnIfNoDebugger
|
if WarnIfNoDebugger and not DoSetBreakkPointWarnIfNoDebugger then
|
||||||
and ((FindDebuggerClass(EnvironmentOptions.DebuggerConfig.DebuggerClass)=nil)
|
exit(mrCancel);
|
||||||
or (not FileIsExecutableCached(EnvironmentOptions.GetParsedDebuggerFilename)))
|
|
||||||
then begin
|
|
||||||
if IDEQuestionDialog(lisDbgMangNoDebuggerSpecified,
|
|
||||||
Format(lisDbgMangThereIsNoDebuggerSpecifiedSettingBreakpointsHaveNo,[LineEnding]),
|
|
||||||
mtWarning, [mrCancel, mrIgnore, lisDbgMangSetTheBreakpointAnyway])<>mrIgnore
|
|
||||||
then
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
ABrkPoint := FBreakPoints.Add(AnAddr);
|
ABrkPoint := FBreakPoints.Add(AnAddr);
|
||||||
Result := mrOK;
|
Result := mrOK;
|
||||||
|
Loading…
Reference in New Issue
Block a user