Debugging¶
Important
The official docs by Michaël Van Canneyt and Florian Klämpfl on debugging; Debugging your Program.
Setup Debug and Release build profiles¶
Using the default configuration¶
- Open a new project in Lazarus IDE
- Go to Project | Options | Compiler Options
- In the Build modes (by default says default) click the
...
button. - In the Build Mode window, click Create Debug and Release modes button.
Once you've done that, you will see two new profiles; Debug
and Release
.
Important
Use the Debug
profile for debugging and detecting heap memory leaks.
Use Release
for production.
Create additional build profiles¶
See this page; https://wiki.lazarus.freepascal.org/IDE_Window:__Compiler_Options#Build_modes
Where are the debug switches?¶
- Press Ctrl+Shift+F11 to open Project Options window.
- Choosing Debugging from the left hand side menu will reveal more switches as shown below.
What if I run without setting up Debug and Release build profiles?¶
When you run a code first time using the default build mode, you will see the following dialogue box.
Hit the Ok button for now, but remember to setup your build profiles later.