SwfdecAsDebugger

SwfdecAsDebugger — the debugger object see also: SwfdecAsContext

Synopsis




                    SwfdecAsDebugger;
                    SwfdecAsDebuggerClass;
                    SwfdecScript;

Object Hierarchy


  GObject
   +----SwfdecAsDebugger

Description

The debugger object is a special object that can be set on a SwfdecAsContext upon creation. If that is done, the debugger can then be used to inspect the running Actionscript application.

Details

SwfdecAsDebugger

typedef struct _SwfdecAsDebugger SwfdecAsDebugger;

This is the type of the debugger object.


SwfdecAsDebuggerClass

typedef struct {
  /* a new object was added to the GC */
  void			(* add)		(SwfdecAsDebugger *	debugger,
					 SwfdecAsContext *	context,
					 SwfdecAsObject *	object);
  /* an object was removed from the GC */
  void			(* remove)    	(SwfdecAsDebugger *	debugger,
					 SwfdecAsContext *	context,
					 SwfdecAsObject *	object);
  /* called before executing a bytecode */
  void			(* step)	(SwfdecAsDebugger *	debugger,
					 SwfdecAsContext *	context);
  /* called after adding a frame from the function stack */
  void			(* enter_frame)	(SwfdecAsDebugger *	debugger,
					 SwfdecAsContext *	context,
					 SwfdecAsFrame *	frame);
  /* called after removing a frame from the function stack */
  void			(* leave_frame)	(SwfdecAsDebugger *	debugger,
					 SwfdecAsContext *	context,
					 SwfdecAsFrame *	frame,
					 const SwfdecAsValue *	return_value);
  /* called before setting a variable */
  void			(* set_variable)(SwfdecAsDebugger *	debugger,
					 SwfdecAsContext *	context,
					 SwfdecAsObject *	object,
					 const char *		variable,
					 const SwfdecAsValue *	value);
} SwfdecAsDebuggerClass;

The class object for the debugger. You need to override these functions to get useful functionality for the debugger.

add () Called whenever an object is added to the garbage collection engine using swfdec_as_object_add()
remove () Called whenever an object is about to be collected by the garbage collector.
step () This function is called everytime just before a bytecode is executed by the script engine. So it's very powerful, but can also slow down the script engine a lot.
enter_frame () Called after a new SwfdecAsFrame has been initialized and pushed to the top of the execution stack.
leave_frame () Called just after a SwfdecAsFrame has been removed from the execution stack. The return value has not been forwarded to the parent when this function is called.
set_variable () Called whenever swfdec_as_object_set_variable() is called, before actually setting the variable. This function is also called when variables are set by internal code, not just when interpreting scripts. It also doesn't matter if setting the variable will succeed.

SwfdecScript

typedef struct _SwfdecScript SwfdecScript;

This is the object used for code to be executed by Swfdec. Scripts are independant from the SwfdecAsContext they are executed in, so you can execute the same script in multiple contexts.