[R] R and gdb (still)

Pierre-Andre Cornillon pac at Uhb.Fr
Tue Jan 21 17:41:08 CET 2003


Hello,

thanks for all your answers,

1) for the method proposed by Mr Douglas Bates, I don't know if I really
understood everything as the detailed sections are not those which give me
problems. Let me recall what i have done :
in window A :
$ R
... R banner ...
> dyn.load("foo.so")
>

in window B :
$ ps -ux pac | grep R.bin ### -> gives me pid.number
$ gdb /usr/local/lib/R/bin/R.bin
.... gdb banner ....
(gdb) attach  pid.number
Attaching to program: /usr/local/lib/R/bin/R.bin, process 20266
Reading symbols from /usr/lib/libblas.so.3...done.
... etc ...
Reading symbols from /home/pac/foo.so...done.
Loaded symbols for /home/pac/foo.so
0x703346f8 in select () from /lib/libc.so.6
(gdb) b foo.c:21
Breakpoint 1 at 0x705c6004: file foo.c, line 21.
(gdb)  signal 0
Continuing with no signal.

I return to window A which is now active
> foo(Xcr)
gives me directly the result without stopping at the breakpoint -> the
same result as
$ R -d gdb
...
But may be I misunderstood your method somewhere (I am not a
programmer nor a native english speaker)

Thanks for recalling me to ess too but as I ran it from within emacs and
it locks from time to time emacs, I stopped using it except for simple
computations. I wonder if it is better within xemacs ?
gud, well I don't know what it is but breakpoints first...
---------------------------

2) for the method proposed by Mr Robert Gentleman,
$ R -d ddd

In ddd windows:
- Menu program / Run in execution windows
- Run (in the toolbar DDD)

In DDD: Execution Window (ie an xterm -e R)
> dyn.load("foo.so")

In ddd windows:
- Interrupt (in the toolbar DDD) - (or C-c in gdb)
(gdb) b foo.c:21  (in gdb subwindow) - (or Source menu / breakpoints)
- Cont - (or signal 0 in gdb subwindows)

In DDD: Execution Window (now active)
> foo(Xcr)
... gives the result without stopping at the breakpoint
But may be I misunderstood your method somewhere (I am not a
programmer nor  a native english speaker)

But as it is a gui of gdb I think this has to give the same result
(but who knows... in computer science sometimes switch off/switch on
gives good results, sometimes). But thanks a lot for introducing me to
ddd, this seems fine and pretty.


3) As the same programs with quite the same operating system (linux
sparc and linux PC) and software
gives different results may be is there any test which I can run on other
program than R to know if it is R-1.6.2 on sparc or gdb 5.2.1 which have some
problems. I just recall that i have already done simple test with gdb.

Thanks for all, and if any (even slight) hints...

Pierre-Andre Cornillon




More information about the R-help mailing list