aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/scriptdebug.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2017-05-26 13:03:04 +0200
committerWillem Jan Palenstijn2017-06-10 21:32:35 +0200
commit3554875c7a583f03aea0c8192b8c0b53b76ddde7 (patch)
tree876413df82bebd29addf728826c97e367a8a44eb /engines/sci/engine/scriptdebug.cpp
parent61f07c13d3e2f0b3967eeb43523855493f7f89d6 (diff)
downloadscummvm-rg350-3554875c7a583f03aea0c8192b8c0b53b76ddde7.tar.gz
scummvm-rg350-3554875c7a583f03aea0c8192b8c0b53b76ddde7.tar.bz2
scummvm-rg350-3554875c7a583f03aea0c8192b8c0b53b76ddde7.zip
SCI: Fix wildcard selector breakpoints
0f9c33e02f1cb2c740c1eb0dcaad96dd22ec29e7 in 2011 broke selector breakpoints of the type "ObjName::", which previously caught all selector sends of the named object. Thanks to TMM and snover for noticing.
Diffstat (limited to 'engines/sci/engine/scriptdebug.cpp')
-rw-r--r--engines/sci/engine/scriptdebug.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 09b38d1bac..6a2324e4ee 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -681,11 +681,14 @@ void Kernel::dissectScript(int scriptNumber, Vocabulary *vocab) {
bool SciEngine::checkSelectorBreakpoint(BreakpointType breakpointType, reg_t send_obj, int selector) {
Common::String methodName = _gamestate->_segMan->getObjectName(send_obj);
- methodName += ("::" + getKernel()->getSelectorName(selector));
+ methodName += "::" + getKernel()->getSelectorName(selector);
Common::List<Breakpoint>::const_iterator bpIter;
for (bpIter = _debugState._breakpoints.begin(); bpIter != _debugState._breakpoints.end(); ++bpIter) {
- if ((*bpIter).type == breakpointType && (*bpIter).name == methodName) {
+ if (bpIter->type != breakpointType)
+ continue;
+ if (bpIter->name == methodName ||
+ (bpIter->name.hasSuffix("::") && methodName.hasPrefix(bpIter->name))) {
_console->debugPrintf("Break on %s (in [%04x:%04x])\n", methodName.c_str(), PRINT_REG(send_obj));
_debugState.debugging = true;
_debugState.breakpointWasHit = true;