On 24/11/2019 18:27, Bo Berglund via lazarus wrote:
On Sun, 24 Nov 2019 14:46:11 +0100, Martin Frb via lazarus
<lazarus@lists.lazarus-ide.org> wrote:

On 24/11/2019 10:22, Bo Berglund via lazarus wrote:
On Sun, 24 Nov 2019 03:21:11 +0100, Martin Frb via lazarus
<lazarus@lists.lazarus-ide.org> wrote:
If you can.... Run your Lazarus in gdb.
     gdb path/to/lazarus

and then in gdb hit r and return.
I can use different versions on the same system. So the command to
start lazarus in the desktop file is:

Exec=/home/pi/dev/lazarus/2.0.6/startlazarus
--pcp=/home/pi/.lazarus_2.0.6 %f

What should I do in order to make this work through gdb?
gdb path/to/lazarus
r  --pcp=/home/pi/.lazarus_2.0.6

path/to would be either
- if writeable: /home/pi/dev/lazarus/2.0.6/
- otherwise /home/user/.lazarus_2.0.6/
I tried but....
pi@rpi4-gui:~ $ gdb /home/pi/dev/lazarus/2.0.6/lazarus r
--pcp=/home/pi/.lazarus_2.0.6
gdb: unrecognized option '--pcp=/home/pi/.lazarus_2.0.6'
Use `gdb --help' for a complete list of options.
the "r --pcp=/home/pi/.lazarus_2.0.6" is only entered once gdb runs.

Gdb has an interactive console interface of its own.
Enter (in a terminal) "gdb /home/pi/dev/lazarus/2.0.6/lazarus " and you get a "(gdb)" prompt.
At this prompt you do enter the "r..."

(startlazarus is only needed for: restart and if your laz-install dir is
write-protected (admin install for all users). In the latter case the
rebuild IDE goes into the config path, so each user can have its own
rebuild.)
Does this mean that I should change the Exec in the desktop file
should be changed from startlazarus to simply lazarus?
In this case you can.
The entire lazarus is in your home directory. So
- no one else is using it, and if they were they would use your build, and your config (rather than one install for many users, with a diff config for each user (and diff installed packages) - the directory is (I assume) writeable to the IDE, when it rebuilds. (I.e. the IDE runs as the user, who has write access).   Therefore the IDE should (for all I know) place its new build into this dir.

I generally do the same, and always start lazarus, never startlazarus. (the latter is still be called, if I restart the IDE from the menu)

-----
*nix is multi user. So the root user could install a lazarus accessible to all users. But users could not write to this directory. Each user then has its config in their home dir. And if they install a package it affects only the one user. The rebuild (which anyway can not be written to the main dir by this user) will then be placed in the personal config dir. Calling startlazarus in the main install dir, startlazarus will find the pcp, and check for a newer lazarus. If none found, it uses the lazarus from the install dir.

-------
If your install is for one user only, you can put the --pcp argument into the lazarus.cfg file (in the main install dir). This does not support multiple configs for multiple users. But if you have several installs in your home folder, then each of them can have such a lazarus.cfg file. The advantage is, that the config path will be found, even if you start lazarus or startlazarus (from that install folder in your home) without specifying an pcp argument.

All my installs have that, and I just open the folder and click the lazarus executable



--
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to