debugger impl

Tim Olson tim at jumpnet.com
Wed Apr 21 13:33:17 UTC 1999


>I am trying to find where return values and argument object pointers are
>stored in the receiver or sender objects in ContextPart or
>InstructionStream as used in the debugger. I see offsets which seem to
>vary with instruction type, and I can't figure them out.

Incoming arguments, temporary variables, and values pushed on the stack 
all reside in the indexable part of the MethodContext or BlockContext.  
For example, if a method has 3 arguments and 2 temporary variables, and 
we have a variable "suspendedContext" which is the MethodContext we are 
interested in, then:

     suspendedContext at: 1        "returns first argument"
     suspendedContext at: 2        "returns second argument"
     suspendedContext at: 3        "returns third argument"
     suspendedContext at: 4        "returns first temp variable"
     suspendedContext at: 5        "returns second temp variable"
     suspendedContext at: suspendedContext stackp        "returns top 
value on stack"

When a block or method returns a value, it is copied from the top of the 
returning context's stack onto the top of the sender's stack.




     -- tim





More information about the Squeak-dev mailing list