Skip to content
Prev 45542 / 63424 Next

Trying to make DEBUG=T a debug version of R

On 13-04-10 8:02 PM, Andre Mikulec wrote:
You don't need -O0 to debug in gdb, you just need the -g flag set 
properly, which DEBUG=T will do for you.  That's how I generally do it.

Setting -O0 might make debugging easier (because it eliminates 
optimizations).  To do that, you'll need to change the CFLAGS setting in 
src/gnuwin32/Makefiles.  (You may also be able to do it with a CFLAGS 
environment variable, I haven't tried.)  I don't usually do this, since 
it changes the code:  if you need gdb, chances are the bug is subtle, 
and its behaviour may change with optimization level.  But you may have 
a different preference.

Duncan Murdoch