Article View: comp.sys.ti.explorer
Article #460RE: tracing all accesses to an instance
From: Stephen Nicoud
Date: Wed, 21 Feb 1990 04:22
Date: Wed, 21 Feb 1990 04:22
55 lines
2478 bytes
2478 bytes
Date: Sun, 4 Feb 90 17:16:19 EST
From: fsr@bubba.att.com
Subject: tracing all accesses to an instance
oh flavor gurus,
i have a question.
yesterday i created a flavor and began using it in my application.
the 8 or so methods that i wrote for it defined the interface
to the rest of my "world". but then i began using it, and things didn't
work right, and because i couldn't be sure the rest of my "world"
was making calls to my instance in the proper order, and with the
proper arguments, i set about trying to "trace" all accesses to it.
unfortunately the function TRACE expects some kind of valid function
object...fair enough. then i remembered that the function APPLY and
hence FUNCALL allow flavor instances to be used in place of other
valid function objects. so it tried
(eval `(trace ,*instance*))
but to no eval.
i still assume this can be accomplished somehow. can anybody help?
thanks,
frank
Hmm, if you want to trace each access to only a particular instance, an
"obvious" solution doesn't immediately come to mind.
I suppose that, in general, you might be able to trace all method calls
of a flavor "class" by setting up a loop to trace each method. You
know, something like,
(loop for method in (send (make-instance 'your-flavor) :which-operations)
do (eval `(trace (:function (:method your-flavor ,method)))))
I don't know, maybe you can set up a conditional for a particular
instance like,
(loop for method in (send your-instance :which-operations)
do (eval `(trace (:function (:method your-instance ,method) :cond (eq (car arglist) your-instance)))))
I haven't tried these code bits, so there's probably something
"obviously" wrong with them. :-) Maybe someone else with more time on
their hands than me can tell us if these are even reasonable.
Anyway, it might give you a couple of ideas on ways to try.
Good Luck and let us know what you come up with,
Steve
Technical Details
Message-ID:
<19900221042243.9.SLN@SKAGIT.atc.boeing.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ATC.BOEING.COM!snicoudShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ATC.BOEING.COM!snicoud From: snicoud@ATC.BOEING.COM (Stephen Nicoud) Newsgroups: comp.sys.ti.explorer Subject: RE: tracing all accesses to an instance Message-ID: <19900221042243.9.SLN@SKAGIT.atc.boeing.com> Date: 21 Feb 90 04:22:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 55