aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2010-05-18 09:18:27 +0000
committerFilippos Karapetis2010-05-18 09:18:27 +0000
commit8b7c29a4adfb3c19583a38d85d8c248072fec40b (patch)
tree4305f708cb60f63ca05d44a712307e19a070b8ea /engines/sci/engine
parent3dda73d9a2b65da0dad2d184c52f5ebbee682b59 (diff)
downloadscummvm-rg350-8b7c29a4adfb3c19583a38d85d8c248072fec40b.tar.gz
scummvm-rg350-8b7c29a4adfb3c19583a38d85d8c248072fec40b.tar.bz2
scummvm-rg350-8b7c29a4adfb3c19583a38d85d8c248072fec40b.zip
Moved breakpointWasHit inside the DebugState struct, thus resolving a FIXME
svn-id: r49071
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/scriptdebug.cpp4
-rw-r--r--engines/sci/engine/vm.cpp11
-rw-r--r--engines/sci/engine/vm.h3
3 files changed, 7 insertions, 11 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index da8e74e2d1..583a437ab4 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -309,7 +309,7 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod
}
-void script_debug(EngineState *s, bool bp) {
+void script_debug(EngineState *s) {
// Do we support a separate console?
#if 0
@@ -327,7 +327,7 @@ void script_debug(EngineState *s, bool bp) {
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) {
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index eb12ca4203..40e2d760de 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -54,9 +54,6 @@ int script_abort_flag = 0; // Set to 1 to abort execution. Set to 2 to force a r
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 @@ ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackP
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 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt
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 @@ void run_vm(EngineState *s, bool restoring) {
// 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()) {
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index 67e7835fb4..dc27f2fe1c 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -367,9 +367,8 @@ void run_vm(EngineState *s, bool restoring);
/**
* 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