Bug 13647 - bug/suggestion: debugger should respect option "deparse.max.lines" when printing the call
bug/suggestion: debugger should respect option "deparse.max.lines" when print...
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Low-level
old
All Linux
: P5 normal
Assigned To: Jitterbug compatibility account
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-09 19:17 UTC by Jitterbug compatibility account
Modified: 2009-04-09 19:17 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 2009-04-09 19:17:36 UTC
From: jbrzusto@fastmail.fm
Full_Name: John Brzustowski
Version: 2.8.1
OS: linux
Submission from: (NULL) (67.71.250.146)


When entering a debug()'ed function, the call printout is not limited by
options()$deparse.max.lines as it is when one uses browser() or trace().

Should it be?  If so, here's a patch:

diff -cr R-2.8.1/src/library/base/man/options.Rd
R-2.8.1-patched/src/library/base/man/options.Rd
*** R-2.8.1/src/library/base/man/options.Rd     2008-11-12 04:23:36.000000000
-0500
--- R-2.8.1-patched/src/library/base/man/options.Rd     2009-04-09
10:12:31.000000000 -0400
***************
*** 77,84 ****
        initialized (see \code{\link{Startup}}).}
  
      \item{\code{deparse.max.lines}:}{controls the number of lines used
!       when deparsing in \code{\link{traceback}} and
!       \code{\link{browser}}.  Initially unset, and only used if set to
        a positive integer.}
  
      \item{\code{digits}:}{controls the number of digits to print when
--- 77,85 ----
        initialized (see \code{\link{Startup}}).}
  
      \item{\code{deparse.max.lines}:}{controls the number of lines used
!       when deparsing in \code{\link{traceback}}, \code{\link{browser}},
!       and upon entry to a function whose debugging flag is set.
!       Initially unset, and only used if set to
        a positive integer.}
  
      \item{\code{digits}:}{controls the number of digits to print when
diff -cr R-2.8.1/src/main/eval.c R-2.8.1-patched/src/main/eval.c
*** R-2.8.1/src/main/eval.c     2008-10-05 18:05:02.000000000 -0400
--- R-2.8.1-patched/src/main/eval.c     2009-04-09 09:45:03.000000000 -0400
***************
*** 526,531 ****
--- 526,532 ----
      volatile  SEXP newrho;
      SEXP f, a, tmp;
      RCNTXT cntxt;
+     int itmp;
  
      /* formals = list of formal parameters */
      /* actuals = values to be bound to formals */
***************
*** 609,615 ****
--- 610,621 ----
      SET_DEBUG(newrho, DEBUG(op));
      if (DEBUG(op)) {
        Rprintf("debugging in: ");
+ 
+       itmp = asInteger(GetOption(install("deparse.max.lines"), R_BaseEnv));
+       if(itmp != NA_INTEGER && tmp > 0) R_BrowseLines = itmp;
        PrintValueRec(call,rho);
+       R_BrowseLines = 0;
+ 
        /* Is the body a bare symbol (PR#6804) */
        if (!isSymbol(body) & !isVectorAtomic(body)){
                /* Find out if the body is function with only one statement. */

Comment 1 Jitterbug compatibility account 2009-05-27 03:15:00 UTC
NOTES:
 See 13648, adopted in 2.10.0
Comment 2 Jitterbug compatibility account 2009-05-27 03:15:38 UTC
Audit (from Jitterbug):
Tue May 26 22:15:38 2009	ripley	changed notes
Tue May 26 22:15:38 2009	ripley	moved from incoming to Low-level-fixed