[squeak-dev] The better debugger support by extending an Object protocol

Igor Stasenko siguctua at gmail.com
Mon Sep 7 17:29:53 UTC 2009


2009/9/7 Bert Freudenberg <bert at freudenbergs.de>:
>
> On 07.09.2009, at 18:40, Randal L. Schwartz wrote:
>
>>>>>>> "Igor" == Igor Stasenko <siguctua at gmail.com> writes:
>>
>> Igor> Here is the default implementation of
>>
>> Object> debugPrintOn: aStream
>> Igor>   ^ self printOn: aStream
>>
>> I like it, but I don't like the name.  It conjurs up the idea of debugging
>> the #printOn: method itself.
>>
>> maybe #printForDebuggerOn: ?
>
>
> It matches the other methods like #longPrintOn: though.
>
> Also that would imply only the debugger invokes it, when it's clearly
> appropriate for any purpose.
>
> However, apart from this bike shedding ;) do others think it's a good idea
> in general? IMHO #printOn: is primarily used for debugging anyway so I
> wouldn't really expect a separate debug print method to be needed. Debugging
> transparent proxies isn't for the faint-of-heart anyway, so these developers
> can adapt their tools and proxies I would guess. OTOH there is precedence in
> e.g. #asExplorerString, which exists solely to get rid of the quotes
> enclosing strings for aesthetic reasons ...
>

I agree with you Bert, that we should consider if its really necessary.
While #printOn: is used by most code for debugging, some of the code
using it to serialize object to textual stream, so the #printOn: usage
is much more generic than just debugging.

As for debugging the transparent proxies - yes you can make own
tools.. but this means reimplementing/hacking
other tools , like debugger, inspector and so on, which will probably
end up with similar solution to what i proposing.

For example, there was a point of discrepancy with debugging the code
which uses Magma.
The magma forwarding proxy reifying the object once the first real
message is sent to it.
And the problem with such a proxy, that you can't use them in certain
situations, like:

self perform: aSelectorProxied with: #foo

because #perform doesn't sends the messages to aSelectorProxied and
primitive fails. But then, when you entering the debugger and trying
to figure out why its not working - a proxy becomes a real object when
it printed out.. and so you can't debug the error using debugger.
Which leaves you to wonder, why code works in debugger, but not
working at run time :)

>
> - Bert -
>


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list