From dmurdoch at pair.com  Thu Nov 27 06:13:16 2003
From: dmurdoch at pair.com (Duncan Murdoch)
Date: Thu Nov 27 06:11:55 2003
Subject: [Rd] Trap to debugger while running R in Windows
Message-ID: <jh1bsvk5i9lhf5119crhltjth65fj0inmb@4ax.com>

When debugging C or Fortran code in R, it's helpful to run R under a
debugger.  I use Insight, which is a wrapper for gdb.

One problem is that in Windows hitting break doesn't cause a trap to
gdb, so it can be hard to stop the process.

I've added a menu item to the r-devel version of Rgui (Misc|Break to
debugger) which triggers a trap to the external debugger.

Unfortunately, choosing this menu item crashes R if you're *not*
running under a debugger, so I haven't made it easy to see:  you need
to compile src/gnuwin32/rui.c with DEBUG=T in order to get it.

If anyone knows of code that traps to a debugger when one is present,
and is safely run when one is not, please let me know.

Duncan Murdoch


[Rd] Trap to debugger while running R in Windows
Duncan Murdoch