Compiler debug build

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Compiler debug build

denisgolovan
Hi all

Currently I am debugging a nasty shared memory bug.
More specifically it's related to memory allocator, though not directly.

More to the point - lack of backtraces is really tough - Lazarus debugger just shows one level.
Upon some investigation I managed to get much more meaningful backtraces.
However the only way to enable them which I found is manually editing root Makefile.fpc and removing all RELEASE directives (giving executing make DEBUG=1 does not help) and compiler rebuild to avoid -O2 optimizations.

So the question is why it's so difficult to build fpc compiler/rtl in debug mode?
Is it possible to fix? Or maybe I miss some official way?

--
Regards,
Denis Golovan
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compiler debug build

Maciej Izak
2017-07-22 19:05 GMT+02:00 denisgolovan <[hidden email]>:
So the question is why it's so difficult to build fpc compiler/rtl in debug mode?
Is it possible to fix? Or maybe I miss some official way?

You don't need to edit Makefile.fpc. When I need debug info for rtl and packages I use this:

make clean all LINKSMART=1  CREATESMART=1  DEBUG=1 OPTIMIZE=0  OPT="-gl -gw -godwarfsets -O-1" 

--
Best regards,
Maciej Izak

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compiler debug build

denisgolovan
Thanks.
That's exactly what I need.


22.07.2017, 20:20, "Maciej Izak" <[hidden email]>:
2017-07-22 19:05 GMT+02:00 denisgolovan <[hidden email]>:
So the question is why it's so difficult to build fpc compiler/rtl in debug mode?
Is it possible to fix? Or maybe I miss some official way?

You don't need to edit Makefile.fpc. When I need debug info for rtl and packages I use this:

make clean all LINKSMART=1  CREATESMART=1  DEBUG=1 OPTIMIZE=0  OPT="-gl -gw -godwarfsets -O-1" 

--
Best regards,
Maciej Izak
,

_______________________________________________
fpc-pascal maillist - [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal



-- 
Regards,
Denis Golovan


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Loading...