[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/as_environment.cpp serve...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/as_environment.cpp serve... |
Date: |
Mon, 17 Mar 2008 17:27:57 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/03/17 17:27:57
Modified files:
. : ChangeLog
server : as_environment.cpp as_environment.h
server/vm : ASHandlers.cpp ActionExec.cpp
Log message:
* server/as_environment.{cpp,h}: dump_stack: add additional
optional argument to limit number of stack items printed.
* server/vm/ASHandlers.cpp (ActionSetRegister): use int rather
then uint8_t for sake of logging...
* server/vm/ActionExec.cpp: limit stack dump to 32 items.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5950&r2=1.5951
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.cpp?cvsroot=gnash&r1=1.127&r2=1.128
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.h?cvsroot=gnash&r1=1.73&r2=1.74
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.217&r2=1.218
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.cpp?cvsroot=gnash&r1=1.69&r2=1.70
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5950
retrieving revision 1.5951
diff -u -b -r1.5950 -r1.5951
--- ChangeLog 17 Mar 2008 16:21:01 -0000 1.5950
+++ ChangeLog 17 Mar 2008 17:27:56 -0000 1.5951
@@ -1,5 +1,13 @@
2008-03-17 Sandro Santilli <address@hidden>
+ * server/as_environment.{cpp,h}: dump_stack: add additional
+ optional argument to limit number of stack items printed.
+ * server/vm/ASHandlers.cpp (ActionSetRegister): use int rather
+ then uint8_t for sake of logging...
+ * server/vm/ActionExec.cpp: limit stack dump to 32 items.
+
+2008-03-17 Sandro Santilli <address@hidden>
+
* server/movie_root.cpp (fire_mouse_event): catch ActionLimit
exceptions.
Index: server/as_environment.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.cpp,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -b -r1.127 -r1.128
--- server/as_environment.cpp 14 Mar 2008 23:05:58 -0000 1.127
+++ server/as_environment.cpp 17 Mar 2008 17:27:56 -0000 1.128
@@ -925,6 +925,28 @@
{
}
+void
+as_environment::dump_stack(std::ostream& out, unsigned int limit) const
+{
+ unsigned int si=0, n=m_stack.size();
+ if ( limit && n > limit )
+ {
+ si=n-limit;
+ out << "Stack (last " << limit << " of " << n << " items): ";
+ }
+ else
+ {
+ out << "Stack: ";
+ }
+
+ for (int i=si; i<n; i++)
+ {
+ if (i!=si) out << " | ";
+ out << '"' << m_stack[i] << '"';
+ }
+ out << std::endl;
+}
+
#ifdef GNASH_USE_GC
/// Mark all reachable resources
//
Index: server/as_environment.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.h,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -b -r1.73 -r1.74
--- server/as_environment.h 6 Mar 2008 05:22:52 -0000 1.73
+++ server/as_environment.h 17 Mar 2008 17:27:57 -0000 1.74
@@ -346,16 +346,15 @@
as_object* find_object(const std::string& path, const ScopeStack*
scopeStack=NULL) const;
/// Dump content of the stack to a std::ostream
- void dump_stack(std::ostream& out=std::cerr)
- {
- out << "Stack: ";
- for (unsigned int i=0, n=m_stack.size(); i<n; i++)
- {
- if (i) out << " | ";
- out << '"' << m_stack[i] << '"';
- }
- out << std::endl;
- }
+ //
+ /// @param out
+ /// The output stream, standard error if omitted.
+ ///
+ /// @param limit
+ /// If > 0, limit number of printed item by the given amount (from
the top).
+ /// Unlimited by default;
+ ///
+ void dump_stack(std::ostream& out=std::cerr, unsigned int limit=0)
const;
/// Dump the local registers to a std::ostream
//
Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.217
retrieving revision 1.218
diff -u -b -r1.217 -r1.218
--- server/vm/ASHandlers.cpp 17 Mar 2008 14:03:13 -0000 1.217
+++ server/vm/ASHandlers.cpp 17 Mar 2008 17:27:57 -0000 1.218
@@ -4334,7 +4334,7 @@
const action_buffer& code = thread.code;
- boost::uint8_t reg = code[thread.pc + 3];
+ unsigned int reg = code[thread.pc + 3];
// Save top of stack in specified register.
if ( thread.isFunction2() && env.num_local_registers() )
Index: server/vm/ActionExec.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- server/vm/ActionExec.cpp 10 Mar 2008 08:19:39 -0000 1.69
+++ server/vm/ActionExec.cpp 17 Mar 2008 17:27:57 -0000 1.70
@@ -42,12 +42,17 @@
#include <string>
#ifndef DEBUG_STACK
+
// temporarly disabled as will produce lots of output with -v
// we'd need another switch maybe, as -va does also produce
// 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
+
+// Max number of stack item to dump. 0 for unlimited.
+#define STACK_DUMP_LIMIT 32
+
#endif
using namespace gnash;
@@ -171,7 +176,7 @@
"."),
pc, stop_pc, code.size());
stringstream ss;
- env.dump_stack(ss);
+ env.dump_stack(ss, STACK_DUMP_LIMIT);
env.dump_global_registers(ss);
env.dump_local_registers(ss);
env.dump_local_variables(ss);
@@ -385,7 +390,7 @@
IF_VERBOSE_ACTION (
log_action(_("After execution: PC " SIZET_FMT ", next PC "
SIZET_FMT ", stack follows"), pc, next_pc);
stringstream ss;
- env.dump_stack(ss);
+ env.dump_stack(ss, STACK_DUMP_LIMIT);
env.dump_global_registers(ss);
env.dump_local_registers(ss);
env.dump_local_variables(ss);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/as_environment.cpp serve...,
Sandro Santilli <=