aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-03 16:50:27 +0000
committerFilippos Karapetis2010-01-03 16:50:27 +0000
commit6a25bd2b8a135dff9760e45ffd0501d3b7c928bc (patch)
tree8dec0f40f9406c15f652ca4c9e2b52c7109e7eec
parent6271dc2821c85eb162be15647e71596e887eb23a (diff)
downloadscummvm-rg350-6a25bd2b8a135dff9760e45ffd0501d3b7c928bc.tar.gz
scummvm-rg350-6a25bd2b8a135dff9760e45ffd0501d3b7c928bc.tar.bz2
scummvm-rg350-6a25bd2b8a135dff9760e45ffd0501d3b7c928bc.zip
The backtrace command now outputs to the graphical console
svn-id: r46934
-rw-r--r--engines/sci/console.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index fcb0ab5340..9f17f24a51 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2099,7 +2099,7 @@ bool Console::cmdSetAccumulator(int argc, const char **argv) {
bool Console::cmdBacktrace(int argc, const char **argv) {
DebugPrintf("Dumping the send/self/super/call/calle/callb stack:\n");
- printf("Call stack (current base: 0x%x):\n", _vm->_gamestate->execution_stack_base);
+ DebugPrintf("Call stack (current base: 0x%x):\n", _vm->_gamestate->execution_stack_base);
Common::List<ExecStack>::iterator iter;
uint i = 0;
@@ -2112,17 +2112,17 @@ bool Console::cmdBacktrace(int argc, const char **argv) {
switch (call.type) {
case EXEC_STACK_TYPE_CALL: {// Normal function
- printf(" %x:[%x] %s::%s(", i, call.origin, objname, (call.selector == -1) ? "<call[be]?>" :
+ DebugPrintf(" %x:[%x] %s::%s(", i, call.origin, objname, (call.selector == -1) ? "<call[be]?>" :
selector_name(_vm->_gamestate, call.selector));
}
break;
case EXEC_STACK_TYPE_KERNEL: // Kernel function
- printf(" %x:[%x] k%s(", i, call.origin, _vm->getKernel()->getKernelName(call.selector).c_str());
+ DebugPrintf(" %x:[%x] k%s(", i, call.origin, _vm->getKernel()->getKernelName(call.selector).c_str());
break;
case EXEC_STACK_TYPE_VARSELECTOR:
- printf(" %x:[%x] vs%s %s::%s (", i, call.origin, (call.argc) ? "write" : "read",
+ DebugPrintf(" %x:[%x] vs%s %s::%s (", i, call.origin, (call.argc) ? "write" : "read",
objname, _vm->getKernel()->getSelectorName(call.selector).c_str());
break;
}
@@ -2133,31 +2133,31 @@ bool Console::cmdBacktrace(int argc, const char **argv) {
totalparamc = 16;
for (paramc = 1; paramc <= totalparamc; paramc++) {
- printf("%04x:%04x", PRINT_REG(call.variables_argp[paramc]));
+ DebugPrintf("%04x:%04x", PRINT_REG(call.variables_argp[paramc]));
if (paramc < call.argc)
- printf(", ");
+ DebugPrintf(", ");
}
if (call.argc > 16)
- printf("...");
+ DebugPrintf("...");
- printf(")\n obj@%04x:%04x", PRINT_REG(call.objp));
+ DebugPrintf(")\n obj@%04x:%04x", PRINT_REG(call.objp));
if (call.type == EXEC_STACK_TYPE_CALL) {
- printf(" pc=%04x:%04x", PRINT_REG(call.addr.pc));
+ DebugPrintf(" pc=%04x:%04x", PRINT_REG(call.addr.pc));
if (call.sp == CALL_SP_CARRY)
- printf(" sp,fp:carry");
+ DebugPrintf(" sp,fp:carry");
else {
- printf(" sp=ST:%04x", (unsigned)(call.sp - _vm->_gamestate->stack_base));
- printf(" fp=ST:%04x", (unsigned)(call.fp - _vm->_gamestate->stack_base));
+ DebugPrintf(" sp=ST:%04x", (unsigned)(call.sp - _vm->_gamestate->stack_base));
+ DebugPrintf(" fp=ST:%04x", (unsigned)(call.fp - _vm->_gamestate->stack_base));
}
} else
- printf(" pc:none");
+ DebugPrintf(" pc:none");
- printf(" argp:ST:%04x", (unsigned)(call.variables_argp - _vm->_gamestate->stack_base));
+ DebugPrintf(" argp:ST:%04x", (unsigned)(call.variables_argp - _vm->_gamestate->stack_base));
if (call.type == EXEC_STACK_TYPE_CALL)
- printf(" script: %d", (*(Script *)_vm->_gamestate->_segMan->_heap[call.addr.pc.segment])._nr);
- printf("\n");
+ DebugPrintf(" script: %d", (*(Script *)_vm->_gamestate->_segMan->_heap[call.addr.pc.segment])._nr);
+ DebugPrintf("\n");
}
return true;