Thanks Phil. That is how I normally do things, but unless I'm missing something obvious, this is a bit more complicated. There are dozens of Morphs which each pass through that bit of code each World rendering cycle. A self haltOnce will invoke randomly in any one of these, not the one with the error I need to debug. I could put the self haltOnce inside the "do:[:err|..... ]" block, but then my original question remains. Actually I've made some progress as follows just wandering through a Explore on the Error... 1. In the inspector that comes up, I open an explorer on self to get a scrolling pane interface. 2. Then I click through... handlerContext > receiver > outerContext which is a MethodContext for ESCanvas(Morph)>>fullDrawOn: This has a parameter '[aCanvas]' which is a FormCanvas and a 'receiver' which is a ESCanvas 3. I don't know how to refer '[aCanvas]' in the Explorer command pane, so I click on [aCanvas] and in its command pane I do 'Smalltalk at: #btcdebug put: self' 4. Back at (2.) I do... receiver setProperty: #errorOnDraw toValue: false. then using <Alt-Shift-D> I debug... receiver fullDrawOn: (Smalltalk at: #btcdebug) 5. Then once I worked out which line is the culprit, I debug that line separately to get a new context avoiding the error handling. cheers -ben btw, This is in Pharo 1.4 (Moose 4.7) phil@highoctane.be wrote:
self haltOnce and enabling the halt once in the world menu should help.
That's how I debug these things on my side.
Phil
2013/3/30 Ben Coman <btc@openinworld.com>
I am trying to debug a red-square-of-death for a Morph. I have found where Morph errors are handled in Morph>>fullDrawOn: where it goes... [ "stuff to draw morphs" ] on: Error do: [ :err | "stuff to draw red square" ].
In the do: block I'd like to open a debugger on the error. I see Exception has #debug, so I changed the block to... [ :err | err inspect. "stuff to draw red square" ] ...and then in the inspector I do (self debug) ...but this brings up the emergency evaluator.
Below is a contrived example that exhibits the same behaviour.
doIt on... (1 / 0. self inform: 'x'.) and of course a debugger appears. doIt on... [ 1 / 0. self inform: 'x' . ] on: Error do: [:err | err inspect ] ...and then (self debug) in the inspector you get the emergency evaluator. Anyone know how can I get the debugger to come up on 'err' in the last example?
cheers -ben