From murdoch at stats.uwo.ca  Wed Oct 13 16:38:01 2004
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Wed Oct 13 16:38:05 2004
Subject: [Rd] RE: [R] debugging non-visible functions
In-Reply-To: <3A822319EB35174CA3714066D590DCD504AF852E@usrymx25.merck.com>
References: <3A822319EB35174CA3714066D590DCD504AF852E@usrymx25.merck.com>
Message-ID: <0afqm0litkmj9jtqt6gjs3olt29tc86830@4ax.com>

On Wed, 13 Oct 2004 10:19:56 -0400, "Liaw, Andy" <andy_liaw@merck.com>
wrote :

>> From: Duncan Murdoch 
>[snip]
>> For 2.1.0, would it be reasonable to extend debug() the way ? was
>> extended?  E.g. allow
>> 
>> debug(plot(x))
>> 
>> and have the debugging flag be set on the appropriate function,
>> whatever and wherever it happens to be?  There's some ambiguity with
>> S3 methods (did you want to debug the generic or the method?), but I
>> think defaulting to debugging of the method would be reasonable.  (And
>> I think ? needs to be extended to handle S3 methods too, but that's a
>> different question.)
>> 
>> Duncan Murdoch
>
>The ambiguity could be quite real.  I have a formula method that just does
>preprocessing, then call the default method.  What do the debugger do then?
>I've run into situations that I wanted to debug both of them, but not at the
>same time.  I just do what Gabor had suggested: debug(namespace:::function).
>Works for me.

I think the solution to this problem is to adopt a different model of
the debugger, more like other source level debuggers:  allow
breakpoints to be set at particular locations (not just on function
entry points), allow single stepping that enters (or doesn't) the
evaluation of functions.

Duncan Murdoch


[Rd] RE: [R] debugging non-visible functions
Duncan Murdoch