DIRECTOR: LINGO: Print variable lists as an extra debug step

This commit is contained in:
Eugene Sandulenko committed 2019-12-29 00:51:16 +01:00
1 parent 6ab1d6ac7b
commit ecaebf7ced
3 files changed
+26

No files matched your search

+10
View File
@@ -58,6 +58,11 @@ void Lingo::execute(uint pc) {
if (debugChannelSet(5, kDebugLingoExec))
printStack("Stack before: ", current);
if (debugChannelSet(9, kDebugLingoExec)) {
debug("Vars after");
printAllVars();
}
debugC(1, kDebugLingoExec, "[%3d]: %s", current, instr.c_str());
_pc++;
@@ -66,6 +71,11 @@ void Lingo::execute(uint pc) {
if (debugChannelSet(5, kDebugLingoExec))
printStack("Stack after: ", current);
if (debugChannelSet(9, kDebugLingoExec)) {
debug("Vars after");
printAllVars();
}
if (_pc >= (*_currentScript).size()) {
warning("Lingo::execute(): Bad PC (%d)", _pc);
break;
+14
View File
@@ -487,4 +487,18 @@ void Lingo::executeImmediateScripts(Frame *frame) {
}
}
void Lingo::printAllVars() {
debugN(" Local vars: ");
for (SymbolHash::iterator i = _localvars->begin(); i != _localvars->end(); ++i) {
debugN("%s, ", (*i)._key.c_str());
}
debug("");
debugN(" Global vars: ");
for (SymbolHash::iterator i = _globalvars.begin(); i != _globalvars.end(); ++i) {
debugN("%s, ", (*i)._key.c_str());
}
debug("");
}
} // End of namespace Director
+2
View File
@@ -231,6 +231,8 @@ public:
int alignTypes(Datum &d1, Datum &d2);
void printAllVars();
int code1(inst code) { _currentScript->push_back(code); return _currentScript->size() - 1; }
int code2(inst code_1, inst code_2) { int o = code1(code_1); code1(code_2); return o; }
int code3(inst code_1, inst code_2, inst code_3) { int o = code1(code_1); code1(code_2); code1(code_3); return o; }