From murdoch.duncan at gmail.com  Thu Apr 11 14:01:36 2013
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Thu, 11 Apr 2013 08:01:36 -0400
Subject: [Rd] Trying to make DEBUG=T a debug version of R
In-Reply-To: <BLU174-W18E6D6CCB80C76D1B012C39CC00@phx.gbl>
References: <BLU174-W18E6D6CCB80C76D1B012C39CC00@phx.gbl>
Message-ID: <5166A620.3090103@gmail.com>

On 13-04-10 8:02 PM, Andre Mikulec wrote:
> Hi,
>
> I am trying to make a debug version of R ( for use with gdb later ) on windows.
>
> I am executing the following.
>
> src\gnuwin32>make clean
> src\gnuwin32>make DEBUG=T
>
> In the output, I see many
>
> -O3 flags
>
> I do not see any
>
>   -g -O0 flags
>
> which ( I believe/I think ) that is what I need to debug R in gdb.
>
> What is the proper way to 'make' a 'Debug version of R'?

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



[Rd] Trying to make DEBUG=T a debug version of R
Duncan Murdoch