On Sat, Jan 31, 2015 at 8:44 AM, Eliot Miranda <eliot.miranda@gmail.com> wrote:
On Fri, Jan 30, 2015 at 2:54 PM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Ben Coman wrote
@Sean, In what way will it make halts more annoying?
Clearly seems to make things better in your use case, but IIRC the purpose of that test is that you don't want to open the debugger within the halting system. And indeed, when you remove it, you end up in #halt. But where you want to be is in UndefinedObject>>DoIt. So, it seems like a hack that, while better in this case, may have implications in other cases. The solution we're looking for is: "debuggers-opened-due-to-halts always open on the first context totally outside the halt machinery" and we're not quite there yet.
Okay I agree. So I threw away that solution you commented on and came at it another way. In summary... * The following four statements now all operate identically * self halt. * self haltOnce. * Halt now. * Halt once. * The first time the debugger opens - the halt statement is highlighted in the method that contains it. (In addition, the several other conditional and counting halt methods in the Halt class protocol 'halting' and Object protocol '*Kernel-Exceptions-debugging' "should" also work identically - but I haven't tested them pending confirmation I'm on the right track) * Upon <Restart>, all the above statements are properly ignored by <Step Over> Consider the following now opens a debugger on line 2 and gets to line 5 in just three <Step Over>s. a := 1. self halt. b := 2. self halt. c := 3.
Nobody responded to my suggestion of inlining the code for haltOnce so that the Halt signal happens in haltOnce itself, just as it does inside halt. This may make the system respond to haltOnce the same as it does to halt. i.e. the debugger can look to the sender of the signalling context. As it is now, the sender of the signalling context of a haltOnce is halt, not the sender of haltOnce as desired.
Let me reiterate, I expect
haltOnce "Halt unless we have already done it once." (Smalltalk at: #HaltOnce ifAbsent: [false]) ifTrue: [Smalltalk at: #HaltOnce put: false. Halt signal]
will behave similarly to
halt Halt signal
I believe I have been successful in this. The following now opens a debugger on line 3 instead of inside the #haltOnce.... a := 1. Halt enableHaltOnce. self haltOnce. b := 2. This is all in SLICE-Issue-12970-16-steps-to-get-through-halt-BenComan.4. Now maybe its not the best implementation, but I believe it satisfies all functional requirements and please can it be reviewed for integration asap. For me this adds that much more joy to using our great debugger. cheers -ben