[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/vm/ActionExec.cpp server...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/vm/ActionExec.cpp server... |
Date: |
Thu, 27 Sep 2007 06:25:08 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/09/27 06:25:08
Modified files:
. : ChangeLog
server/vm : ActionExec.cpp ActionExec.h
Log message:
* server/vm/ActionExec.{cpp,h}: add dumpActions() debugging
function
useful to tell which opcode are discarded due to opcode-guard.
(change #if 0 to #if 1 in the opcode-guard code to see).
For the curveball.swf case, the unloading opcode is a
GotoLabel("Serve"), followed by a Play and a SetTarget which
are
discarded when opcode-guard is in effect.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4433&r2=1.4434
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.cpp?cvsroot=gnash&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.h?cvsroot=gnash&r1=1.22&r2=1.23
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4433
retrieving revision 1.4434
diff -u -b -r1.4433 -r1.4434
--- ChangeLog 27 Sep 2007 04:40:23 -0000 1.4433
+++ ChangeLog 27 Sep 2007 06:25:06 -0000 1.4434
@@ -1,3 +1,12 @@
+2007-09-27 Sandro Santilli <address@hidden>
+
+ * server/vm/ActionExec.{cpp,h}: add dumpActions() debugging function
+ useful to tell which opcode are discarded due to opcode-guard.
+ (change #if 0 to #if 1 in the opcode-guard code to see).
+ For the curveball.swf case, the unloading opcode is a
+ GotoLabel("Serve"), followed by a Play and a SetTarget which are
+ discarded when opcode-guard is in effect.
+
2007-09-27 Zou Lunkai <address@hidden>
* testsuite/misc-ming.all/opcode_guard_test.c, Makefile.am: new testcase
Index: server/vm/ActionExec.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- server/vm/ActionExec.cpp 26 Sep 2007 20:52:02 -0000 1.50
+++ server/vm/ActionExec.cpp 27 Sep 2007 06:25:07 -0000 1.51
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: ActionExec.cpp,v 1.50 2007/09/26 20:52:02 strk Exp $ */
+/* $Id: ActionExec.cpp,v 1.51 2007/09/27 06:25:07 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -284,14 +284,6 @@
continue; // Walk up the try chain if necessary.
} // end of try checking.
-#if 0 // See bugs: #20974, #21069, #20996.
- if ( _abortOnUnload && _original_target->isUnloaded() )
- {
- log_debug("Target of action_buffer unloaded during
execution, discarding %d remaining opcodes", stop_pc-pc);
- break;
- }
-#endif
-
// Cleanup any expired "with" blocks.
while ( ! with_stack.empty() && pc >= with_stack.back().end_pc() ) {
// Drop last stack element
@@ -344,6 +336,22 @@
ash.execute((action_type)action_id, *this);
+#if 0 // See bugs: #20974, #21069, #20996.
+ if ( _abortOnUnload && _original_target->isUnloaded() )
+ {
+ std::stringstream ss;
+ ss << "Target of action_buffer (" <<
_original_target->getTarget()
+ << ") unloaded by execution of opcode: " << std::endl;
+ dumpActions(pc, next_pc, ss);
+ ss << "Discarding " << stop_pc-next_pc
+ << " bytes of remaining opcodes: " << std::endl;
+ dumpActions(next_pc, stop_pc, ss);
+ log_debug("%s", ss.str().c_str());
+ break;
+ }
+#endif
+
+
#ifdef USE_DEBUGGER
debugger.setFramePointer(code.getFramePointer(pc));
debugger.setEnvStack(&env);
@@ -688,6 +696,32 @@
mReturning = true;
}
+void
+ActionExec::dumpActions(size_t from, size_t to, ostream& os)
+{
+ size_t lpc = from;
+ while (lpc < to)
+ {
+ // Get the opcode.
+ uint8_t action_id = code[lpc];
+
+ os << " PC:" << lpc << " - EX: " << code.disasm(lpc) << std::endl;
+
+ // Set default next_pc offset, control flow action handlers
+ // will be able to reset it.
+ if ((action_id & 0x80) == 0) {
+ // action with no extra data
+ lpc++;
+ } else {
+ // action with extra data
+ int16_t length = code.read_int16(lpc+1);
+ assert( length >= 0 );
+ lpc += length + 3;
+ }
+
+ }
+}
+
} // end of namespace gnash
Index: server/vm/ActionExec.h
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- server/vm/ActionExec.h 11 Sep 2007 22:03:06 -0000 1.22
+++ server/vm/ActionExec.h 27 Sep 2007 06:25:08 -0000 1.23
@@ -89,6 +89,21 @@
private:
+ /// \brief
+ /// Debugging function:
+ /// print opcodes from start (included) to end (not-included) PCs.
+ //
+ /// @param start
+ /// First opcode to dump
+ ///
+ /// @param end
+ /// One-past last opcode to dump
+ ///
+ /// @param os
+ /// Output stream to dump to
+ ///
+ void dumpActions(size_t start, size_t end, std::ostream& os);
+
/// Returns 'with' stack associated with this execution thread
//
/// If you need to modify it, use the pushWithEntry() function.