Sign in Join

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

Mailing lists / fpc-pascal / 2017-07

Compiler debug build

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

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

Reply by email

Maciej Izak
to denisgolovan

2017-07-22 19:05 GMT+02:00 denisgolovan :

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

Reply by email