Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-04

Debug and Release RTL & FCL side by side

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I sometimes hit a bug in my applications, but then there is no Stack Trace information, or simply something like 3 entries that don't give much information. See attached screenshot as an example. Apparently this is caused by the fact that I'm using a Release build of the RTL and FCL and the error was raised inside the RTL or FCL code.

So is there a recommended FPC setup having a Release and Debug RTL & FCL side by side. Then in my IDE of choice (or build scripts) I can switch between them as needed. I believe Delphi had a similar setup (or maybe it was only for the VCL), but its been too long since I really used Delphi to remember what Borland did.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

Tomas Hajny
to Graeme Geldenhuys

On Fri, April 29, 2016 11:20, Graeme Geldenhuys wrote:

Hi,

Show quoted text 11 lines
I sometimes hit a bug in my applications, but then there is no Stack Trace information, or simply something like 3 entries that don't give much information. See attached screenshot as an example. Apparently this is caused by the fact that I'm using a Release build of the RTL and FCL and the error was raised inside the RTL or FCL code. So is there a recommended FPC setup having a Release and Debug RTL & FCL side by side. Then in my IDE of choice (or build scripts) I can switch between them as needed. I believe Delphi had a similar setup (or maybe it was only for the VCL), but its been too long since I really used Delphi to remember what Borland did.

Obviously, you can have release and debug builds residing in different directories side by side (different location from other third party or your own units). Then depending on your tool of choice, you simply select the right configuration set when compiling and debugging. You can do this with the command line compiler (supplying different configuration files, possibly also having the common part of configuration shared using an include file), you can do that by using the text mode IDE, etc. Or did you mean something different?

Tomas

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys: I sometimes hit a bug in my applications, but then there is no Stack Trace information,…
Graeme Geldenhuys wrote 13 lines
Hi, I sometimes hit a bug in my applications, but then there is no Stack Trace information, or simply something like 3 entries that don't give much information. See attached screenshot as an example. Apparently this is caused by the fact that I'm using a Release build of the RTL and FCL and the error was raised inside the RTL or FCL code. So is there a recommended FPC setup having a Release and Debug RTL & FCL side by side. Then in my IDE of choice (or build scripts) I can switch between them as needed. I believe Delphi had a similar setup (or maybe it was only for the VCL), but its been too long since I really used Delphi to remember what Borland did.

There is none.

what you can do is create install debug versions of the RTL/package units under

/usr/local/lib/fpc/$fpcversion/units/debug/$fpctarget/

and then compile your program using -dDEBUGRTL, with in your .fpc.cfg

#ifdef DEBUGRTL
-Fu/usr/local/lib/fpc/$fpcversion//units/debug/$fpctarget/httpd22 -Fu/usr/local/lib/fpc/$fpcversion/units/debug/$fpctarget/* -Fu/usr/local/lib/fpc/$fpcversion/units/debug/$fpctarget/httpd22 #else
-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/httpd22 -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/httpd22 #endf

The compiler will then pick the debug versions of the RTL units.

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt
and then compile your program using -dDEBUGRTL, with in your .fpc.cfg

Ah perfect, that's exactly the information I was looking for. I was just file and wondering if I could play with the
RELEASE and DEBUG defines already in there.

Thanks for your help.

Regards,
Graeme

Reply by email