aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/scriptdebug.cpp
diff options
context:
space:
mode:
authorColin Snover2016-11-05 17:56:15 -0500
committerColin Snover2016-11-20 12:31:43 -0600
commit9380b541204e2ec446d75627b8fad1b78850f356 (patch)
tree16340e97cc926cd44332c7bad5b1cb74c9467055 /engines/sci/engine/scriptdebug.cpp
parent1af7fe8b9616c5ade0af00b7720db0b4967471ff (diff)
downloadscummvm-rg350-9380b541204e2ec446d75627b8fad1b78850f356.tar.gz
scummvm-rg350-9380b541204e2ec446d75627b8fad1b78850f356.tar.bz2
scummvm-rg350-9380b541204e2ec446d75627b8fad1b78850f356.zip
SCI: Add code-address breakpoints to debugger
Diffstat (limited to 'engines/sci/engine/scriptdebug.cpp')
-rw-r--r--engines/sci/engine/scriptdebug.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index b017e62df7..47b360d13b 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -631,6 +631,22 @@ bool SciEngine::checkExportBreakpoint(uint16 script, uint16 pubfunct) {
return false;
}
+bool SciEngine::checkAddressBreakpoint(const reg32_t &address) {
+ if (_debugState._activeBreakpointTypes & BREAK_ADDRESS) {
+ Common::List<Breakpoint>::const_iterator bp;
+ for (bp = _debugState._breakpoints.begin(); bp != _debugState._breakpoints.end(); ++bp) {
+ if (bp->type == BREAK_ADDRESS && bp->regAddress == address) {
+ _console->debugPrintf("Break at %04x:%04x\n", PRINT_REG(address));
+ _debugState.debugging = true;
+ _debugState.breakpointWasHit = true;
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
void debugSelectorCall(reg_t send_obj, Selector selector, int argc, StackPtr argp, ObjVarRef &varp, reg_t funcp, SegManager *segMan, SelectorType selectorType) {
int activeBreakpointTypes = g_sci->_debugState._activeBreakpointTypes;
const char *objectName = segMan->getObjectName(send_obj);