gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash configure.ac ChangeLog gui/gtk.cpp server...


From: Rob Savoye
Subject: [Gnash-commit] gnash configure.ac ChangeLog gui/gtk.cpp server...
Date: Tue, 06 Feb 2007 17:46:25 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Rob Savoye <rsavoye>    07/02/06 17:46:25

Modified files:
        .              : configure.ac ChangeLog 
        gui            : gtk.cpp 
        server         : Makefile.am as_environment.h swf_function.cpp 
                         swf_function.h 
        server/parser  : action_buffer.cpp 
        server/vm      : ASHandlers.cpp ActionExec.cpp 

Log message:
                * configure.ac: Add --disable-debugger option.
                * server/debugger.h, debugger.cpp: New files for Flash debugger
                support.
                * gui/gnash.cpp: Add -g option to start the debugger console.
                * server/as_environment.h: Add methods to set registers.
                * server/parser/action_buffer.cpp: Add to existing string value,
                don't replace it.
                * server/vm/ActionExec.cpp: Add support for the Flash
                debugger. Simplify the methods where case conversion is done.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/configure.ac?cvsroot=gnash&r1=1.250&r2=1.251
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2254&r2=1.2255
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtk.cpp?cvsroot=gnash&r1=1.65&r2=1.66
http://cvs.savannah.gnu.org/viewcvs/gnash/server/Makefile.am?cvsroot=gnash&r1=1.99&r2=1.100
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.h?cvsroot=gnash&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf_function.cpp?cvsroot=gnash&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf_function.h?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/action_buffer.cpp?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.cpp?cvsroot=gnash&r1=1.14&r2=1.15

Patches:
Index: configure.ac
===================================================================
RCS file: /sources/gnash/gnash/configure.ac,v
retrieving revision 1.250
retrieving revision 1.251
diff -u -b -r1.250 -r1.251
--- configure.ac        3 Feb 2007 21:15:00 -0000       1.250
+++ configure.ac        6 Feb 2007 17:46:24 -0000       1.251
@@ -15,7 +15,7 @@
 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 dnl  
 
-dnl $Id: configure.ac,v 1.250 2007/02/03 21:15:00 martinwguy Exp $
+dnl $Id: configure.ac,v 1.251 2007/02/06 17:46:24 rsavoye Exp $
 
 AC_PREREQ(2.50)
 AC_INIT(gnash, cvs)
@@ -65,6 +65,18 @@
   AC_DEFINE([USE_FORK], [], [Fork player instead of thread])
 fi
 
+AC_ARG_ENABLE(debugger, AC_HELP_STRING([--disable-debugger],[Disable the Flash 
debugger]),
+[case "${enableval}" in
+  yes) debugger=yes ;;
+  no)  debugger=no ;;
+  *)   AC_MSG_ERROR([bad value ${enableval} for --disable-debugger option]) ;;
+esac],debugger=yes)
+
+if test x"$debugger" = x"yes"; then
+  AC_DEFINE([USE_DEBUGGER], [], [Flash Debugger support])
+fi
+AM_CONDITIONAL(DEBUGGER, test x$debugger = xyes)
+
 dnl Write the file to disk in the plugin, if specified.
 AC_ARG_ENABLE(write, AC_HELP_STRING([--enable-write], [Makes the Mozilla 
plugin write the currently playing SWF movie to /tmp.]),
 [case "${enableval}" in
@@ -875,6 +887,12 @@
   echo "        Building Cygnal media server disabled."
 fi
 
+if test x"$debugger" = x"yes"; then
+  echo "        Building Flash debugger support (default). Use 
--disable-debugger to disable."
+else
+  echo "        Building the Flash debugger is disabled."
+fi
+
 echo "        Renderer engine: "$renderer
 echo "        GUI: "$gui
 echo "        Sound handler: "$sound_handler

Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2254
retrieving revision 1.2255
diff -u -b -r1.2254 -r1.2255
--- ChangeLog   6 Feb 2007 11:00:36 -0000       1.2254
+++ ChangeLog   6 Feb 2007 17:46:24 -0000       1.2255
@@ -1,3 +1,15 @@
+2007-02-06  Rob Savoye  <address@hidden>
+
+       * configure.ac: Add --disable-debugger option.
+       * server/debugger.h, debugger.cpp: New files for Flash debugger
+       support.
+       * gui/gnash.cpp: Add -g option to start the debugger console.
+       * server/as_environment.h: Add methods to set registers.
+       * server/parser/action_buffer.cpp: Add to existing string value,
+       don't replace it.
+       * server/vm/ActionExec.cpp: Add support for the Flash
+       debugger. Simplify the methods where case conversion is done.
+
 2007-02-06 Sandro Santilli <address@hidden>
 
        * server/as_environment.cpp (get_variable_raw):

Index: gui/gtk.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gtk.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -b -r1.65 -r1.66
--- gui/gtk.cpp 31 Jan 2007 15:24:13 -0000      1.65
+++ gui/gtk.cpp 6 Feb 2007 17:46:24 -0000       1.66
@@ -17,7 +17,7 @@
 // 
 //
 
-/* $Id: gtk.cpp,v 1.65 2007/01/31 15:24:13 bjacques Exp $ */
+/* $Id: gtk.cpp,v 1.66 2007/02/06 17:46:24 rsavoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -813,7 +813,7 @@
     };
 
     const gchar *artists[] = { 
-       "P. J. Savoye",
+       "Jason Savoye",
         NULL 
     };
 

Index: server/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/server/Makefile.am,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -b -r1.99 -r1.100
--- server/Makefile.am  13 Jan 2007 20:06:17 -0000      1.99
+++ server/Makefile.am  6 Feb 2007 17:46:24 -0000       1.100
@@ -18,7 +18,7 @@
 # 
 #
 
-# $Id: Makefile.am,v 1.99 2007/01/13 20:06:17 tgc Exp $
+# $Id: Makefile.am,v 1.100 2007/02/06 17:46:24 rsavoye Exp $
 
 AUTOMAKE_OPTIONS = 
 
@@ -103,6 +103,7 @@
        builtin_function.h      \
        button_character_instance.h \
        character.h \
+       debugger.h \
        dlist.h \
        drag_state.h \
        edit_text_character.h \
@@ -151,6 +152,12 @@
 AM_CPPFLAGS += $(GSTREAMER_CFLAGS)
 endif
 
+
+# Enable building the Flash debugger
+if DEBUGGER
+libgnashserver_la_SOURCES += debugger.cpp
+endif
+
 #libserver_la_LDFLAGS = -module -avoid-version -no-undefined
 #libserver_la_LIBDADD =  address@hidden@  # $(LIBLTDL)
 libgnashserver_la_LDFLAGS = -avoid-version

Index: server/as_environment.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- server/as_environment.h     15 Jan 2007 14:16:06 -0000      1.39
+++ server/as_environment.h     6 Feb 2007 17:46:25 -0000       1.40
@@ -1,5 +1,5 @@
 // 
-//   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -14,11 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-// 
-//
-//
-
-/* $Id: as_environment.h,v 1.39 2007/01/15 14:16:06 strk Exp $ */
+/* $Id: as_environment.h,v 1.40 2007/02/06 17:46:25 rsavoye Exp $ */
 
 #ifndef GNASH_AS_ENVIRONMENT_H
 #define GNASH_AS_ENVIRONMENT_H
@@ -320,6 +316,13 @@
        ///
        as_value& local_register(uint8_t n);
 
+        /// Set the Nth local register to something
+        void set_local_register(uint8_t n, as_value &val) {
+           if (n <= m_local_register.size()) {
+               m_local_register[n] = val;
+           }
+       }
+
        /// Return a reference to the Nth global register.
        as_value& global_register(unsigned int n)
        {
@@ -327,6 +330,13 @@
                return m_global_register[n];
        }
 
+        /// Set the Nth local register to something
+        void set_global_register(uint8_t n, as_value &val) {
+           if (n <= 4) {
+               m_global_register[n] = val;
+           }
+       }
+
        /// Find the sprite/movie referenced by the given path.
        //
        /// Supports both /slash/syntax and dot.syntax
@@ -414,7 +424,6 @@
        ///
        LocalFrames m_local_frames;
 
-
 private:
 
        /// Variables available in this environment

Index: server/swf_function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf_function.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- server/swf_function.cpp     18 Jan 2007 22:53:21 -0000      1.17
+++ server/swf_function.cpp     6 Feb 2007 17:46:25 -0000       1.18
@@ -1,5 +1,5 @@
 // 
-//   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -14,10 +14,6 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-// 
-//
-//
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif

Index: server/swf_function.h
===================================================================
RCS file: /sources/gnash/gnash/server/swf_function.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/swf_function.h       9 Jan 2007 11:02:51 -0000       1.7
+++ server/swf_function.h       6 Feb 2007 17:46:25 -0000       1.8
@@ -1,5 +1,5 @@
 // 
-//   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -14,10 +14,6 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-// 
-//
-//
-
 #ifndef __GNASH_SWF_FUNCTION_H__
 #define __GNASH_SWF_FUNCTION_H__
 

Index: server/parser/action_buffer.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/action_buffer.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- server/parser/action_buffer.cpp     13 Dec 2006 21:38:51 -0000      1.12
+++ server/parser/action_buffer.cpp     6 Feb 2007 17:46:25 -0000       1.13
@@ -14,9 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-//
-
-/* $Id: action_buffer.cpp,v 1.12 2006/12/13 21:38:51 strk Exp $ */
+/* $Id: action_buffer.cpp,v 1.13 2007/02/06 17:46:25 rsavoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -223,7 +221,7 @@
        } else if (fmt == ARG_STR) {
            string str;
            for (int i = 0; i < length; i++) {
-               str = instruction_data[3 + i];
+               str += instruction_data[3 + i];
            }
            dbglogfile << "\"" << str.c_str() << "\"" << endl;
        } else if (fmt == ARG_U8) {

Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- server/vm/ASHandlers.cpp    18 Jan 2007 22:53:22 -0000      1.31
+++ server/vm/ASHandlers.cpp    6 Feb 2007 17:46:25 -0000       1.32
@@ -1,5 +1,5 @@
 // 
-//   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -14,9 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-//
-
-/* $Id: ASHandlers.cpp,v 1.31 2007/01/18 22:53:22 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.32 2007/02/06 17:46:25 rsavoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"

Index: server/vm/ActionExec.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- server/vm/ActionExec.cpp    18 Jan 2007 22:53:22 -0000      1.14
+++ server/vm/ActionExec.cpp    6 Feb 2007 17:46:25 -0000       1.15
@@ -1,5 +1,5 @@
 // 
-//   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 // 
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -14,9 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-//
-
-/* $Id: ActionExec.cpp,v 1.14 2007/01/18 22:53:22 strk Exp $ */
+/* $Id: ActionExec.cpp,v 1.15 2007/02/06 17:46:25 rsavoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -31,6 +29,7 @@
 #include "swf.h"
 #include "ASHandlers.h"
 #include "as_environment.h"
+#include "debugger.h"
 
 #include <typeinfo> 
 #include <boost/algorithm/string/case_conv.hpp>
@@ -48,7 +47,7 @@
 // too much information for my tastes. I really want just
 // to see how stack changes while executing actions...
 // --strk Fri Jun 30 02:28:46 CEST 2006
-#define DEBUG_STACK 1
+// #define DEBUG_STACK 1
 #endif
 
 using namespace gnash;
@@ -62,6 +61,9 @@
 
 static const SWFHandlers& ash = SWFHandlers::instance();
 static LogFile& dbglogfile = LogFile::getDefaultInstance();
+#ifdef USE_DEBUGGER
+static Debugger& debugger = Debugger::getDefaultInstance();
+#endif
 
 // External interface (to be moved under swf/ASHandlers)
 fscommand_callback s_fscommand_handler = NULL;
@@ -87,7 +89,9 @@
        //GNASH_REPORT_FUNCTION;
 
        // See comment in header
-       if ( env.get_version() > 5 ) _with_stack_limit = 15;
+       if ( env.get_version() > 5 ) {
+           _with_stack_limit = 15;
+       }
 }
 
 ActionExec::ActionExec(const action_buffer& abuf, as_environment& newEnv)
@@ -106,7 +110,9 @@
        //GNASH_REPORT_FUNCTION;
 
        /// See comment in header
-       if ( env.get_version() > 5 ) _with_stack_limit = 15;
+       if ( env.get_version() > 5 ) {
+           _with_stack_limit = 15;
+       }
 }
 
 void
@@ -139,12 +145,9 @@
        );
 #endif
 
-    while (pc<stop_pc)
-    {
-
+       while (pc<stop_pc) {
        // Cleanup any expired "with" blocks.
-       while ( ! with_stack.empty() && pc >= with_stack.back().end_pc() )
-       {
+           while ( ! with_stack.empty() && pc >= with_stack.back().end_pc() ) {
                // Drop last stack element
                with_stack.pop_back();
        }
@@ -178,6 +181,13 @@
 
        ash.execute((action_type)action_id, *this);
 
+#ifdef USE_DEBUGGER
+       debugger.setEnvStack(&env);
+       if (debugger.isTracing()) {
+           debugger.dissasemble(code.read_string(pc));
+       }
+#endif
+       
 #if DEBUG_STACK
        IF_VERBOSE_ACTION (
                log_action( " After execution, PC is " SIZET_FMT ".", pc);
@@ -198,19 +208,15 @@
     env.set_target(original_target);
 
     // check if the stack was smashed
-    if ( _initial_stack_size > env.stack_size() )
-    {
+    if ( _initial_stack_size > env.stack_size() ) {
            log_warning("Stack smashed (ActionScript compiler bug?)."
                   "Fixing by pushing undefined values to the missing slots, "
                  " but don't expect things to work afterwards.");
            size_t missing = _initial_stack_size - env.stack_size();
-           for (size_t i=0; i<missing; ++i)
-           {
+       for (size_t i=0; i<missing; ++i) {
                    env.push(as_value());
            }
-    }
-    else if ( _initial_stack_size < env.stack_size() )
-    {
+    } else if ( _initial_stack_size < env.stack_size() ) {
            // We can argue this would be an "size-optimized" SWF instead...
            IF_VERBOSE_MALFORMED_SWF(
            log_warning("Elements left on the stack after block execution. 
Cleaning up.");
@@ -224,13 +230,11 @@
 {
        //pc = next_pc;
 
-       for(size_t i=0; i<offset; ++i)
-       {
+       for(size_t i=0; i<offset; ++i) {
 #if 1
                // we need to check at every iteration because
                // an action can be longer then a single byte
-               if ( next_pc >= stop_pc )
-               {
+           if ( next_pc >= stop_pc ) {
                        log_error("End of DoAction block hit while skipping "
                                SIZET_FMT " action tags (pc:" SIZET_FMT 
                                ", stop_pc:" SIZET_FMT ") - Mallformed SWF ?"
@@ -265,8 +269,7 @@
 {
        // See comment in header about _with_stack_limit
        IF_VERBOSE_ASCODING_ERRORS (
-       if (with_stack.size() >= _with_stack_limit)
-       {
+       if (with_stack.size() >= _with_stack_limit) {
                log_aserror("'With' stack depth (" SIZET_FMT ") "
                        "exceeds the allowed limit for current SWF "
                        "target version (" SIZET_FMT " for version %d)."
@@ -284,32 +287,43 @@
 ActionExec::delVariable(const std::string& name)
 {
        VM& vm = VM::get(); // cache this ?
-       if ( vm.getSWFVersion() < 7 )
-       {
                std::string namei = name;
+       if ( vm.getSWFVersion() < 7 ) {
                boost::to_lower(namei, vm.getLocale());
-               return env.del_variable_raw(namei, with_stack);
-       }
-       else
-       {
-               return env.del_variable_raw(name, with_stack);
        }
+       
+       return env.del_variable_raw(namei, with_stack);
 }
 
 void
 ActionExec::setVariable(const std::string& name, const as_value& val)
 {
        VM& vm = VM::get(); // cache this ?
-       if ( vm.getSWFVersion() < 7 )
-       {
                std::string namei = name;
+       if ( vm.getSWFVersion() < 7 ) {
                boost::to_lower(namei, vm.getLocale());
-               return env.set_variable(namei, val, getWithStack());
        }
-       else
-       {
-               return env.set_variable(name, val, getWithStack());
+       
+#ifdef USE_DEBUGGER
+       debugger.matchWatchPoint(namei, Debugger::WRITES);
+#endif
+       return env.set_variable(namei, val, getWithStack());
+}
+
+as_value
+ActionExec::getVariable(const std::string& name)
+{
+       VM& vm = VM::get();
+
+       std::string namei = name;
+       if ( vm.getSWFVersion() < 7 ) {
+           boost::to_lower(namei, vm.getLocale());
        }
+       
+#ifdef USE_DEBUGGER
+       debugger.matchWatchPoint(namei, Debugger::READS);
+#endif
+       return env.get_variable(namei, getWithStack());
 }
 
 void
@@ -318,55 +332,30 @@
        VM& vm = VM::get(); // cache this ?
 
        std::string name = name_;
-       if ( vm.getSWFVersion() < 7 )
-       {
+       if ( vm.getSWFVersion() < 7 ) {
                boost::to_lower(name, vm.getLocale());
        }
 
-       if ( isFunction() )
-       {
+       if ( isFunction() ) {
                // TODO: set local in the function object?
                env.set_local(name, val);
-       }
-       else
-       {
+       } else {
                // TODO: set target member  ?
                //       what about 'with' stack ?
                env.set_variable(name, val);
        }
 }
 
-as_value
-ActionExec::getVariable(const std::string& name)
-{
-       VM& vm = VM::get();
-
-       if ( vm.getSWFVersion() < 7 )
-       {
-               std::string namei = name;
-               boost::to_lower(namei, vm.getLocale());
-               return env.get_variable(namei, getWithStack());
-       }
-       else
-       {
-               return env.get_variable(name, getWithStack());
-       }
-
-}
-
 void
 ActionExec::setObjectMember(as_object& obj, const std::string& var, const 
as_value& val)
 {
        VM& vm = VM::get();
 
-       if ( vm.getSWFVersion() < 7 )
-       {
+       if ( vm.getSWFVersion() < 7 ) {
                std::string vari = var;
                boost::to_lower(vari, vm.getLocale());
                obj.set_member(vari, val);
-       }
-       else
-       {
+       } else {
                obj.set_member(var, val);
        }
 
@@ -377,14 +366,11 @@
 {
        VM& vm = VM::get();
 
-       if ( vm.getSWFVersion() < 7 )
-       {
+       if ( vm.getSWFVersion() < 7 ) {
                std::string vari = var;
                boost::to_lower(vari, vm.getLocale());
                return obj.get_member(vari, &val);
-       }
-       else
-       {
+       } else {
                return obj.get_member(var, &val);
        }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]