diff options
author | D G Turner | 2014-06-05 02:17:08 +0100 |
---|---|---|
committer | D G Turner | 2014-06-05 02:18:58 +0100 |
commit | 1e6fe10e3d5febb178cc7f009295a386da579066 (patch) | |
tree | dab2f8153147cd6e3750d9049db7bd28a969c0b5 | |
parent | 81be074d38e23dcec5da353cfc0254b2fffe9aef (diff) | |
download | scummvm-rg350-1e6fe10e3d5febb178cc7f009295a386da579066.tar.gz scummvm-rg350-1e6fe10e3d5febb178cc7f009295a386da579066.tar.bz2 scummvm-rg350-1e6fe10e3d5febb178cc7f009295a386da579066.zip |
COMMON: Add "all" option to debugflag controls in GUI Debugger.
-rw-r--r-- | common/debug-channels.h | 11 | ||||
-rw-r--r-- | common/debug.cpp | 11 | ||||
-rw-r--r-- | gui/debugger.cpp | 14 |
3 files changed, 29 insertions, 7 deletions
diff --git a/common/debug-channels.h b/common/debug-channels.h index 83f416a3b8..1414a1053a 100644 --- a/common/debug-channels.h +++ b/common/debug-channels.h @@ -95,8 +95,6 @@ public: */ bool disableDebugChannel(const String &name); - - typedef List<DebugChannel> DebugChannelList; /** @@ -106,6 +104,15 @@ public: */ DebugChannelList listDebugChannels(); + /** + * Enable all debug channels. + */ + void enableAllDebugChannels(); + + /** + * Disable all debug channels. + */ + void disableAllDebugChannels(); /** * Test whether the given debug channel is enabled. diff --git a/common/debug.cpp b/common/debug.cpp index 58cc0287a8..b8c345e4f0 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -85,7 +85,6 @@ bool DebugManager::disableDebugChannel(const String &name) { } } - DebugManager::DebugChannelList DebugManager::listDebugChannels() { DebugChannelList tmp; for (DebugChannelMap::iterator i = gDebugChannels.begin(); i != gDebugChannels.end(); ++i) @@ -95,6 +94,16 @@ DebugManager::DebugChannelList DebugManager::listDebugChannels() { return tmp; } +void DebugManager::enableAllDebugChannels() { + for (DebugChannelMap::iterator i = gDebugChannels.begin(); i != gDebugChannels.end(); ++i) + enableDebugChannel(i->_value.name); +} + +void DebugManager::disableAllDebugChannels() { + for (DebugChannelMap::iterator i = gDebugChannels.begin(); i != gDebugChannels.end(); ++i) + disableDebugChannel(i->_value.name); +} + bool DebugManager::isDebugChannelEnabled(uint32 channel) { // Debug level 11 turns on all special debug level messages if (gDebugLevel == 11) diff --git a/gui/debugger.cpp b/gui/debugger.cpp index 4d97338b9c..21d49774af 100644 --- a/gui/debugger.cpp +++ b/gui/debugger.cpp @@ -542,9 +542,12 @@ bool Debugger::cmdDebugFlagsList(int argc, const char **argv) { bool Debugger::cmdDebugFlagEnable(int argc, const char **argv) { if (argc < 2) { - debugPrintf("debugflag_enable <flag>\n"); + debugPrintf("debugflag_enable [<flag> | all]\n"); } else { - if (DebugMan.enableDebugChannel(argv[1])) { + if (Common::String(argv[1]) == "all") { + debugPrintf("Enabled all debug flags\n"); + DebugMan.enableAllDebugChannels(); + } else if (DebugMan.enableDebugChannel(argv[1])) { debugPrintf("Enabled debug flag '%s'\n", argv[1]); } else { debugPrintf("Failed to enable debug flag '%s'\n", argv[1]); @@ -555,9 +558,12 @@ bool Debugger::cmdDebugFlagEnable(int argc, const char **argv) { bool Debugger::cmdDebugFlagDisable(int argc, const char **argv) { if (argc < 2) { - debugPrintf("debugflag_disable <flag>\n"); + debugPrintf("debugflag_disable [<flag> | all]\n"); } else { - if (DebugMan.disableDebugChannel(argv[1])) { + if (Common::String(argv[1]) == "all") { + debugPrintf("Disabled all debug flags\n"); + DebugMan.disableAllDebugChannels(); + } else if (DebugMan.disableDebugChannel(argv[1])) { debugPrintf("Disabled debug flag '%s'\n", argv[1]); } else { debugPrintf("Failed to disable debug flag '%s'\n", argv[1]); |