mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 19:39:28 +02:00
Debugger: Option to autoclose the asm window, if it was auto-opened (break at no source line). Issue #027800
git-svn-id: trunk@58522 -
This commit is contained in:
parent
82ab3151e0
commit
62434fa788
@ -166,6 +166,7 @@ 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;
|
gcbDebuggerGeneralOptions.Checked[1] := EnvironmentOptions.DebuggerResetAfterRun;
|
||||||
|
gcbDebuggerGeneralOptions.Checked[2] := EnvironmentOptions.DebuggerAutoCloseAsm;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDebuggerGeneralOptionsFrame.FetchDebuggerSpecificOptions;
|
procedure TDebuggerGeneralOptionsFrame.FetchDebuggerSpecificOptions;
|
||||||
@ -333,6 +334,7 @@ begin
|
|||||||
gcbDebuggerGeneralOptions.Caption := lisDebugOptionsFrmDebuggerGeneralOptions;
|
gcbDebuggerGeneralOptions.Caption := lisDebugOptionsFrmDebuggerGeneralOptions;
|
||||||
gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmShowMessageOnStop);
|
gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmShowMessageOnStop);
|
||||||
gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmResetDebuggerOnEachRun);
|
gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmResetDebuggerOnEachRun);
|
||||||
|
gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmAutoCloseAsm);
|
||||||
gbDebuggerSpecific.Caption := lisDebugOptionsFrmDebuggerSpecific;
|
gbDebuggerSpecific.Caption := lisDebugOptionsFrmDebuggerSpecific;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -364,6 +366,7 @@ 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!
|
||||||
DebuggerShowStopMessage := gcbDebuggerGeneralOptions.Checked[0];
|
DebuggerShowStopMessage := gcbDebuggerGeneralOptions.Checked[0];
|
||||||
DebuggerResetAfterRun := gcbDebuggerGeneralOptions.Checked[1];
|
DebuggerResetAfterRun := gcbDebuggerGeneralOptions.Checked[1];
|
||||||
|
DebuggerAutoCloseAsm := gcbDebuggerGeneralOptions.Checked[2];
|
||||||
|
|
||||||
for i := 0 to FCurrentDebPropertiesList.Count - 1 do
|
for i := 0 to FCurrentDebPropertiesList.Count - 1 do
|
||||||
SaveDebuggerProperties(FCurrentDebPropertiesList[i],
|
SaveDebuggerProperties(FCurrentDebPropertiesList[i],
|
||||||
|
@ -95,6 +95,7 @@ type
|
|||||||
function DoProjectClose(Sender: TObject; AProject: TLazProject): TModalResult;
|
function DoProjectClose(Sender: TObject; AProject: TLazProject): TModalResult;
|
||||||
procedure DoProjectModified(Sender: TObject);
|
procedure DoProjectModified(Sender: TObject);
|
||||||
private
|
private
|
||||||
|
FAsmWindowShouldAutoClose: Boolean;
|
||||||
procedure BreakAutoContinueTimer(Sender: TObject);
|
procedure BreakAutoContinueTimer(Sender: TObject);
|
||||||
procedure OnRunTimer(Sender: TObject);
|
procedure OnRunTimer(Sender: TObject);
|
||||||
// Menu events
|
// Menu events
|
||||||
@ -1423,7 +1424,11 @@ begin
|
|||||||
FDebugger.FileName := ''; // SetState(dsIdle) via ResetStateToIdle
|
FDebugger.FileName := ''; // SetState(dsIdle) via ResetStateToIdle
|
||||||
|
|
||||||
if FDialogs[ddtAssembler] <> nil
|
if FDialogs[ddtAssembler] <> nil
|
||||||
then TAssemblerDlg(FDialogs[ddtAssembler]).SetLocation(nil, 0);
|
then begin
|
||||||
|
TAssemblerDlg(FDialogs[ddtAssembler]).SetLocation(nil, 0);
|
||||||
|
if FAsmWindowShouldAutoClose then
|
||||||
|
TAssemblerDlg(FDialogs[ddtAssembler]).Close;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
dsInit: begin
|
dsInit: begin
|
||||||
@ -1453,6 +1458,7 @@ var
|
|||||||
StackEntry: TIdeCallStackEntry;
|
StackEntry: TIdeCallStackEntry;
|
||||||
Flags: TJumpToCodePosFlags;
|
Flags: TJumpToCodePosFlags;
|
||||||
CurrentSourceUnitInfo: TDebuggerUnitInfo;
|
CurrentSourceUnitInfo: TDebuggerUnitInfo;
|
||||||
|
a: Boolean;
|
||||||
begin
|
begin
|
||||||
if (Sender<>FDebugger) or (Sender=nil) then exit;
|
if (Sender<>FDebugger) or (Sender=nil) then exit;
|
||||||
if FDebugger.State = dsInternalPause then exit;
|
if FDebugger.State = dsInternalPause then exit;
|
||||||
@ -1463,12 +1469,14 @@ begin
|
|||||||
CurrentSourceUnitInfo := nil;
|
CurrentSourceUnitInfo := nil;
|
||||||
|
|
||||||
if (SrcLine < 1) and (SrcLine <> -2) // TODO: this should move to the debugger
|
if (SrcLine < 1) and (SrcLine <> -2) // TODO: this should move to the debugger
|
||||||
|
// SrcLine will be -2 after stepping (gdbmi)
|
||||||
then begin
|
then begin
|
||||||
// jump to the deepest stack frame with debugging info
|
// jump to the deepest stack frame with debugging info
|
||||||
// TODO: Only below the frame supplied by debugger
|
// TODO: Only below the frame supplied by debugger
|
||||||
i:=0;
|
i:=0;
|
||||||
TId := Threads.CurrentThreads.CurrentThreadId;
|
TId := Threads.CurrentThreads.CurrentThreadId;
|
||||||
c := CallStack.CurrentCallStackList.EntriesForThreads[TId].CountLimited(30);
|
c := CallStack.CurrentCallStackList.EntriesForThreads[TId].CountLimited(30);
|
||||||
|
c := -1;
|
||||||
while (i < c) do
|
while (i < c) do
|
||||||
begin
|
begin
|
||||||
StackEntry := CallStack.CurrentCallStackList.EntriesForThreads[TId].Entries[i];
|
StackEntry := CallStack.CurrentCallStackList.EntriesForThreads[TId].Entries[i];
|
||||||
@ -1529,9 +1537,13 @@ begin
|
|||||||
|
|
||||||
if SrcLine < 1
|
if SrcLine < 1
|
||||||
then begin
|
then begin
|
||||||
|
a := FAsmWindowShouldAutoClose or (FDialogs[ddtAssembler] = nil) or (not FDialogs[ddtAssembler].Visible);
|
||||||
ViewDebugDialog(ddtAssembler);
|
ViewDebugDialog(ddtAssembler);
|
||||||
|
FAsmWindowShouldAutoClose := a and EnvironmentOptions.DebuggerAutoCloseAsm;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
if (FDialogs[ddtAssembler] <> nil) and FAsmWindowShouldAutoClose then
|
||||||
|
TAssemblerDlg(FDialogs[ddtAssembler]).Close;
|
||||||
|
|
||||||
Editor := nil;
|
Editor := nil;
|
||||||
if SourceEditorManager <> nil
|
if SourceEditorManager <> nil
|
||||||
@ -1602,6 +1614,8 @@ begin
|
|||||||
if Destroying then exit;
|
if Destroying then exit;
|
||||||
if (ADialogType = ddtPseudoTerminal) and not HasConsoleSupport
|
if (ADialogType = ddtPseudoTerminal) and not HasConsoleSupport
|
||||||
then exit;
|
then exit;
|
||||||
|
if ADialogType = ddtAssembler then
|
||||||
|
FAsmWindowShouldAutoClose := False;
|
||||||
if FDialogs[ADialogType] = nil
|
if FDialogs[ADialogType] = nil
|
||||||
then begin
|
then begin
|
||||||
CurDialog := TDebuggerDlg(DEBUGDIALOGCLASS[ADialogType].NewInstance);
|
CurDialog := TDebuggerDlg(DEBUGDIALOGCLASS[ADialogType].NewInstance);
|
||||||
|
@ -456,6 +456,7 @@ type
|
|||||||
|
|
||||||
TEnvironmentOptions = class(TIDEEnvironmentOptions)
|
TEnvironmentOptions = class(TIDEEnvironmentOptions)
|
||||||
private
|
private
|
||||||
|
FDebuggerAutoCloseAsm: boolean;
|
||||||
// config file
|
// config file
|
||||||
FFilename: string;
|
FFilename: string;
|
||||||
FFileAge: longint;
|
FFileAge: longint;
|
||||||
@ -797,6 +798,7 @@ type
|
|||||||
property DebuggerSearchPath: string read GetDebuggerSearchPath write SetDebuggerSearchPath;
|
property DebuggerSearchPath: string read GetDebuggerSearchPath write SetDebuggerSearchPath;
|
||||||
property DebuggerShowStopMessage: boolean read FDebuggerShowStopMessage write FDebuggerShowStopMessage;
|
property DebuggerShowStopMessage: boolean read FDebuggerShowStopMessage write FDebuggerShowStopMessage;
|
||||||
property DebuggerResetAfterRun: boolean read FDebuggerResetAfterRun write FDebuggerResetAfterRun;
|
property DebuggerResetAfterRun: boolean read FDebuggerResetAfterRun write FDebuggerResetAfterRun;
|
||||||
|
property DebuggerAutoCloseAsm: boolean read FDebuggerAutoCloseAsm write FDebuggerAutoCloseAsm;
|
||||||
// ShowCompileDialog and AutoCloseCompileDialog are currently not used.
|
// ShowCompileDialog and AutoCloseCompileDialog are currently not used.
|
||||||
// But maybe someone will implement them again. Keep them till 1.4.2
|
// But maybe someone will implement them again. Keep them till 1.4.2
|
||||||
property ShowCompileDialog: boolean read FShowCompileDialog write FShowCompileDialog;
|
property ShowCompileDialog: boolean read FShowCompileDialog write FShowCompileDialog;
|
||||||
@ -1955,6 +1957,7 @@ begin
|
|||||||
// Debugger General Options
|
// Debugger General Options
|
||||||
DebuggerShowStopMessage:=FXMLCfg.GetValue(Path+'DebuggerOptions/ShowStopMessage/Value', True);
|
DebuggerShowStopMessage:=FXMLCfg.GetValue(Path+'DebuggerOptions/ShowStopMessage/Value', True);
|
||||||
DebuggerResetAfterRun :=FXMLCfg.GetValue(Path+'DebuggerOptions/DebuggerResetAfterRun/Value', False);
|
DebuggerResetAfterRun :=FXMLCfg.GetValue(Path+'DebuggerOptions/DebuggerResetAfterRun/Value', False);
|
||||||
|
FDebuggerAutoCloseAsm :=FXMLCfg.GetValue(Path+'DebuggerOptions/DebuggerAutoCloseAsm/Value', False);
|
||||||
FDebuggerEventLogClearOnRun := FXMLCfg.GetValue(Path+'Debugger/EventLogClearOnRun', True);
|
FDebuggerEventLogClearOnRun := FXMLCfg.GetValue(Path+'Debugger/EventLogClearOnRun', True);
|
||||||
FDebuggerEventLogCheckLineLimit := FXMLCfg.GetValue(Path+'Debugger/EventLogCheckLineLimit', False);
|
FDebuggerEventLogCheckLineLimit := FXMLCfg.GetValue(Path+'Debugger/EventLogCheckLineLimit', False);
|
||||||
FDebuggerEventLogLineLimit := FXMLCfg.GetValue(Path+'Debugger/EventLogLineLimit', 1000);
|
FDebuggerEventLogLineLimit := FXMLCfg.GetValue(Path+'Debugger/EventLogLineLimit', 1000);
|
||||||
@ -2336,6 +2339,8 @@ begin
|
|||||||
FDebuggerShowStopMessage, True);
|
FDebuggerShowStopMessage, True);
|
||||||
FXMLCfg.SetDeleteValue(Path+'DebuggerOptions/DebuggerResetAfterRun/Value',
|
FXMLCfg.SetDeleteValue(Path+'DebuggerOptions/DebuggerResetAfterRun/Value',
|
||||||
FDebuggerResetAfterRun, False);
|
FDebuggerResetAfterRun, False);
|
||||||
|
FXMLCfg.SetDeleteValue(Path+'DebuggerOptions/DebuggerAutoCloseAsm/Value',
|
||||||
|
FDebuggerAutoCloseAsm, False);
|
||||||
SaveRecentList(FXMLCfg,FDebuggerFileHistory,Path+'DebuggerFilename/History/');
|
SaveRecentList(FXMLCfg,FDebuggerFileHistory,Path+'DebuggerFilename/History/');
|
||||||
FXMLCfg.SetDeleteValue(Path+'DebuggerSearchPath/Value',DebuggerSearchPath,'');
|
FXMLCfg.SetDeleteValue(Path+'DebuggerSearchPath/Value',DebuggerSearchPath,'');
|
||||||
FXMLCfg.SetDeleteValue(Path+'Debugger/EventLogClearOnRun',FDebuggerEventLogClearOnRun, True);
|
FXMLCfg.SetDeleteValue(Path+'Debugger/EventLogClearOnRun',FDebuggerEventLogClearOnRun, True);
|
||||||
|
@ -5259,6 +5259,7 @@ resourcestring
|
|||||||
lisDebugOptionsFrmDebuggerGeneralOptions = 'Debugger general options';
|
lisDebugOptionsFrmDebuggerGeneralOptions = 'Debugger general options';
|
||||||
lisDebugOptionsFrmShowMessageOnStop = 'Show message on stop';
|
lisDebugOptionsFrmShowMessageOnStop = 'Show message on stop';
|
||||||
lisDebugOptionsFrmResetDebuggerOnEachRun = 'Reset Debugger after each run';
|
lisDebugOptionsFrmResetDebuggerOnEachRun = 'Reset Debugger after each run';
|
||||||
|
lisDebugOptionsFrmAutoCloseAsm = 'Automatically close the assembler window, after source not found';
|
||||||
lisDebugOptionsFrmDebuggerSpecific = 'Debugger specific options (depends on '
|
lisDebugOptionsFrmDebuggerSpecific = 'Debugger specific options (depends on '
|
||||||
+'type of debugger)';
|
+'type of debugger)';
|
||||||
lisDebugOptionsFrmEventLog = 'Event Log';
|
lisDebugOptionsFrmEventLog = 'Event Log';
|
||||||
|
Loading…
Reference in New Issue
Block a user