Forum > General

Compiling lazarus

<< < (2/4) > >>

duzenko:
If I run the project via F9 then all breakpoints get disabled
E.g. in TAboutForm.FormShow

duzenko:
Note that I have previously compiled lazarus from console
If I delete the .exe and try to compile from IDE, I get this error

[Window Title]
Nothing to do

[Content]
The project's compiler options has no compile command.
See Project / Compiler Options ... / Compilation

[Cancel] [Ignore]

Martin_fr:
To debug lazarus, open the project "ide/lazarus.lpi"

To compile lazarus use: Tools > Configure build Lazarus.
(Using compile or build for "ide/lazarus.lpi" does not work).

The "Configure build Lazarus" allows you to add options for the compilation.
For debugging
-O- -gw3 -gt -gh -gl -Criot -Sa -Si-

Optionally: -O-1
And if you debug with gdb instead of fpdebug, then instead of "-gw3" use: -gw -godwarfwithsets

Most packages follow the IDE compile settings  (FpDebug and LazDebuggerFp do).
For any package that does not, you need to apply the setting in the package's options.

If you want to debug FpDebug, open the files, and enable the {$INLINE off} at the top of each file.


After you compiled (depends on your OS and on write permissions to the install folder):

Check for "lazarus.new.exe".
Normally the IDE will rename the existing exe to ".old", but if that fails it compiles the new exe to a new name.

Then you need to restart the IDE to get the files renamed correctly.

Otherwise you can start the newly compiled exe, in the debugger, without needing to restart.

Or you can add an option to the compile settings, to create the exe with a completely diff name.
Then you need to adapt the project file, so the exe with your chosen name is run. (I never done that / so don't have details on this particular idea)

On linux, the new exe may be created in the "primary conf path" ~/.lazarus/
I have not tested on Linux, not sure if the "ide/lazarus.lpi" will start the exe from the installer or the PCP, when you press F9.


Well and once you build the exe, you can use "ide/lazarus.lpi" to debug it like any other project.

You may wont to open "Run params" from the run menu. Then you can add command line parameters for the "debug target IDE".
You can give it --primary-config-path=/home/NAME/.laz2conf
- And there you can make changes affecting only the debug target. (e.g. change the editor background or gutter color, so you know which editor belongs to which IDE).
- Also with this, different window locations (once you move them) are stored for your real IDE and your "debug target IDE".

And yes, you can debug some project inside your "debug target IDE". So that then your outer-most IDE, can debug the debugger in the "debug target IDE" while that debugger is debugging some project.

Martin_fr:
TProcessDebugger.ProcessRun

TProcessDebugger is "run without debugging".


Ideally you should set up a Lazarus from "git main" (daily development version).

For that you need to "git clone" our repo. There is a wiki page on that (IIRC "install from sources"). Not sure of the url.
For windows maybe: https://wiki.lazarus.freepascal.org/Installing_Lazarus_on_Windows => still  svn though, that is no longer correct.

And well, yes. There are changes to the debugger in git main already.

Btw: Your OS?

duzenko:
@Martin_fr
That works with some pain
However I'm not sure how I am supposed to generally use the version built from gitlab
The checked out version does not have fpc, gdb, etc
Do I need to check it out into the 'normal' directory or ???

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version