diff options
author | Filippos Karapetis | 2010-05-18 09:18:27 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-05-18 09:18:27 +0000 |
commit | 8b7c29a4adfb3c19583a38d85d8c248072fec40b (patch) | |
tree | 4305f708cb60f63ca05d44a712307e19a070b8ea /engines/sci | |
parent | 3dda73d9a2b65da0dad2d184c52f5ebbee682b59 (diff) | |
download | scummvm-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')
-rw-r--r-- | engines/sci/console.cpp | 1 | ||||
-rw-r--r-- | engines/sci/debug.h | 1 | ||||
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/vm.cpp | 11 | ||||
-rw-r--r-- | engines/sci/engine/vm.h | 3 |
5 files changed, 9 insertions, 11 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 2909f3aafa..6e90569ac3 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -197,6 +197,7 @@ Console::Console(SciEngine *engine) : GUI::Debugger() { g_debugState.runningStep = 0; g_debugState.stopOnEvent = false; g_debugState.debugging = false; + g_debugState.breakpointWasHit = false; } Console::~Console() { diff --git a/engines/sci/debug.h b/engines/sci/debug.h index dbc929e591..637eba89e1 100644 --- a/engines/sci/debug.h +++ b/engines/sci/debug.h @@ -42,6 +42,7 @@ enum DebugSeeking { 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 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 |