Inspector: a surgery tool to see inside the objects Debugger: a surgery tool to see inside the processes - or maybe to see how the object live from the inside ;) 2015-11-17 18:37 GMT+01:00 Eliot Miranda <eliot.miranda@gmail.com>:
Hi Esteban,
I think EyeInspector needs to handle classes that don't inherit from Object specially. Instead of asking the instance it should ask the class. You should be able to use the Context methods for mirror primitives to extract state without sending messages to the instance. Then the special version of EyeInspector for ProtoObject subclasses can ask this like
(thisContext objectClass: object) isIndexable ifTrue: [size := thisContext objectSize: object]
Basically both the Inspector and the Debugger's execution simulation machinery need to treat encapsulators such as MessageArchiver with kid gloves. One *must not* cause inspecting or debugging to send messages through the encapsulator. Instead, all access to the object should be through primitives that don't send messages to the objects.
HTH
On Tue, Nov 17, 2015 at 7:05 AM, Esteban A. Maringolo < emaringolo@gmail.com> wrote:
I'm dealing with the MessageArchiver of GLORP which is a subclass of ProtoObject and handles the "transparent" creation of expressions vÃa a DNU resolution.
The problem I'm facing is that the EyeInspector expects the value in its value holder to respond to #basicSize, and because MessageArchiver inherits from ProtoObject it doesn't understand it.
The problem is here: EyeInspector>>#variableFieldsToShow "Answers the indexes of the variable fields of the object to show. Shorten the list for very long collection (cf limit1 and limit2)" |bSize| bSize := self objectVariableSize. ^ bSize <= (self limit1 + self limit2) ifTrue: [1 to: bSize] ifFalse: [(1 to: self limit1) , (bSize - self limit2 + 1 to: bSize)].
If I implement #basicSize in MessageArchiver things go bananas. If I doesn't, and because #objectVariableSize is sent to MessageAchiver "proxy", bSize ends up with an instance of the MessageArchiver instead of an integer.
I implemented #inspectorClass in MessageArchiver class to return EyeBasicInspector, but it is the same.
Question: Is it documented what I should define/override in my classes to support EyeInspector?
Regards,
Esteban A. Maringolo
pd: Stack trace ===========
UndefinedObject(Object)>>error: MessageArchiver>>mustBeBoolean EyeBasicInspector(EyeInspector)>>variableFieldsToShow EyeBasicInspector(EyeInspector)>>addVariableFields: EyeBasicInspector(EyeInspector)>>generateElements EyeBasicInspector(EyeInspector)>>updateList EyeBasicInspector(EyeInspector)>>objectChanged [ self objectChanged ] in EyeBasicInspector(EyeAbstractInspector)>>initializePresenter in Block: [ self objectChanged ] BlockClosure>>cull: BlockClosure>>cull:cull: BlockClosure>>cull:cull:cull: BlockClosure>>cull:cull:cull:cull:
-- _,,,^..^,,,_ best, Eliot