View Issue Details

IDProjectCategoryView StatusLast Update
0025997LazarusIDEpublic2014-04-11 22:58
ReporterAlexLAssigned ToMartin Friebe 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformallOSLinuxOS Version
Product Version1.0.12Product Build 
Target Version1.2.2Fixed in Version1.2.1 (SVN) 
Summary0025997: [Patch] No gdb settings by default
DescriptionGdb in Linux is not configured by default.
This is patch with fix.
Steps To Reproduce- run lazarus
- run debuger
- debuger is not configured, you can configure gdb in settings from menu of IDE, but this patch is for default settings for gdb.
TagsNo tags attached.
Fixed in Revision44687
LazTarget-
WidgetsetGTK 2
Attached Files
  • add_gdb_settings.patch (710 bytes)
    --- ./lazarus/tools/install/linux/environmentoptions.xml.orig	2012-08-28 17:38:35.000000000 +0000
    +++ ./lazarus/tools/install/linux/environmentoptions.xml	2012-10-12 12:33:19.000000000 +0000
    @@ -31,5 +31,15 @@
             <Item2 Value="/var/tmp/"/>
           </History>
         </TestBuildDirectory>
    +    <DebuggerFilename Value="/usr/bin/gdb">
    +      <History Count="3">
    +        <Item1 Value="/usr/bin/gdb"/>
    +        <Item2 Value="/usr/local/bin/gdb"/>
    +        <Item3 Value="/opt/fpc/gdb"/>
    +      </History>
    +    </DebuggerFilename> 
    +    <Debugger Class="TGDBMIDebugger" EventLogLineLimit="100">
    +      <WatchesDlg ColumnNameWidth="-1" ColumnValueWidth="-1"/>
    +    </Debugger>
       </EnvironmentOptions>
     </CONFIG>
    
  • lazarus_gdb.png (13,814 bytes)
    lazarus_gdb.png (13,814 bytes)

Activities

AlexL

2014-04-09 13:40

reporter  

add_gdb_settings.patch (710 bytes)
--- ./lazarus/tools/install/linux/environmentoptions.xml.orig	2012-08-28 17:38:35.000000000 +0000
+++ ./lazarus/tools/install/linux/environmentoptions.xml	2012-10-12 12:33:19.000000000 +0000
@@ -31,5 +31,15 @@
         <Item2 Value="/var/tmp/"/>
       </History>
     </TestBuildDirectory>
+    <DebuggerFilename Value="/usr/bin/gdb">
+      <History Count="3">
+        <Item1 Value="/usr/bin/gdb"/>
+        <Item2 Value="/usr/local/bin/gdb"/>
+        <Item3 Value="/opt/fpc/gdb"/>
+      </History>
+    </DebuggerFilename> 
+    <Debugger Class="TGDBMIDebugger" EventLogLineLimit="100">
+      <WatchesDlg ColumnNameWidth="-1" ColumnValueWidth="-1"/>
+    </Debugger>
   </EnvironmentOptions>
 </CONFIG>

Martin Friebe

2014-04-09 17:04

manager   ~0074233

IMHO the wrong place.

This should already be available:

class function TGDBMIDebugger.ExePaths: String;
begin
  {$IFdef MSWindows}
  Result := '$(LazarusDir)\mingw\$(TargetCPU)-$(TargetOS)\bin\gdb.exe;$(LazarusDir)\mingw\bin\gdb.exe;C:\lazarus\mingw\bin\gdb.exe';
  {$ELSE}
  Result := '/usr/bin/gdb;/usr/local/bin/gdb;/opt/fpc/gdb';
  {$ENDIF}
end;

I have to test, if and/or why this may not work

Juha Manninen

2014-04-09 22:59

developer   ~0074241

It is configured automatically for me in the Linux distros I have tried.
What is your distro?

Martin Friebe

2014-04-09 23:40

manager   ~0074242

In addition to Juha's question:

Just noticed you tested with 1.0.12. While it should work, please test with 1.2 or 1.3.

In order to simulate a new installation, please remove all old config files from ~/.lazarus (or from whatever you use as primary-config-path)

Then, please start the IDE from commandline, and copy all and any output and attach here.

Thanks

AlexL

2014-04-10 09:46

reporter  

lazarus_gdb.png (13,814 bytes)
lazarus_gdb.png (13,814 bytes)

AlexL

2014-04-10 09:49

reporter   ~0074254

Mageia Linux.
If to set breakpoint, then there is error message: lazarus_gdb.png

lazarus-1.0.12:

export LC_ALL=C; lazarus-ide
TMainIDE.ParseCmdLineOptions:
  PrimaryConfigPath="/home/user/.lazarus"
  SecondaryConfigPath="/etc/lazarus"
NOTE: codetools config file not found - using defaults
TFPCTargetConfigCache.NeedsUpdate TargetOS="" TargetCPU="" compiler file changed "/usr/bin/fpc" FileAge=1373200705 StoredAge=0
TFPCTargetConfigCache.Update /usr/bin/fpc TargetOS= TargetCPU= CompilerOptions= ExtraOptions= PATH=/usr/lib/magos/scripts:/usr/X11R6/bin:/usr/local/bin:/bin:/usr/bin:/usr/games:/usr/lib/qt4/bin:/home/user/bin:/usr/lib/ssh
RunTool /usr/bin/fpc -iWTOTP -Pi386 -Tlinux
RunTool /usr/bin/fpc -va -Pi386 -Tlinux compilertest.pas
TFPCTargetConfigCache.Update: has changed
TFPCTargetConfigCache.NeedsUpdate TargetOS="linux" TargetCPU="i386" compiler file changed "/usr/bin/fpc" FileAge=1373200705 StoredAge=0
TFPCTargetConfigCache.Update /usr/bin/fpc TargetOS=linux TargetCPU=i386 CompilerOptions= ExtraOptions=-Fr/usr/lib/lazarus/components/codetools/fpc.errore.msg PATH=/usr/lib/magos/scripts:/usr/X11R6/bin:/usr/local/bin:/bin:/usr/bin:/usr/games:/usr/lib/qt4/bin:/home/user/bin:/usr/lib/ssh
RunTool /usr/bin/fpc -iWTOTP -Pi386 -Tlinux -Fr/usr/lib/lazarus/components/codetools/fpc.errore.msg
RunTool /usr/bin/fpc -va -Pi386 -Tlinux -Fr/usr/lib/lazarus/components/codetools/fpc.errore.msg compilertest.pas
TFPCTargetConfigCache.Update: has changed
NOTE: help options config file not found - using defaults
TMainIDE.DoNewProject A
TFPCSrcScan.Execute START /usr/share/fpcsrc/
TFPCSrcScan.Execute found some files: True
ApplyFPCSrcFiles /usr/share/fpcsrc/ FileCount=6252
ApplyFPCSrcFiles SrcCache.Update ...
TFPCSourceCache.Update /usr/share/fpcsrc has changed.
ApplyFPCSrcFiles BuildBoss.RescanCompilerDefines ...
TFPCSrcScan.OnFilesGathered closing progress item ...
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TFPCSrcScan.OnFilesGathered END
AddComponent TButton Parent=Form1:TForm1 79,80,0,0
Parent is 'Form1:TForm1'
TMainIDE.OnPropHookPersistentAdded A Button1:TButton
TPkgManager.AddUnitDependenciesForComponentClasses Extending Uses unit1.pas StdCtrls
[TEventsCodeTool.CompleteComponent] CurComponent=Button1:TButton
TDesigner.InvokeComponentEditor A Button1:TButton
TDesigner.InvokeComponentEditor B TDefaultComponentEditor
TEventsCodeTool.PublishedMethodExists method not found Button1Click
TBuildManager.CheckIfProjectNeedsCompilation SrcFile outdated Project
TCompiler.Compile WorkingDir="/home/user/tmp/" CompilerFilename="/usr/bin/fpc" CompilerParams=" -MObjFPC -Scghi -O1 -g -gl -vewnhi -Filib/i386-linux -Fl/opt/gnome/lib -Fu/usr/lib/lazarus/lcl/units/i386-linux/gtk2 -Fu/usr/lib/lazarus/lcl/units/i386-linux -Fu/usr/lib/lazarus/components/lazutils/lib/i386-linux -Fu/usr/lib/lazarus/packager/units/i386-linux -FUlib/i386-linux/ -l -dLCL -dLCLgtk2 /home/user/tmp/project1.lpr"
[TCompiler.Compile] CmdLine="/usr/bin/fpc -MObjFPC -Scghi -O1 -g -gl -vewnhi -Filib/i386-linux -Fl/opt/gnome/lib -Fu/usr/lib/lazarus/lcl/units/i386-linux/gtk2 -Fu/usr/lib/lazarus/lcl/units/i386-linux -Fu/usr/lib/lazarus/components/lazutils/lib/i386-linux -Fu/usr/lib/lazarus/packager/units/i386-linux -FUlib/i386-linux/ -l -dLCL -dLCLgtk2 /home/user/tmp/project1.lpr"
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.6.2 [2013/07/07] for i386
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling /home/user/tmp/project1.lpr
Compiling unit1.pas
unit1.pas(16,28) Hint: Parameter "Sender" not used
Compiling resource lib/i386-linux/project1.or
Linking /home/user/tmp/project1
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
60 lines compiled, 1.6 sec
3 hint(s) issued
[TCompiler.Compile] end
[TMainIDE.DoRunProject] A
TMainIDE.DoInitProjectRun A True 0
TMainIDE.DoInitProjectRun B
TBuildManager.CheckIfProjectNeedsCompilation SrcFile outdated Project
TCompiler.Compile WorkingDir="/home/user/tmp/" CompilerFilename="/usr/bin/fpc" CompilerParams=" -MObjFPC -Scghi -O1 -g -gl -vewnhi -Filib/i386-linux -Fl/opt/gnome/lib -Fu/usr/lib/lazarus/lcl/units/i386-linux/gtk2 -Fu/usr/lib/lazarus/lcl/units/i386-linux -Fu/usr/lib/lazarus/components/lazutils/lib/i386-linux -Fu/usr/lib/lazarus/packager/units/i386-linux -FUlib/i386-linux/ -l -dLCL -dLCLgtk2 /home/user/tmp/project1.lpr"
[TCompiler.Compile] CmdLine="/usr/bin/fpc -MObjFPC -Scghi -O1 -g -gl -vewnhi -Filib/i386-linux -Fl/opt/gnome/lib -Fu/usr/lib/lazarus/lcl/units/i386-linux/gtk2 -Fu/usr/lib/lazarus/lcl/units/i386-linux -Fu/usr/lib/lazarus/components/lazutils/lib/i386-linux -Fu/usr/lib/lazarus/packager/units/i386-linux -FUlib/i386-linux/ -l -dLCL -dLCLgtk2 /home/user/tmp/project1.lpr"
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.6.2 [2013/07/07] for i386
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling /home/user/tmp/project1.lpr
Compiling unit1.pas
unit1.pas(16,28) Hint: Parameter "Sender" not used
Compiling resource lib/i386-linux/project1.or
Linking /home/user/tmp/project1
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
60 lines compiled, 1.6 sec
3 hint(s) issued
[TCompiler.Compile] end
TMainIDE.DoInitProjectRun ProgramFilename=/home/user/tmp/project1
[TDebugger.SetFileName] "/home/user/tmp/project1"
[TMainIDE.DoRunProject] B
[TMainIDE.DoRunProject] END
PR: /home/user/tmp/project1
[TDebugger.SetFileName] ""
Warning: SynEdit.Paint called during PaintLock
LAZARUS END - cleaning up ...
[TMainIDE.Destroy] A
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
TIDEProgressWindow.Notification 0
[TMainIDE.Destroy] B -> inherited Destroy... TMainIDE
[TMainIDE.Destroy] END

Martin Friebe

2014-04-10 14:08

manager   ~0074267

Did some further checks.

- The Windows code uses the same wrong environmentoptions.xml
- There is duplication (win only) of the default location in ide\initialsetupdlgs.pas

Instead it should on all OS call the gdbmi ExePath.

Martin Friebe

2014-04-11 22:58

manager   ~0074330

Please test and close if ok

Issue History

Date Modified Username Field Change
2014-04-09 13:40 AlexL New Issue
2014-04-09 13:40 AlexL File Added: add_gdb_settings.patch
2014-04-09 15:27 Zeljan Rikalo Assigned To => Martin Friebe
2014-04-09 15:27 Zeljan Rikalo Status new => assigned
2014-04-09 17:04 Martin Friebe Note Added: 0074233
2014-04-09 22:59 Juha Manninen Note Added: 0074241
2014-04-09 23:40 Martin Friebe LazTarget => -
2014-04-09 23:40 Martin Friebe Note Added: 0074242
2014-04-09 23:40 Martin Friebe Status assigned => feedback
2014-04-10 09:46 AlexL File Added: lazarus_gdb.png
2014-04-10 09:49 AlexL Note Added: 0074254
2014-04-10 09:49 AlexL Status feedback => assigned
2014-04-10 14:08 Martin Friebe Note Added: 0074267
2014-04-11 22:58 Martin Friebe Fixed in Revision => 44687
2014-04-11 22:58 Martin Friebe Note Added: 0074330
2014-04-11 22:58 Martin Friebe Status assigned => resolved
2014-04-11 22:58 Martin Friebe Fixed in Version => 1.2.1 (SVN)
2014-04-11 22:58 Martin Friebe Resolution open => fixed
2014-04-11 22:58 Martin Friebe Target Version => 1.2.2