[ESS] ESS 13.05 produces wrong behavior in browser() debugging for loops

Vitalie Spinu spinuvit at gmail.com
Tue Jun 18 11:05:42 CEST 2013


What do you mean by "not executed properly"? That debugger enters the
for loop?  That is an expected behavior when debugger is in step
mode. And that is what people want in most cases. Why would you put your
breakpoint before the for loop then?

Use C-M-N to jump over multiple debugger steps.

Otherwise put another breakpoint after the loop and just press M-C to
jump out of loop to next breakpoint.

    Vitalie

 >> Levi Waldron <lwaldron.research at gmail.com>
 >> on Mon, 17 Jun 2013 20:36:57 -0400 wrote:

 > Loops no longer executed properly in a browser() session within ESS, when
 > the loop includes curly braces {}.  This does not happen when using the R
 > console directly, but happens with both R-3.0.1 and R-2.15.1. See
 > sessionInfo() and $dpkg -l ess at the end of this message.

 >> testFun <- function(n){
 > +    browser()
 > +    for (i in 1:n)  ##normal
 > +        print(i)
 > +    i
 > +    for (j in 1:n){  ##broken
 > +        print(j)
 > +    }
 > +    j
 > +    for (k in 1:n){print(k)}
 > +    k
 > }
 >> testFun(3)
 > Called from: testFun(3)
 > Browse[1]>
 > debug at /tmp/ESS-region/test.R at 2#3: for (i in 1:n) print(i)
 > Browse[2]>     for (i in 1:n)  ##normal
 > +         print(i)
 > [1] 1
 > [1] 2
 > [1] 3
 > Browse[2]>     i
 > [1] 3
 > Browse[2]>     for (j in 1:n){  ##broken
 > +         print(j)
 > +     }
 > debug at /tmp/ESS-region/test.R at 2#3: j
 > Browse[3]>     j
 > NULL
 > Browse[3]> for (k in 1:n){print(k)}
 > debug at /tmp/ESS-region/findDupSamplesPairwise.R at 2#3: k
 > Browse[4]> k
 > NULL

 > Browse[4]> sessionInfo()
 > R version 3.0.1 (2013-05-16)
 > Platform: x86_64-unknown-linux-gnu (64-bit)

 > locale:
 >  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 >  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 >  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 >  [7] LC_PAPER=C                 LC_NAME=C
 >  [9] LC_ADDRESS=C               LC_TELEPHONE=C
 > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

 > attached base packages:
 > [1] stats     graphics  grDevices utils     datasets  methods   base

 > loaded via a namespace (and not attached):
 > [1] compiler_3.0.1 tools_3.0.1
 > Browse[4]>

 > $ dpkg -l ess
 > Desired=Unknown/Install/Remove/Purge/Hold
 > |
 > Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
 > |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
 > ||/ Name           Version        Description
 > +++-==============-==============-============================================
 > ii  ess            13.05-3precise Emacs mode for statistical programming
 > and d

 > 	[[alternative HTML version deleted]]

 > ______________________________________________
 > ESS-help at r-project.org mailing list
 > https://stat.ethz.ch/mailman/listinfo/ess-help



More information about the ESS-help mailing list