[Scummvm-cvs-logs] SF.net SVN: scummvm:[49071] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue May 18 11:18:28 CEST 2010


Revision: 49071
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49071&view=rev
Author:   thebluegr
Date:     2010-05-18 09:18:27 +0000 (Tue, 18 May 2010)

Log Message:
-----------
Moved breakpointWasHit inside the DebugState struct, thus resolving a FIXME

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/debug.h
    scummvm/trunk/engines/sci/engine/scriptdebug.cpp
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/sci/engine/vm.h

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2010-05-18 04:17:58 UTC (rev 49070)
+++ scummvm/trunk/engines/sci/console.cpp	2010-05-18 09:18:27 UTC (rev 49071)
@@ -197,6 +197,7 @@
 	g_debugState.runningStep = 0;
 	g_debugState.stopOnEvent = false;
 	g_debugState.debugging = false;
+	g_debugState.breakpointWasHit = false;
 }
 
 Console::~Console() {

Modified: scummvm/trunk/engines/sci/debug.h
===================================================================
--- scummvm/trunk/engines/sci/debug.h	2010-05-18 04:17:58 UTC (rev 49070)
+++ scummvm/trunk/engines/sci/debug.h	2010-05-18 09:18:27 UTC (rev 49071)
@@ -42,6 +42,7 @@
 
 struct DebugState {
 	bool debugging;
+	bool breakpointWasHit;
 	bool stopOnEvent;
 	DebugSeeking seeking;		// Stepping forward until some special condition is met
 	int runningStep;			// Set to > 0 to allow multiple stepping

Modified: scummvm/trunk/engines/sci/engine/scriptdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2010-05-18 04:17:58 UTC (rev 49070)
+++ scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2010-05-18 09:18:27 UTC (rev 49071)
@@ -309,7 +309,7 @@
 }
 
 
-void script_debug(EngineState *s, bool bp) {
+void script_debug(EngineState *s) {
 	// Do we support a separate console?
 
 #if 0
@@ -327,7 +327,7 @@
 		return;
 #endif
 
-	if (g_debugState.seeking && !bp) { // Are we looking for something special?
+	if (g_debugState.seeking && !g_debugState.breakpointWasHit) { // Are we looking for something special?
 		SegmentObj *mobj = GET_SEGMENT(*s->_segMan, scriptState.xs->addr.pc.segment, SEG_TYPE_SCRIPT);
 
 		if (mobj) {

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2010-05-18 04:17:58 UTC (rev 49070)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2010-05-18 09:18:27 UTC (rev 49071)
@@ -54,9 +54,6 @@
 int script_step_counter = 0; // Counts the number of steps executed	// FIXME: Avoid non-const global vars
 int script_gc_interval = GC_INTERVAL; // Number of steps in between gcs	// FIXME: Avoid non-const global vars
 
-static bool breakpointWasHit = false;	// FIXME: Avoid non-const global vars
-
-
 #define SCI_XS_CALLEE_LOCALS ((SegmentId)-1)
 
 /**
@@ -290,7 +287,7 @@
 				Console *con = g_sci->getSciDebugger();
 				con->DebugPrintf("Break on script %d, export %d\n", script, pubfunct);
 				g_debugState.debugging = true;
-				breakpointWasHit = true;
+				g_debugState.breakpointWasHit = true;
 				break;
 			}
 		}
@@ -373,8 +370,8 @@
 					Console *con = g_sci->getSciDebugger();
 					con->DebugPrintf("Break on %s (in [%04x:%04x])\n", method_name, PRINT_REG(send_obj));
 					print_send_action = 1;
-					breakpointWasHit = true;
 					g_debugState.debugging = true;
+					g_debugState.breakpointWasHit = true;
 					break;
 				}
 			}
@@ -814,8 +811,8 @@
 		// Debug if this has been requested:
 		// TODO: re-implement sci_debug_flags
 		if (g_debugState.debugging /* sci_debug_flags*/) {
-			script_debug(s, breakpointWasHit);
-			breakpointWasHit = false;
+			script_debug(s);
+			g_debugState.breakpointWasHit = false;
 		}
 		Console *con = g_sci->getSciDebugger();
 		if (con->isAttached()) {

Modified: scummvm/trunk/engines/sci/engine/vm.h
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.h	2010-05-18 04:17:58 UTC (rev 49070)
+++ scummvm/trunk/engines/sci/engine/vm.h	2010-05-18 09:18:27 UTC (rev 49071)
@@ -367,9 +367,8 @@
 /**
  * Debugger functionality
  * @param[in] s					The state at which debugging should take place
- * @param[in] bp				Flag, set to true when a breakpoint is triggered
  */
-void script_debug(EngineState *s, bool bp);
+void script_debug(EngineState *s);
 
 /**
  * Initializes a EngineState block


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list