Recent

Author Topic: Raspberry Pi 3 - Lazarus has problem wit GDB debugger  (Read 8343 times)

kris

  • Jr. Member
  • **
  • Posts: 59
Raspberry Pi 3 - Lazarus has problem wit GDB debugger
« on: November 03, 2016, 04:08:57 am »
Apparently same problem as those guys had:
http://forum.lazarus-ide.org/index.php?topic=32289.0
http://forum.lazarus.freepascal.org/index.php?topic=6225.0

Steps to reproduce:
1. open a project (new or existing) and Run it
2. some warnings about crtopen.o not found, but apparently it doesn't matter
3. Compilahttp://forum.lazarus.freepascal.org/index.php?topic=6225.0tion successful
4. SIGSEGV exception right upon running

So the project compiles but cannot ever run from Lazarus IDE. You can go to the filder of your project though and run the compiled program manually.

The problem is definitely related to debugger, because if I disable the debugger entirely then I can run my progject from Lazarus IDE.

Common, googling shows plenty of people faced the same problem, but I found no answers.  It must be something about the debugger.


Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Raspberry Pi 3 - Lazarus has problem wit GDB debugger
« Reply #1 on: November 03, 2016, 09:10:09 am »
Probably forgot to build FPC /Lazarus with GDBMI=1
I am using a RPi3 as my main home machine for 3 months and never saw a sigsev from GDB itself.
« Last Edit: November 03, 2016, 09:12:30 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

kris

  • Jr. Member
  • **
  • Posts: 59
Re: Raspberry Pi 3 - Lazarus has problem wit GDB debugger
« Reply #2 on: November 03, 2016, 10:18:06 am »
I just did sudo apt-get install fpc lazarus. Will see if building it manually helps.

RPoseika

  • New member
  • *
  • Posts: 7
Re: Raspberry Pi 3 - Lazarus has problem wit GDB debugger
« Reply #3 on: November 08, 2016, 05:55:57 pm »
I have the same issue - if I detach the program from the IDE it runs
If I run the application by itself it runs.

I run the same application (re-compiled) under windows and I can debug it there and port it back to raspbian and recompile for that os

I am not a linux - raspbian get-apt expert
for example I do not know what "Probably forgot to build FPC /Lazarus with GDBMI=1" means.

I do love my raspberry though!  :D

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Raspberry Pi 3 - Lazarus has problem wit GDB debugger
« Reply #4 on: November 08, 2016, 06:14:15 pm »
Listen, I am running an RPi 3 as my main computer for four almost 5 months now with all trunks.
What exactly is the problem?

I am getting fed up with this. Are you all really Donald Trumps?

Am i the only one who read  docs?

 >:D >:D >:D >:D >:D >:D
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: Raspberry Pi 3 - Lazarus has problem wit GDB debugger
« Reply #5 on: November 08, 2016, 06:51:38 pm »
Am i the only one who read  docs?
Could be useful if you point to those docs and where it says "GDBMI=1" switch...

RPoseika

  • New member
  • *
  • Posts: 7
Re: Raspberry Pi 3 - Lazarus has problem wit GDB debugger
« Reply #6 on: November 09, 2016, 12:40:19 am »
Please be kind..
I only have had my raspberry for one week...

I had more problems with Lazarus from the package install on raspbian.  I could not add other packages a and got a variety of error messages.

Like I said. I am not a get-apt expert but I can read instructions.

I found details on how to install FPC 3.0.0 and lazarus 1.6RC2 and was quite happy with that result.
Then for some compiles  runs I got the error message and thought I could not run lazarus apps on my
raspberry...
Then it took me some time to find reference to the SIGILL error message on the internet and discovered that my applications run outside of the 'debugger'.

Yes if someone can 'point' me to further details that would be appreciated.

thanks in advance

kris

  • Jr. Member
  • **
  • Posts: 59
Re: Raspberry Pi 3 - Lazarus has problem wit GDB debugger
« Reply #7 on: November 09, 2016, 02:44:57 am »
Thaddy, building lazarus and then using or not using certain build flags is one thing. But installing a version from the repos is another. Why the version in the repos has been built without proper flags, if that is the issue.

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Raspberry Pi 3 - Lazarus has problem wit GDB debugger
« Reply #8 on: November 09, 2016, 03:32:52 am »
Am i the only one who read  docs?
Could be useful if you point to those docs and where it says "GDBMI=1" switch...
http://wiki.freepascal.org/FPC_New_Features_Trunk#GDB.2FMI_support

For some reason most RPi builds don't respect that. It should be respected. That's why I force it.
Read docs. By now it is default. Don't use old build scripts.
« Last Edit: November 09, 2016, 03:37:31 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: Raspberry Pi 3 - Lazarus has problem wit GDB debugger
« Reply #9 on: November 09, 2016, 06:26:55 am »
Am i the only one who read  docs?
Could be useful if you point to those docs and where it says "GDBMI=1" switch...
http://wiki.freepascal.org/FPC_New_Features_Trunk#GDB.2FMI_support

For some reason most RPi builds don't respect that. It should be respected. That's why I force it.
Read docs. By now it is default. Don't use old build scripts.
When I asked for documentation I meant documentation a normal user who doesn't use trunk would use when building Lazarus. Pointing to a paragraph about compiling trunk and complaining that everybody should read the docs... Well... That makes me grumpy  >:D

Where is this paragraph in the normal build-wikis??

Also... That paragraph seems to be about the text IDE (console) so how are we to know, from that simple tucked away paragraph, that that could be a problem in Lazarus?
« Last Edit: November 09, 2016, 06:31:02 am by rvk »

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Raspberry Pi 3 - Lazarus has problem wit GDB debugger
« Reply #10 on: November 09, 2016, 08:51:44 am »
Also... That paragraph seems to be about the text IDE (console) so how are we to know, from that simple tucked away paragraph, that that could be a problem in Lazarus?
Dunno. Ask Lazarus maintainers. Docs are docs.

You have a point in me using trunk, though. I should have been more clear.
- I use fpc 3.1.1 on RPi3 + Geany as editor. This is my default goto.
- I use Lazarus 1.7 + 3.0 on RPi3. This is for anything Laz related.
« Last Edit: November 09, 2016, 09:07:13 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

att2

  • Jr. Member
  • **
  • Posts: 52
Re: Raspberry Pi 3 - Lazarus has problem wit GDB debugger
« Reply #11 on: November 15, 2016, 02:31:28 pm »
Hello,
I have the same problem. I am currently sitting on a Bananapi-M3, (BPI-M3), trying to install Lazarus 1.6 and fpc 3.0.0 simply via "apt-get install". It seems to work, but every time I compile some code with Lazarus the debugger is the problem.
If the debugger option is activated, the compiled program never shows up.

I also tried to run Lazarus directly from shell, language set to english and this is the result:

pi@bpi-iot-ros-ai:~$ ./startlaz_engl.sh

TLazarusManager.Run starting /usr/lib/lazarus/1.6/lazarus ...
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/pi/.lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=arm-linux-qt New=arm-linux-qt FPC=True LCL=False
Note: (lazarus) Invalid Package Link: file "/usr/lib/lazarus/1.6/components/fpdebug/fpdebug.lpk" does not exist.
TLazSourceFileManager.LoadLFM Creating designer for hidden component of /home/pi/pro2/unit1.pas
TLazSourceFileManager.InitOpenedProjectFile select form in designer: Form1:TForm1 TDesigner
Hint: (lazarus) [TMainIDE.DoRunProject] INIT
Error: (lazarus) [TMainIDE.DoBuildProject] MainBuildBoss.DoCheckIfProjectNeedsCompilation nothing to be done
[TCmdLineDebugger] Debug PID: 1055
Hint: (lazarus) [TMainIDE.DoRunProject] Debugger=TGDBMIDebugger
Hint: (lazarus) [TMainIDE.DoRunProject] END
TGDBMIDebugger.StartDebugging WorkingDir="/home/pi/pro2/"

---------------

Ok so this wont work. I googled up for the missing fpdebug.lpk, found it somewhere on github, copy/pasted the file to /usr/lib/lazarus/1.6/components/fpdebug/fpdebug.lpk and got this:




pi@bpi-iot-ros-ai:~$ ./startlaz_engl.sh
 is a file
TLazarusManager.Run starting /usr/lib/lazarus/1.6/lazarus ...
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/pi/.lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=arm-linux-qt New=arm-linux-qt FPC=True LCL=False
TLazSourceFileManager.LoadLFM Creating designer for hidden component of /home/pi/pro2/unit1.pas
TLazSourceFileManager.InitOpenedProjectFile select form in designer: Form1:TForm1 TDesigner
Hint: (lazarus) [TMainIDE.DoRunProject] INIT
Hint: (lazarus) Project needs building: Src has changed Project /home/pi/pro2/unit1.pas
[TCompiler.Compile] CmdLine="/usr/bin/fpc  -MObjFPC -Scghi -Os -gw2 -godwarfsets -gl -l -vabq -Fi/home/pi/pro2/lib/arm-linux -Fu/usr/lib/lazarus/1.6/lcl/units/arm-linux/qt -Fu/usr/lib/lazarus/1.6/lcl/units/arm-linux -Fu/usr/lib/lazarus/1.6/components/lazutils/lib/arm-linux -Fu/usr/lib/lazarus/1.6/packager/units/arm-linux -Fu/home/pi/pro2/ -FU/home/pi/pro2/lib/arm-linux/ -dLCL -dLCLqt project1.lpr"
Info: (lazarus) Execute Title="Compile Project, Target: project1"
Info: (lazarus) Working Directory="/home/pi/pro2/"
Info: (lazarus) Executable="/usr/bin/fpc"
Info: (lazarus) Param[0]="-MObjFPC"
Info: (lazarus) Param[1]="-Scghi"
Info: (lazarus) Param[2]="-Os"
Info: (lazarus) Param[3]="-gw2"
Info: (lazarus) Param[4]="-godwarfsets"
Info: (lazarus) Param[5]="-gl"
Info: (lazarus) Param[6]="-l"
Info: (lazarus) Param[7]="-vabq"
Info: (lazarus) Param[8]="-Fi/home/pi/pro2/lib/arm-linux"
Info: (lazarus) Param[9]="-Fu/usr/lib/lazarus/1.6/lcl/units/arm-linux/qt"
Info: (lazarus) Param[10]="-Fu/usr/lib/lazarus/1.6/lcl/units/arm-linux"
Info: (lazarus) Param[11]="-Fu/usr/lib/lazarus/1.6/components/lazutils/lib/arm-linux"
Info: (lazarus) Param[12]="-Fu/usr/lib/lazarus/1.6/packager/units/arm-linux"
Info: (lazarus) Param[13]="-Fu/home/pi/pro2/"
Info: (lazarus) Param[14]="-FU/home/pi/pro2/lib/arm-linux/"
Info: (lazarus) Param[15]="-dLCL"
Info: (lazarus) Param[16]="-dLCLqt"
Info: (lazarus) Param[17]="project1.lpr"
[TCompiler.Compile] end
Hint: (lazarus) [TMainIDE.DoBuildProject] compiler time in s: 19.2770001478493
[TCmdLineDebugger] Debug PID: 1691
Hint: (lazarus) [TMainIDE.DoRunProject] Debugger=TGDBMIDebugger
Hint: (lazarus) [TMainIDE.DoRunProject] END
TGDBMIDebugger.StartDebugging WorkingDir="/home/pi/pro2/"
TCodeHelpManager.GetFPDocFilenameForSource Hint: Owner has no fpdoc paths: /home/pi/pro2/unit1.pas
### TCodeToolManager.HandleException: "identifier not found: Sender" at Line=17 Col=28 in "/home/pi/pro2/unit1.pas"

I am at a loss now. So what to do to get Lazarus 1.6 and fpc 3.0.0 to install properly, including the debugger?

 

TinyPortal © 2005-2018