StackFrameDescclass | systype.h[1248] |
Superclass Tree | Subclass Tree | Global Objects | Property Summary | Method Summary | Property Details | Method Details |
To get the value of a local variable in the frame, simply use frame[name], where 'frame' is the StackFrameDesc object for the frame, and 'name' is a string giving the name of the local variable to retrieve. If the frame is active, this retrieves the live value of the variable from the frame; otherwise it retrieves the value from a snapshot containing the last value before the routine returned to its caller.
To assign a new value to a local in the frame, assign a value to frame[name] for the desired variable name. If the frame is active, this updates the live variable in the stack frame, so when execution returns to the caller the variable will have the new value. If the frame is inactive, it updates the snapshot we made when the routine returned to its caller.
This object can't be created with 'new'. Instead, you obtain these objects via the t3GetStackTrace() function. That function retrieves information on an active stack frame in the current call stack, including the frame object.
intrinsic class
StackFrameDesc :
getDefiningObj
getInvokee
getSelf
getTargetObj
getTargetProp
getVars
isActive
getDefiningObj ( ) | systype.h[1293] |
getInvokee ( ) | systype.h[1308] |
getSelf ( ) | systype.h[1288] |
getTargetObj ( ) | systype.h[1298] |
getTargetProp ( ) | systype.h[1303] |
getVars ( ) | systype.h[1283] |
The returned lookup table is a snapshot copy of the current values of the variables. If the underlying variable values in the frame change, the lookup table won't be affected, since it's just a separate copy made at the moment this routine is called. Similarly, changing the value of an entry in the returned lookup table won't affect the actual variable in the stack frame.
To retrieve the current live value of a variable in the actual stack frame, use frame[name], where 'frame' is the StackFrameDesc object for the frame, and 'name' is a string giving the variable name.
isActive ( ) | systype.h[1264] |
When the routine is about to return (so the frame is about to become inacive), the StackFrameDesc object makes a private snapshot of the variables in the frame. Subsequent access to the locals will automatically use the snapshot copy, so you can continue to access the locals as normal without worrying about whether or not the actual stack frame still exists. This allows you to continue to access and modify the values of the variables after the routine has exited.