Bug 14814 - Debugger unnecessarily suspends before "if-blocks"
Debugger unnecessarily suspends before "if-blocks"
Status: RESOLVED FIXED
Product: R
Classification: Unclassified
Component: Misc
R-devel (trunk)
All All
: P5 normal
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-15 13:43 UTC by Stephan Wahlbrink
Modified: 2012-02-21 18:26 UTC (History)
0 users

See Also:


Attachments
Patch for eval.c adding the proposed change (2.22 KB, application/octet-stream)
2012-02-15 13:43 UTC, Stephan Wahlbrink
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Wahlbrink 2012-02-15 13:43:15 UTC
Created attachment 1269 [details]
Patch for eval.c adding the proposed change

Example:

myf <- function() {
    if (1 < 2) {
        print("true")
    }
}
debug(myf); myf()

The debugger (browser) suspends before the "then"-block "{" and before the print statement.

For blocks in while-loops and for-loops, it suspends only before the first statement inside "{ }", but not before "{ }".  I think this would be handy for if-statements as well.
Comment 1 Brian Ripley 2012-02-21 17:18:21 UTC
'suspends' is confusing here.  This is about steps of the browser in single-step mode (which is what debug uses).

Changed for 2.15.0.
Comment 2 Stephan Wahlbrink 2012-02-21 18:26:43 UTC
Thank you.