aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/console.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2011-01-15 11:54:20 +0000
committerFilippos Karapetis2011-01-15 11:54:20 +0000
commitc8b3200dd355d0f54928fdb04472bf2363df80fe (patch)
tree9bc6cc5072c0152850e9e8bcb6d4ca8a73197976 /engines/sci/console.cpp
parentcc9f2944ede11bd9adf2633daab34f12500b8a6d (diff)
downloadscummvm-rg350-c8b3200dd355d0f54928fdb04472bf2363df80fe.tar.gz
scummvm-rg350-c8b3200dd355d0f54928fdb04472bf2363df80fe.tar.bz2
scummvm-rg350-c8b3200dd355d0f54928fdb04472bf2363df80fe.zip
SCI: Extended the bpk debug command so that it can also disable a breakpoint on a kernel function
svn-id: r55249
Diffstat (limited to 'engines/sci/console.cpp')
-rw-r--r--engines/sci/console.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 7896a55dac..943be4bfa7 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2947,7 +2947,7 @@ bool Console::cmdGo(int argc, const char **argv) {
bool Console::cmdLogKernel(int argc, const char **argv) {
if (argc < 3) {
DebugPrintf("Logs calls to specified kernel function.\n");
- DebugPrintf("Usage: %s <kernel-function/*> <on/off>\n", argv[0]);
+ DebugPrintf("Usage: %s <kernel function/*> <on/off>\n", argv[0]);
DebugPrintf("Example: %s StrCpy on\n", argv[0]);
return true;
}
@@ -3103,15 +3103,25 @@ bool Console::cmdBreakpointWrite(int argc, const char **argv) {
}
bool Console::cmdBreakpointKernel(int argc, const char **argv) {
- if (argc != 2) {
+ if (argc < 3) {
DebugPrintf("Sets a breakpoint on execution of a kernel function.\n");
- DebugPrintf("Usage: %s <name>\n", argv[0]);
- DebugPrintf("Example: %s DrawPic\n", argv[0]);
+ DebugPrintf("Usage: %s <name> <on/off>\n", argv[0]);
+ DebugPrintf("Example: %s DrawPic on\n", argv[0]);
+ return true;
+ }
+
+ bool breakpoint;
+ if (strcmp(argv[2], "on") == 0)
+ breakpoint = true;
+ else if (strcmp(argv[2], "off") == 0)
+ breakpoint = false;
+ else {
+ DebugPrintf("2nd parameter must be either on or off\n");
return true;
}
- if (g_sci->getKernel()->debugSetFunction(argv[1], -1, true))
- DebugPrintf("Breakpoint enabled for k%s\n", argv[1]);
+ if (g_sci->getKernel()->debugSetFunction(argv[1], -1, breakpoint))
+ DebugPrintf("Breakpoint %s for k%s\n", (breakpoint ? "enabled" : "disabled"), argv[1]);
else
DebugPrintf("Unknown kernel function %s\n", argv[1]);