[Rd] Am I missing something about debugging?

From: Ross Boylan <ross_at_biostat.ucsf.edu>
Date: Tue 02 Jan 2007 - 22:08:57 GMT


I would like to be able to trace execution into calls below the current function, or to follow execution as calls return. This is roughly the distinction between "step" and "next" in many debuggers.

I would also like to be able to switch to a location further up the call stack than the location at which I enter the debugger, to see the context of the current operations.

Are there ways to do these things with the R debugger? I've studied the man pages and FAQ's, and looked at the debug package, but I don't see a way except for manually calling debug on the function that is about to be called if I want to descend. That's quite awkward, particularly since it must be manually undone (the debug package may be better on that score). I'm also not entirely sure that such recursion
(essentially, debugging within the debugger) is OK.

I tried looking up the stack with things like sys.calls(), from within the browser, but they operated as if I were at the top level (e.g., sys.function(-1) gets an error that it can't go there). I was doing this in ess, and there's some chance the "can't write .Last.value" error
(wording approximate) cause by having an old version is screwing things
up).

Since R is interpreted I would expect debugging to be a snap, but these limitations make me suspect there is something about the language design that makes implementing these facilities hard. For example, the browser as documented in the Green book has up and down functions to change the frame (p. 265); these are conspicuously absent in R.

-- 
Ross Boylan                                      wk:  (415) 514-8146
185 Berry St #5700                               ross@biostat.ucsf.edu
Dept of Epidemiology and Biostatistics           fax: (415) 514-8150
University of California, San Francisco
San Francisco, CA 94107-1739                     hm:  (415) 550-1062

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed Jan 03 09:11:14 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 03 Jan 2007 - 08:31:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.