From bf6c6ba4d92d76b6962d7f238ed68ec8fc88b3b0 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 27 Sep 2022 12:08:30 +0200 Subject: [PATCH] Debugger: set default for "enable dwarf" dialog --- components/debuggerintf/dbgintfdebuggerbase.pp | 10 +++++++++- .../lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas | 1 + .../lazdebuggers/lazdebuggerfplldb/fplldbdebugger.pas | 1 + .../lazdebuggers/lazdebuggerlldb/lldbdebugger.pas | 2 +- ide/main.pp | 5 +++++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/components/debuggerintf/dbgintfdebuggerbase.pp b/components/debuggerintf/dbgintfdebuggerbase.pp index f7dec49639..2fc3a28d3d 100644 --- a/components/debuggerintf/dbgintfdebuggerbase.pp +++ b/components/debuggerintf/dbgintfdebuggerbase.pp @@ -1537,7 +1537,15 @@ type etWindowsMessageSent ); - TDebugCompilerRequirement = (dcrNoExternalDbgInfo, dcrExternalDbgInfoOnly, dcrDwarfOnly); + TDebugCompilerRequirement = ( + dcrNoExternalDbgInfo, + dcrExternalDbgInfoOnly, + dcrDwarfOnly, + + // preferred defaults + dcrPreferDwarf2Sets, + dcrPreferDwarf3 + ); TDebugCompilerRequirements = set of TDebugCompilerRequirement; TDBGFeedbackType = (ftInformation, ftWarning, ftError); diff --git a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas index 247378c3c3..980a4cbe7c 100644 --- a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas +++ b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas @@ -4569,6 +4569,7 @@ begin {$ELSE} Result:=[dcrDwarfOnly]; {$ENDIF} + Result := Result + [dcrPreferDwarf3]; end; class function TFpDebugDebugger.CreateProperties: TDebuggerProperties; diff --git a/components/lazdebuggers/lazdebuggerfplldb/fplldbdebugger.pas b/components/lazdebuggers/lazdebuggerfplldb/fplldbdebugger.pas index 78320ca646..9718d58439 100644 --- a/components/lazdebuggers/lazdebuggerfplldb/fplldbdebugger.pas +++ b/components/lazdebuggers/lazdebuggerfplldb/fplldbdebugger.pas @@ -1714,6 +1714,7 @@ begin Result:=[dcrNoExternalDbgInfo, dcrDwarfOnly]; {$ENDIF} {$ENDIF} + Result := Result + [dcrPreferDwarf3]; end; constructor TFpLldbDebugger.Create(const AExternalDebugger: String); diff --git a/components/lazdebuggers/lazdebuggerlldb/lldbdebugger.pas b/components/lazdebuggers/lazdebuggerlldb/lldbdebugger.pas index bf447ba220..b16c2ba741 100644 --- a/components/lazdebuggers/lazdebuggerlldb/lldbdebugger.pas +++ b/components/lazdebuggers/lazdebuggerlldb/lldbdebugger.pas @@ -3134,7 +3134,7 @@ end; class function TLldbDebugger.RequiredCompilerOpts(ATargetCPU, ATargetOS: String ): TDebugCompilerRequirements; begin - Result:=[dcrDwarfOnly]; + Result:=[dcrDwarfOnly, dcrPreferDwarf2Sets]; end; function TLldbDebugger.GetLocation: TDBGLocationRec; diff --git a/ide/main.pp b/ide/main.pp index bb8d4c9675..f021eb35d0 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -7347,6 +7347,11 @@ begin ModalResult := 400; Caption := lisTheProjectDoesNotUseDwarf_TaskDlg_NoDebugBtn_Caption; end; + if dcrPreferDwarf2Sets in ReqOpts then + ChangeDebugInfoFormatDialog.RadioButtons.DefaultButton := ChangeDebugInfoFormatDialog.RadioButtons[0] + else + if dcrPreferDwarf3 in ReqOpts then + ChangeDebugInfoFormatDialog.RadioButtons.DefaultButton := ChangeDebugInfoFormatDialog.RadioButtons[2]; ChangeDebugInfoFormatDialog.OnButtonClicked := @DlgDebugInfoHelpRequested;