diff --git a/ide/compileroptions.pp b/ide/compileroptions.pp index e75d15ca01..881bc9d8ae 100644 --- a/ide/compileroptions.pp +++ b/ide/compileroptions.pp @@ -2584,24 +2584,31 @@ begin if (UseLineInfoUnit) then switches := switches + ' -gl'; + { Use Heaptrc Unit } + if (UseHeaptrc) and (not (ccloNoLinkerOpts in Flags)) then + switches := switches + ' -gh'; + + { Generate code for Valgrind } + if (UseValgrind) and (not (ccloNoLinkerOpts in Flags)) then + switches := switches + ' -gv'; + + if (UseExternalDbgSyms) then + switches := switches + ' -Xg'; + + end + else begin + // no debug info wanted + + { Use Heaptrc Unit } + if (UseHeaptrc) and (not (ccloNoLinkerOpts in Flags)) then + switches := switches + ' -g-h'; // heaptrc, without -g + end; - - { Use Heaptrc Unit } - if (UseHeaptrc) and (not (ccloNoLinkerOpts in Flags)) then - switches := switches + ' -gh'; - - { Generate code for Valgrind } - if (UseValgrind) and (not (ccloNoLinkerOpts in Flags)) then - switches := switches + ' -gv'; - { Generate code gprof } if (GenGProfCode) then switches := switches + ' -pg'; - if (UseExternalDbgSyms) then - switches := switches + ' -Xg'; - { Strip Symbols } if (StripSymbols) and (not (ccloNoLinkerOpts in Flags)) then switches := switches + ' -Xs'; diff --git a/ide/frames/compiler_linking_options.lfm b/ide/frames/compiler_linking_options.lfm index 320cbd8918..4ecee7cbfc 100644 --- a/ide/frames/compiler_linking_options.lfm +++ b/ide/frames/compiler_linking_options.lfm @@ -5,12 +5,28 @@ inherited CompilerLinkingOptionsFrame: TCompilerLinkingOptionsFrame ClientWidth = 639 DesignLeft = 346 DesignTop = 181 - object grpLinkLibraries: TGroupBox[0] + object chkDebugGDB: TCheckBox[0] + Left = 6 + Height = 19 + Top = 6 + Width = 627 + Align = alTop + BorderSpacing.Around = 6 + Caption = 'chkDebugGDB' + OnChange = chkDebugGDBChange + TabOrder = 4 + end + object grpLinkLibraries: TGroupBox[1] + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = grpDebug2 + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom Left = 0 Height = 49 - Top = 234 + Top = 270 Width = 639 - Align = alTop + Anchors = [akTop, akLeft, akRight] AutoSize = True BorderSpacing.Top = 6 Caption = 'grpLinkLibraries' @@ -28,12 +44,17 @@ inherited CompilerLinkingOptionsFrame: TCompilerLinkingOptionsFrame TabOrder = 0 end end - object TargetSpecificsGrpBox: TGroupBox[1] + object TargetSpecificsGrpBox: TGroupBox[2] + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = grpLinkLibraries + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom Left = 0 Height = 49 - Top = 289 + Top = 325 Width = 639 - Align = alTop + Anchors = [akTop, akLeft, akRight] AutoSize = True BorderSpacing.Top = 6 Caption = 'TargetSpecificsGrpBox' @@ -51,12 +72,17 @@ inherited CompilerLinkingOptionsFrame: TCompilerLinkingOptionsFrame TabOrder = 0 end end - object grpOptions: TGroupBox[2] + object grpOptions: TGroupBox[3] + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = grpLinkLibraries + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom Left = 0 Height = 78 - Top = 344 + Top = 325 Width = 639 - Align = alTop + Anchors = [akTop, akLeft, akRight] AutoSize = True BorderSpacing.Top = 6 Caption = 'grpOptions' @@ -84,117 +110,82 @@ inherited CompilerLinkingOptionsFrame: TCompilerLinkingOptionsFrame Text = 'edtOptionsLinkOpt' end end - object grpDebugging: TGroupBox[3] + object grpDebugging: TGroupBox[4] + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = chkDebugGDB + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom Left = 0 - Height = 228 - Top = 0 + Height = 128 + Top = 31 Width = 639 - Align = alTop + Anchors = [akTop, akLeft, akRight] AutoSize = True Caption = 'grpDebugging' - ClientHeight = 210 + ClientHeight = 110 ClientWidth = 635 TabOrder = 3 - object chkDebugGDB: TCheckBox - AnchorSideLeft.Control = grpDebugging - AnchorSideTop.Control = grpDebugging - Left = 6 - Height = 19 - Top = 6 - Width = 97 - BorderSpacing.Around = 6 - Caption = 'chkDebugGDB' - OnChange = chkDebugGDBChange - TabOrder = 0 - end object chkUseLineInfoUnit: TCheckBox AnchorSideLeft.Control = grpDebugging AnchorSideTop.Control = dropDbgSymbolType AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = grpDebugging + AnchorSideRight.Side = asrBottom Left = 6 Height = 19 - Top = 60 - Width = 123 + Top = 35 + Width = 623 + Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 Caption = 'chkUseLineInfoUnit' - TabOrder = 1 - end - object chkUseHeaptrc: TCheckBox - AnchorSideLeft.Control = grpDebugging - AnchorSideTop.Control = chkUseLineInfoUnit - AnchorSideTop.Side = asrBottom - Left = 6 - Height = 19 - Top = 85 - Width = 100 - BorderSpacing.Around = 6 - Caption = 'chkUseHeaptrc' - TabOrder = 2 + TabOrder = 0 end object chkUseValgrind: TCheckBox AnchorSideLeft.Control = grpDebugging - AnchorSideTop.Control = chkUseHeaptrc + AnchorSideTop.Control = chkUseLineInfoUnit AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = grpDebugging + AnchorSideRight.Side = asrBottom Left = 6 Height = 19 - Top = 110 - Width = 102 + Top = 60 + Width = 623 + Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 Caption = 'chkUseValgrind' - TabOrder = 3 - end - object chkGenGProfCode: TCheckBox - AnchorSideLeft.Control = grpDebugging - AnchorSideTop.Control = chkUseValgrind - AnchorSideTop.Side = asrBottom - Left = 6 - Height = 19 - Top = 135 - Width = 118 - BorderSpacing.Around = 6 - Caption = 'chkGenGProfCode' - TabOrder = 4 - end - object chkSymbolsStrip: TCheckBox - AnchorSideLeft.Control = grpDebugging - AnchorSideTop.Control = chkGenGProfCode - AnchorSideTop.Side = asrBottom - Left = 6 - Height = 19 - Top = 160 - Width = 108 - BorderSpacing.Around = 6 - Caption = 'chkSymbolsStrip' - TabOrder = 5 + TabOrder = 1 end object chkUseExternalDbgSyms: TCheckBox AnchorSideLeft.Control = grpDebugging - AnchorSideTop.Control = chkSymbolsStrip + AnchorSideTop.Control = chkUseValgrind AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = grpDebugging + AnchorSideRight.Side = asrBottom Left = 6 Height = 19 - Top = 185 - Width = 149 + Top = 85 + Width = 623 + Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 Caption = 'chkUseExternalDbgSyms' - TabOrder = 6 + TabOrder = 3 end object dropDbgSymbolType: TComboBox AnchorSideLeft.Control = lblDbgSymbolType AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = chkDebugGDB - AnchorSideTop.Side = asrBottom + AnchorSideTop.Control = lblEmpty AnchorSideRight.Control = grpDebugging AnchorSideRight.Side = asrBottom Left = 114 Height = 23 - Top = 31 + Top = 6 Width = 515 Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 ItemHeight = 15 Style = csDropDownList - TabOrder = 7 + TabOrder = 2 end object lblDbgSymbolType: TLabel AnchorSideLeft.Control = grpDebugging @@ -202,11 +193,75 @@ inherited CompilerLinkingOptionsFrame: TCompilerLinkingOptionsFrame AnchorSideTop.Side = asrCenter Left = 6 Height = 16 - Top = 34 + Top = 9 Width = 102 BorderSpacing.Around = 6 Caption = 'lblDbgSymbolType' ParentColor = False end + object lblEmpty: TLabel + Left = 0 + Height = 1 + Top = 0 + Width = 635 + Align = alTop + ParentColor = False + end + end + object grpDebug2: TGroupBox[5] + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = grpDebugging + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom + Left = 0 + Height = 99 + Top = 165 + Width = 639 + Anchors = [akTop, akLeft, akRight] + AutoSize = True + BorderSpacing.Top = 6 + Caption = 'grpDebug2' + ClientHeight = 81 + ClientWidth = 635 + TabOrder = 5 + object chkUseHeaptrc: TCheckBox + Left = 6 + Height = 19 + Top = 6 + Width = 623 + Align = alTop + BorderSpacing.Around = 6 + Caption = 'chkUseHeaptrc' + TabOrder = 0 + end + object chkGenGProfCode: TCheckBox + AnchorSideTop.Control = chkUseHeaptrc + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = grpDebug2 + AnchorSideRight.Side = asrBottom + Left = 6 + Height = 19 + Top = 31 + Width = 623 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Around = 6 + Caption = 'chkGenGProfCode' + TabOrder = 1 + end + object chkSymbolsStrip: TCheckBox + AnchorSideTop.Control = chkGenGProfCode + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = grpDebug2 + AnchorSideRight.Side = asrBottom + Left = 6 + Height = 19 + Top = 56 + Width = 623 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Around = 6 + Caption = 'chkSymbolsStrip' + TabOrder = 2 + end end end diff --git a/ide/frames/compiler_linking_options.pas b/ide/frames/compiler_linking_options.pas index 6e2e686d29..606aaa7ac4 100644 --- a/ide/frames/compiler_linking_options.pas +++ b/ide/frames/compiler_linking_options.pas @@ -25,9 +25,11 @@ type chkWin32GraphicApp: TCheckBox; dropDbgSymbolType: TComboBox; edtOptionsLinkOpt: TEdit; + grpDebug2: TGroupBox; grpDebugging: TGroupBox; grpLinkLibraries: TGroupBox; grpOptions: TGroupBox; + lblEmpty: TLabel; lblDbgSymbolType: TLabel; TargetSpecificsGrpBox: TGroupBox; procedure chkDebugGDBChange(Sender: TObject); @@ -76,8 +78,7 @@ end; procedure TCompilerLinkingOptionsFrame.chkDebugGDBChange(Sender: TObject); begin - dropDbgSymbolType.Enabled := chkDebugGDB.Checked; - chkUseLineInfoUnit.Enabled := chkDebugGDB.Checked; + grpDebugging.Enabled := chkDebugGDB.Checked; end; function TCompilerLinkingOptionsFrame.GetTitle: string; @@ -94,7 +95,9 @@ begin Caption := dlgCODebugging; end; - chkDebugGDB.Caption := dlgCOGDB + ' (-g)'; + grpDebug2.Caption := dlgCODebugging2; + + chkDebugGDB.Caption := dlgCOGDB; lblDbgSymbolType.Caption := dlgCOSymbolType; dropDbgSymbolType.Items.Clear; // Adjust constants above, if re-ordering @@ -147,8 +150,7 @@ begin grpOptions.Enabled := NeedsLinkerOpts; end; - dropDbgSymbolType.Enabled := chkDebugGDB.Checked; - chkUseLineInfoUnit.Enabled := chkDebugGDB.Checked; + grpDebugging.Enabled := chkDebugGDB.Checked; end; procedure TCompilerLinkingOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions); diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index e425dbafee..64ea38acc2 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -1824,7 +1824,8 @@ resourcestring dlgLevel3Opt = 'Level 3 (Level 2 + slow optimizations)'; dlgTargetOS = 'Target OS'; dlgTargetCPUFamily = 'Target CPU family'; - dlgCODebugging = 'Debugging:'; + dlgCODebugging = 'Debugging Info:'; + dlgCODebugging2 = 'Debugging:'; dlgCOGDB = 'Generate Debugging Info For GDB (Slower / Increases exe-size)'; dlgCOSymbolType = 'Chose type of debug info'; dlgCOSymbolTypeAuto = 'Automatic'; @@ -1834,7 +1835,7 @@ resourcestring dlgCOSymbolTypeDwarf3 = 'Dwarf3 (beta)'; dlgCODBX = 'Generate Debugging Info For DBX (Slows Compiling)'; dlgLNumsBct = 'Display Line Numbers in Run-time Error Backtraces'; - dlgCOHeaptrc = 'Use Heaptrc Unit'; + dlgCOHeaptrc = 'Use Heaptrc Unit (check for mem-leaks)'; dlgCOValgrind = 'Generate code for valgrind'; dlgGPROF = 'Generate code for gprof'; dlgCOStrip = 'Strip Symbols From Executable';