gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/avm2 r9471: Added more debugging output.


From: Tom Stellard
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9471: Added more debugging output.
Date: Sun, 17 Aug 2008 17:40:06 +0800
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9471
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Sun 2008-08-17 17:40:06 +0800
message:
  Added more debugging output.
modified:
  libcore/vm/Machine.cpp
  libcore/vm/Machine.h
=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp    2008-08-16 15:09:58 +0000
+++ b/libcore/vm/Machine.cpp    2008-08-17 09:40:06 +0000
@@ -1349,6 +1349,7 @@
                        arr->set_indexed(i, pop_stack());
                }
                push_stack(as_value(arr));
+               print_stack();
                break;
        }
 /// 0x57 ABC_ACTION_NEWACTIVATION
@@ -1385,6 +1386,7 @@
                saveState();
                mStream = c->getStaticConstructor()->getBody();
 
+               print_stack();
 //             ENSURE_OBJECT(mStack.top(0));
 //             as_object *obj = mStack.top(0).to_object().get();
 //             as_function *func = c->getConstructor()->getPrototype();
@@ -1551,6 +1553,7 @@
        case SWF::ABC_ACTION_GETGLOBALSCOPE:
        {
                push_stack(mAsValueScopeStack.value(0));
+               print_stack();
                break;
        }
 /// 0x65 ABC_ACTION_GETSCOPEOBJECT

=== modified file 'libcore/vm/Machine.h'
--- a/libcore/vm/Machine.h      2008-08-15 17:23:32 +0000
+++ b/libcore/vm/Machine.h      2008-08-17 09:40:06 +0000
@@ -20,7 +20,7 @@
 #define GNASH_MACHINE_H
 
 #include <vector>
-
+#include <sstream>
 #include "SafeStack.h"
 #include "as_value.h"
 #include "asClass.h"
@@ -312,6 +312,29 @@
                mStack.push(value);
        }
 
+       void print_stack(){
+               
+               std::stringstream ss;
+               ss << "Stack: ";
+//             log_debug("Stack size is %u",mStack.size());
+               for(unsigned int i=0;i<mStack.size();++i){
+                       as_value value = mStack.value(i);
+                       ss << mStack.top(i).toDebugString();
+               }
+//             printf("\n");
+               LOG_DEBUG_AVM("%s", ss.str());
+       }
+
+       void print_scope_stack(){
+               
+               std::stringstream ss;
+               ss << "ScopeStack: ";
+               for(unsigned int i=0;i<mAsValueScopeStack.size();++i){
+                       ss << mAsValueScopeStack.top(i).toDebugString();
+               }
+               LOG_DEBUG_AVM("%s", ss.str());
+       }       
+
        as_environment get_args(int argc){
                as_environment env;
                for(unsigned int i=0;i<argc;i++){


reply via email to

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