Adding methods in the Debugger
ned at bike-nomad.com
Thu Feb 13 21:29:15 UTC 2003
On Thursday 13 February 2003 12:58 pm, Alain Fischer wrote:
> Amusing to see that there is interest for such a behavior of the
> debugger, I wrote a piece of code which makes the same thing a few
> days ago. And before I had time to release it, Ned and Adam have
> implemented one. I think the two version could be complementary and
> must be merged.
Thanks for posting this; it's nice.
What I'd like is for the "Create" button on the PreDebugWindow to do
what the menu choice does.
Would you like to make that work? Of course, the problem is that you'd
have to make a deferred action of some sort that would have to wait
till the full debugger was built...
> When you use the contextual menul on a #doesNotUnderstand: of the
> context stack list you see
> an additional menu with submenu representing the class and
> superclass of the context receiver.
> You can then choose the wanted class and a stub method is compiled
> then the DNU context is replaced
> with the compiled method.
This doesn't work in MVC.
And I got a walkback in implement:inClass: with the comma operator
between the ' anObject' string and index. This fixes that particular
implement: aSelector inClass: aClass
| aStream |
aStream := String new writeStream.
aSelector isUnary ifTrue:
[aStream nextPutAll: aSelector].
aSelector isInfix ifTrue:
[aStream nextPutAll: aSelector, ' anObject'].
aSelector isKeyword ifTrue:
[aSelector keywords doWithIndex:
[:each :index |
aStream nextPutAll: each; nextPutAll: ' anObject'; nextPutAll:
index asString; nextPut: $ ]].
aStream cr; cr; tab; nextPutAll: 'self shouldBeImplemented'.
aClass compile: aStream contents.
self selectedContext restartWith: (aClass lookupSelector: aSelector).
self resetContext: self selectedContext.
self contextStackIndex: 1 oldContextWas: nil
GPG key ID: BEEA7EFE
More information about the Squeak-dev