Question about ObjectTracer & ObjectViewer

Roger Whitney whitney at cs.sdsu.edu
Fri May 5 21:49:16 UTC 2000


I am having some problem with ObjectTracer and ObjectViewer. The examples
in the class comments do not work. Take the following program:

| a b |
b := OrderedCollection new.
a := ObjectTracer on: b.
a add: 5.
b inspect

"a add: 5' causes "doesNotUnderstand: aMessage" to be sent to the
ObjectTracer object a. In  ObjectTracer>>doesNotUnderstand method we have:

aMessage sentTo: tracedObject

where tracedObject is the ordered collection and aMessage is the "add: 5"
message object. Now we have

Mesage>>sentTo: receiver
    "answer the result of sending this message to receiver"

   lookupClass == nil
      ifTrue: [^ receiver perform: selector withArguments: args]
      ifFalse: [^ receiver perform: selector withArguments: args
inSuperclass: lookupClass]

where lookupClass is the ObjectTracer object a. This causes an exception to
be raised as the ObjectTracer class is not a super class of
OrderedCollection.

Unless I am missing something, this is a bug. Shouldn't
ObjectTracer>>doesNotUnderstand be:

ObjectTracer>>doesNotUnderstand: aMessage
	"All external messages (those not caused by the re-send) get
trapped here"
	"Present a dubugger before proceeding to re-send the message"

	Debugger openContext: thisContext
				label: 'About to perform: ', aMessage selector
				contents: thisContext shortStack.
	^ tracedObject perform: aMessage selector withArguments: aMessage
arguments


Roger Whitney              Mathematical & Computer Sciences Department
whitney at cs.sdsu.edu        San Diego State University
http://www.eli.sdsu.edu/   San Diego, CA 92182-7720
(217) 328-0824
(619) 594-3535
(619) 594-6746 (fax)






More information about the Squeak-dev mailing list