aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorColin Snover2017-07-29 19:33:56 -0500
committerColin Snover2017-07-30 19:10:50 -0500
commite4b3478d9905e42b96430fb311b92293f295fc78 (patch)
treea9816ac63c67575b78379a0b18b4665ec94093ec /engines/sci
parent06686c09f00700ac07b5503aad41e02696cfdb16 (diff)
downloadscummvm-rg350-e4b3478d9905e42b96430fb311b92293f295fc78.tar.gz
scummvm-rg350-e4b3478d9905e42b96430fb311b92293f295fc78.tar.bz2
scummvm-rg350-e4b3478d9905e42b96430fb311b92293f295fc78.zip
SCI: Show inherited methods when viewing an object in the debugger
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/scriptdebug.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index f31a43cec4..cfe0ebeb64 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -1194,10 +1194,22 @@ bool printObject(reg_t pos) {
con->debugPrintf("\n");
}
con->debugPrintf(" -- methods:\n");
- for (i = 0; i < obj->getMethodCount(); i++) {
- reg_t fptr = obj->getFunction(i);
- con->debugPrintf(" [%03x] %s = %04x:%04x\n", obj->getFuncSelector(i), g_sci->getKernel()->getSelectorName(obj->getFuncSelector(i)).c_str(), PRINT_REG(fptr));
- }
+ Common::Array<Selector> foundMethods;
+ const Object *protoObj = obj;
+ do {
+ for (i = 0; i < protoObj->getMethodCount(); i++) {
+ const Selector selector = protoObj->getFuncSelector(i);
+ if (Common::find(foundMethods.begin(), foundMethods.end(), selector) == foundMethods.end()) {
+ reg_t fptr = protoObj->getFunction(i);
+ con->debugPrintf(" [%03x] ", selector);
+ if (protoObj != obj) {
+ con->debugPrintf("%s::", s->_segMan->getObjectName(protoObj->getPos()));
+ }
+ con->debugPrintf("%s = %04x:%04x\n", g_sci->getKernel()->getSelectorName(selector).c_str(), PRINT_REG(fptr));
+ foundMethods.push_back(selector);
+ }
+ }
+ } while ((protoObj = s->_segMan->getObject(protoObj->getSuperClassSelector())));
Script *scr = s->_segMan->getScriptIfLoaded(pos.getSegment());
if (scr)