[R] Debugging with gdb
Lee, Han
Han.Lee at GeodeCapital.com
Wed Aug 30 22:45:12 CEST 2006
I tried to run gdb in linux with emacs
But could not even run a simple example in the writing extensions
tutorial.
The execution history is as follows.
Gdb worked fine for other debugging such as C++ codes.
Thanks
Han
I started R at echo of emacs by typing
(also tried other methods mentioned in the tutorial both in emacs and
xterm.)
M-x gdb ==> R -d gdb
(gdb) run
Starting program: /home/gcmio/local.20060808/lib/R/bin/exec/R -cd
/home/a409791/R/R-Test/ -fullname
[Thread debugging using libthread_db enabled]
[New Thread -1218514176 (LWP 11086)]
WARNING: unknown option '-cd'
ARGUMENT '/home/a409791/R/R-Test/' __ignored__
WARNING: unknown option '-fullname'
R : Copyright 2006, The R Foundation for Statistical Computing
Version 2.3.1 (2006-06-01)
ISBN 3-900051-07-0
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 and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
[Previously saved workspace restored]
>
Program received signal SIGINT, Interrupt.
[Switching to Thread -1218514176 (LWP 11086)]
0x00366c58 in ___newselect_nocancel () from /lib/tls/libc.so.6
(gdb) b do_get
Breakpoint 1 at 0x80ca4f5: file envir.c, line 1615.
(gdb) signal 0
Continuing with no signal.
> x <- 1
> get("x")
Breakpoint 1, do_get (call=0x9443878, op=0x934bd54, args=0x9416408,
rho=0x9417a54)
at envir.c:1615
1615 checkArity(op, args);
(gdb) p $1
History has not yet reached $1.
(gdb) p R_PV(x)
No symbol "x" in current context.
(gdb)
More information about the R-help
mailing list