SwfdecAsFrame

SwfdecAsFrame — information about currently executing frames

Functions

Types and Values

Includes

#include <swfdec/swfdec.h>

Description

This section is only interesting for people that want to look into debugging. A SwfdecAsFrame describes a currently executing function while it is running. On every new function call, a new frame is created and pushed on top of the frame stack. To get the topmost one, use swfdec_as_context_get_frame(). After that you can inspect various properties of the frame, like the current stack.

a SwfdecAsFrame is a SwfdecAsObject, so it is possible to set variables on it. These are local variables inside the executing function. So you can use functions such as swfdec_as_object_get_variable() to inspect them.

Functions

swfdec_as_frame_get_next ()

SwfdecAsFrame *
swfdec_as_frame_get_next (SwfdecAsFrame *frame);

Gets the next frame in the frame stack. The next frame is the frame that will be executed after this frame .

Parameters

frame

a SwfdecAsFrame

 

Returns

the next SwfdecAsFrame or NULL if this is the bottommost frame.


swfdec_as_frame_get_script ()

SwfdecScript *
swfdec_as_frame_get_script (SwfdecAsFrame *frame);

Gets the script associated with the given frame . If the frame references a native function, there will be no script and this function returns NULL.

Parameters

frame

a SwfdecAsFrame

 

Returns

The script executed by this frame or NULL


swfdec_as_stack_iterator_init ()

SwfdecAsValue *
swfdec_as_stack_iterator_init (SwfdecAsStackIterator *iter,
                               SwfdecAsContext *context,
                               SwfdecAsFrame *frame);

Initializes iter to walk the stack of frame . The first value on the stack will alread be returned. This makes it possible to write a simple loop to print the whole stack:

1
2
3
4
5
value = swfdec_as_stack_iterator_next (&iter)) {
  char *s = swfdec_as_value_to_debug (value);
  g_print ("%s\n", s);
  g_free (s);
}]|

Parameters

iter

a SwfdecStackIterator

 

context

context frame belongs to

 

frame

the frame to initialize from

 

Returns

the topmost value on the stack of frame or NULL if none


swfdec_as_stack_iterator_init_arguments ()

SwfdecAsValue *
swfdec_as_stack_iterator_init_arguments
                               (SwfdecAsStackIterator *iter,
                                SwfdecAsContext *context,
                                SwfdecAsFrame *frame);

Initializes a stack iterator to walk the arguments passed to the given frame . See swfdec_as_stack_iterator_init() about suggested iterator usage.

Parameters

iter

iterator to be initialized

 

context

context frame belongs to

 

frame

the frame to initialize from

 

Returns

The value of the first argument


swfdec_as_stack_iterator_next ()

SwfdecAsValue *
swfdec_as_stack_iterator_next (SwfdecAsStackIterator *iter);

Gets the next value on the stack.

Parameters

Returns

The next value on the stack or NULL if no more values are on the stack

Types and Values

SwfdecAsFrame

typedef struct _SwfdecAsFrame SwfdecAsFrame;

the object used to represent an executing function.


struct SwfdecAsStackIterator

struct SwfdecAsStackIterator {
};

This is a struct used to walk the stack of a frame. It is supposed to be allocated on the stack. All of its members are private.