SCI: Improve debugger disassembly selector name context

Show additional selector name context when push0, push1, push2 opcodes are used.

Possible matching selector names are always shown for the debugger disassembly when a `pushi` opcode is encountered. This is great as it gives additional context when push is used for call/send related invocations.

It would be nice to additionally show *possible* matching `selector` methods/properties when `push0`, `push1` or `push2` is encountered because selector names start at 0 so the dissassembly never shows selectors 0 through 2 inclusive.
This commit is contained in:
Ralph Caraveo authored and GitHub committed 2023-08-28 23:15:20 +03:00
1 parent dccb48e086
commit f2c2453b80
1 file changed
+4 -1
+4 -1
View File
@@ -256,7 +256,10 @@ reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag,
separator = ", ";
}
if (opcode == op_pushi && param_value < kernel->getSelectorNamesSize()) {
// Provide additional selector name context for all integer push scenarios.
if (opcode >= op_push0 && opcode <= op_push2) {
debugN("%s%s", separator, kernel->getSelectorName(opcode - op_push0).c_str());
} else if (opcode == op_pushi && param_value < kernel->getSelectorNamesSize()) {
debugN("%s%s", separator, kernel->getSelectorName(param_value).c_str());
}
}