aboutsummaryrefslogtreecommitdiff
path: root/scumm/debug.cpp
diff options
context:
space:
mode:
authorJonathan Gray2002-11-02 23:46:04 +0000
committerJonathan Gray2002-11-02 23:46:04 +0000
commitbb8172f7c9ce8e1007a30d5fd36fec76d4bc6886 (patch)
tree447d830b0443b7992a6fbaf03d0789ceee1e001c /scumm/debug.cpp
parent6c4cb7346c873823a476eddf5ebf233becc1121b (diff)
downloadscummvm-rg350-bb8172f7c9ce8e1007a30d5fd36fec76d4bc6886.tar.gz
scummvm-rg350-bb8172f7c9ce8e1007a30d5fd36fec76d4bc6886.tar.bz2
scummvm-rg350-bb8172f7c9ce8e1007a30d5fd36fec76d4bc6886.zip
add the ability to view/set debugging level to the debugger
svn-id: r5386
Diffstat (limited to 'scumm/debug.cpp')
-rw-r--r--scumm/debug.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/scumm/debug.cpp b/scumm/debug.cpp
index 06954dd6a5..b91b52aa06 100644
--- a/scumm/debug.cpp
+++ b/scumm/debug.cpp
@@ -43,9 +43,13 @@ enum {
CMD_DUMPBOX,
CMD_VAR,
CMD_WATCH,
+ CMD_DEBUG_LEVEL,
CMD_QUIT
};
+extern uint16 _debugLevel;
+
+
void ScummDebugger::attach(Scumm *s)
{
if (_s)
@@ -71,6 +75,7 @@ bool ScummDebugger::do_command()
"(c)ontinue -> exit the debugger and continue the program\n"
"(h)elp -> display this help text\n"
"(g)o [numframes] -> increase frame\n"
+ "(l)evel [level] -> set or show debugging level, 0 to disable\n"
"(r)oom [roomnum] -> load room\n"
"(s)cripts -> show running scripts\n"
"(v)ariable -> set or show a variable value\n"
@@ -127,6 +132,26 @@ bool ScummDebugger::do_command()
}
return true;
+ case CMD_DEBUG_LEVEL:
+ if (!_parameters[0]) {
+ if (_s->_debugMode == false)
+ printf("Debugging is not enabled at this time\n");
+ else
+ printf("Debugging is currently at level %d\n", _debugLevel);
+ } else {
+ // set level
+ int level = atoi(_parameters);
+ _debugLevel = level;
+ if (level != 0) {
+ _s->_debugMode = true;
+ printf("Debugging set to level %d\n", level);
+ } else {
+ _s->_debugMode = false;
+ printf("Debugging is now disabled\n");
+ }
+ }
+ return true;
+
case CMD_WATCH:
if (!_parameters[0]) {
printf("Clearing all watches..\n");
@@ -192,6 +217,7 @@ static const DebuggerCommands debugger_commands[] = {
{"b", 1, CMD_DUMPBOX},
{"v", 1, CMD_VAR},
{"w", 1, CMD_WATCH},
+ {"l", 1, CMD_DEBUG_LEVEL},
{"q", 1, CMD_QUIT},
{"", 0, 0}
};