[R] R and gdb

Pierre-Andre Cornillon pac at Uhb.Fr
Mon Jan 20 14:17:03 CET 2003


I have some problem with setting breakpoints with gdb in order to debug
some shared library for R.
Classical use of gdb work well
gcc -g -o footest.o footest.c
gdb footest.o
b 2

but as i tried to use it with R :
$ R -d gdb
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
welcome to change it and/or distribute copies of it under certain
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
This GDB was configured as "sparc64-unknown-linux-gnu"...
(gdb) R
Starting program: /usr/local/lib/R/bin/R.bin

R : Copyright 2003, The R Development Core Team
Version 1.6.2  (2003-01-10)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type `license()' or `licence()' for distribution details.

R is a collaborative project with many contributors.
Type `contributors()' for more information.

Type `demo()' for some demos, `help()' for on-line help, or
`help.start()' for a HTML browser interface to help.
Type `q()' to quit R.

[Previously saved workspace restored]

> dyn.load("foo.so")
 "I type Control-C here"
Program received signal SIGINT, Interrupt.
0x703346f8 in select () from /lib/libc.so.6
(gdb) b foo.c:44
Breakpoint 1 at 0x705c62a4: file plssvd.c, line 44.
(gdb) signal 0
Continuing with no signal.

gives directly the final result without stopping at the breakpoints.

I tried to update R
from 1.6.1 to 1.62
and I tried to update gdb too (up to  5.2.1, the 5.3 version doesn't
compile smoothly on my platform)
-> nothing change

my system:
Ultrasparc 10, sparc Gnu-Linux Suse 7-3, gcc 2-95-3
kernel 2.4.14 (Suse standard)

Note that setting the same breakpoint with the same program on a
Pentium IV, Gnu-Linux Suse 7-3, gcc 2-95-3
kernel 2.4.14 (Suse standard) works perfectly...

Does anybody have some hints on this topic?

Pierre-Andre Cornillon

PS I do not compile with optimization option as sometimes gdb have some
trouble to set the breakpoints at the chosen line

More information about the R-help mailing list