Debugging tools - norman-ipn/lightspark GitHub Wiki

Debugging tools

This page lists some useful tools and hints for understanding why an SWF file is not working in Lightspark.

Logging in Lightspark

Standalone

lightspark -l 4 file.swf > log 2>&1

Plugin

Close all Firefox windows first.

LIGHTSPARK_PLUGIN_LOGLEVEL=4 firefox http://www.youtube.com > log 2>&1

Logging in the Adobe player

Create a file ~/mm.cfg with the following content:

ErrorReportingEnable=1
TraceOutputFileEnable=1
TraceOutputBuffered=1
AS3Trace=1

When AS3Trace option is enabled, the Adobe plugin will produce a trace of every AS function call at ~/.macromedia/Flash_Player/Logs/flashlog.txt.

More options are listed at http://jpauclair.net/2010/02/10/mmcfg-treasure/

abcdis: a bytecode disassembler

Tamarin-redux includes a bytecode disassembler called abcdis. However, it is not compiled by default. See utils/README-abcdis for compilation instructions.

Usage:

mkdir outputdir
avmshell $TAMARIN_PATH/utils/abcdis.abc -- -api input.swf outputdir

Debug output function

Useful for inspecting objects' states in gdb.

variables_map::dumpVariables() prints variables. Example usage in gdb: p obj->Variables.dumpVariables() where obj is an ASObject.

DisplayObjectContainer::dumpDisplayList() prints display list starting from the given object. For example, set a breakpoint in RootMovieClip::initFrame() and do p dumpDisplayList(0) there.

Related pages

How to get a backtrace