DBG: add option to reset debugger after each run

git-svn-id: trunk@34925 -
This commit is contained in:
martin 2012-01-25 15:05:21 +00:00
parent ed35731fe8
commit 34c3888d83
6 changed files with 19 additions and 1 deletions

View File

@ -6411,6 +6411,7 @@ begin
end; end;
FFileName := AValue; FFileName := AValue;
// TODO: Why?
if (FFilename <> '') and (FState = dsIdle) and ChangeFileName if (FFilename <> '') and (FState = dsIdle) and ChangeFileName
then SetState(dsStop); then SetState(dsStop);
end; end;

View File

@ -131,6 +131,7 @@ inherited DebuggerGeneralOptionsFrame: TDebuggerGeneralOptionsFrame
Width = 519 Width = 519
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
AutoFill = True AutoFill = True
AutoSize = True
BorderSpacing.Top = 6 BorderSpacing.Top = 6
Caption = 'Debugger general options' Caption = 'Debugger general options'
ChildSizing.LeftRightSpacing = 6 ChildSizing.LeftRightSpacing = 6

View File

@ -155,6 +155,7 @@ procedure TDebuggerGeneralOptionsFrame.FetchDebuggerGeneralOptions;
begin begin
// IMPORTANT if more items are added the indexes must be updated here! // IMPORTANT if more items are added the indexes must be updated here!
gcbDebuggerGeneralOptions.Checked[0] := EnvironmentOptions.DebuggerShowStopMessage; gcbDebuggerGeneralOptions.Checked[0] := EnvironmentOptions.DebuggerShowStopMessage;
gcbDebuggerGeneralOptions.Checked[1] := EnvironmentOptions.DebuggerResetAfterRun;
end; end;
procedure TDebuggerGeneralOptionsFrame.FetchDebuggerSpecificOptions; procedure TDebuggerGeneralOptionsFrame.FetchDebuggerSpecificOptions;
@ -310,6 +311,7 @@ begin
gbAdditionalSearchPath.Caption := lisDebugOptionsFrmAdditionalSearchPath; gbAdditionalSearchPath.Caption := lisDebugOptionsFrmAdditionalSearchPath;
gcbDebuggerGeneralOptions.Caption := lisDebugOptionsFrmDebuggerGeneralOptions; gcbDebuggerGeneralOptions.Caption := lisDebugOptionsFrmDebuggerGeneralOptions;
gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmShowMessageOnStop); gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmShowMessageOnStop);
gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmResetDebuggerOnEachRun);
gbDebuggerSpecific.Caption := lisDebugOptionsFrmDebuggerSpecific; gbDebuggerSpecific.Caption := lisDebugOptionsFrmDebuggerSpecific;
end; end;
@ -337,6 +339,7 @@ begin
DebuggerSearchPath := TrimSearchPath(txtAdditionalPath.Text,''); DebuggerSearchPath := TrimSearchPath(txtAdditionalPath.Text,'');
// IMPORTANT if more items are added the indexes must be updated here! // IMPORTANT if more items are added the indexes must be updated here!
DebuggerShowStopMessage := gcbDebuggerGeneralOptions.Checked[0]; DebuggerShowStopMessage := gcbDebuggerGeneralOptions.Checked[0];
DebuggerResetAfterRun := gcbDebuggerGeneralOptions.Checked[1];
for i := 0 to FCurrentDebPropertiesList.Count - 1 do for i := 0 to FCurrentDebPropertiesList.Count - 1 do
SaveDebuggerProperties(FCurrentDebPropertiesList[i], SaveDebuggerProperties(FCurrentDebPropertiesList[i],

View File

@ -1156,6 +1156,7 @@ begin
FDebugger.ErrorStateInfo, ftError, [frStop]); FDebugger.ErrorStateInfo, ftError, [frStop]);
end; end;
dsStop: begin dsStop: begin
// TODO: TDebugger.SetFileName sets dsStop during startup (leading to OldState=dsIdle)
FPrevShownWindow:=0; FPrevShownWindow:=0;
if (OldState<>dsIdle) if (OldState<>dsIdle)
then begin then begin
@ -1168,7 +1169,11 @@ begin
if MsgResult=mrYesToAll then if MsgResult=mrYesToAll then
EnvironmentOptions.DebuggerShowStopMessage:=false; EnvironmentOptions.DebuggerShowStopMessage:=false;
end; end;
FDebugger.FileName := '';
if EnvironmentOptions.DebuggerResetAfterRun then
ResetDebugger
else
FDebugger.FileName := '';
if FDialogs[ddtAssembler] <> nil if FDialogs[ddtAssembler] <> nil
then TAssemblerDlg(FDialogs[ddtAssembler]).SetLocation(nil, 0); then TAssemblerDlg(FDialogs[ddtAssembler]).SetLocation(nil, 0);

View File

@ -175,6 +175,7 @@ type
TEnvironmentOptions = class(TAbstractIDEEnvironmentOptions) TEnvironmentOptions = class(TAbstractIDEEnvironmentOptions)
private private
FDebuggerResetAfterRun: boolean;
FFilename: string; FFilename: string;
FFileAge: longint; FFileAge: longint;
FFileHasChangedOnDisk: boolean; FFileHasChangedOnDisk: boolean;
@ -481,6 +482,8 @@ type
write SetDebuggerSearchPath; write SetDebuggerSearchPath;
property DebuggerShowStopMessage: boolean read FDebuggerShowStopMessage property DebuggerShowStopMessage: boolean read FDebuggerShowStopMessage
write FDebuggerShowStopMessage; write FDebuggerShowStopMessage;
property DebuggerResetAfterRun: boolean read FDebuggerResetAfterRun
write FDebuggerResetAfterRun;
property ShowCompileDialog: boolean read FShowCompileDialog property ShowCompileDialog: boolean read FShowCompileDialog
write FShowCompileDialog; write FShowCompileDialog;
property AutoCloseCompileDialog: boolean read FAutoCloseCompileDialog property AutoCloseCompileDialog: boolean read FAutoCloseCompileDialog
@ -1134,6 +1137,8 @@ begin
// Debugger General Options // Debugger General Options
DebuggerShowStopMessage:=XMLConfig.GetValue( DebuggerShowStopMessage:=XMLConfig.GetValue(
Path+'DebuggerOptions/ShowStopMessage/Value', True); Path+'DebuggerOptions/ShowStopMessage/Value', True);
DebuggerResetAfterRun :=XMLConfig.GetValue(
Path+'DebuggerOptions/DebuggerResetAfterRun/Value', False);
FDebuggerEventLogClearOnRun := XMLConfig.GetValue( FDebuggerEventLogClearOnRun := XMLConfig.GetValue(
Path+'Debugger/EventLogClearOnRun', True); Path+'Debugger/EventLogClearOnRun', True);
FDebuggerEventLogCheckLineLimit := XMLConfig.GetValue( FDebuggerEventLogCheckLineLimit := XMLConfig.GetValue(
@ -1464,6 +1469,8 @@ begin
FDebuggerFilename,''); FDebuggerFilename,'');
XMLConfig.SetDeleteValue(Path+'DebuggerOptions/ShowStopMessage/Value', XMLConfig.SetDeleteValue(Path+'DebuggerOptions/ShowStopMessage/Value',
FDebuggerShowStopMessage, True); FDebuggerShowStopMessage, True);
XMLConfig.SetDeleteValue(Path+'DebuggerOptions/DebuggerResetAfterRun/Value',
FDebuggerResetAfterRun, False);
SaveRecentList(XMLConfig,FDebuggerFileHistory, SaveRecentList(XMLConfig,FDebuggerFileHistory,
Path+'DebuggerFilename/History/'); Path+'DebuggerFilename/History/');
XMLConfig.SetDeleteValue(Path+'DebuggerSearchPath/Value', XMLConfig.SetDeleteValue(Path+'DebuggerSearchPath/Value',

View File

@ -4534,6 +4534,7 @@ resourcestring
lisDebugOptionsFrmAdditionalSearchPath = 'Additional search path'; lisDebugOptionsFrmAdditionalSearchPath = 'Additional search path';
lisDebugOptionsFrmDebuggerGeneralOptions = 'Debugger general options'; lisDebugOptionsFrmDebuggerGeneralOptions = 'Debugger general options';
lisDebugOptionsFrmShowMessageOnStop = 'Show message on stop'; lisDebugOptionsFrmShowMessageOnStop = 'Show message on stop';
lisDebugOptionsFrmResetDebuggerOnEachRun = 'Reset Debugger after each run';
lisDebugOptionsFrmDebuggerSpecific = 'Debugger specific options (depends on ' lisDebugOptionsFrmDebuggerSpecific = 'Debugger specific options (depends on '
+'type of debugger)'; +'type of debugger)';
lisDebugOptionsFrmEventLog = 'Event Log'; lisDebugOptionsFrmEventLog = 'Event Log';