From c3ff7fa73d7d6f4e0d72f371f984dcd8e153620a Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 25 Jan 2011 10:59:45 +0100 Subject: [PATCH] debugger: switch do fkleint's style of debug output enabling --- src/plugins/debugger/gdb/gdbengine.cpp | 11 +++-------- src/plugins/debugger/script/scriptengine.cpp | 13 +++++-------- src/plugins/debugger/watchhandler.cpp | 15 ++++++--------- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index f4b59c91b45..f78d7003590 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -105,16 +105,11 @@ namespace Debugger { namespace Internal { -//#define DEBUG_PENDING 1 - static const char winPythonVersionC[] = "python2.5"; -#if DEBUG_PENDING -# define PENDING_DEBUG(s) qDebug() << s -#else -# define PENDING_DEBUG(s) -#endif -#define PENDING_DEBUGX(s) qDebug() << s +enum { debugPending = 0 }; + +#define PENDING_DEBUG(s) do { if (debugPending) qDebug() << s; } while (0) #define CB(callback) &GdbEngine::callback, STRINGIFY(callback) diff --git a/src/plugins/debugger/script/scriptengine.cpp b/src/plugins/debugger/script/scriptengine.cpp index c8d744ae391..d441e72d27e 100644 --- a/src/plugins/debugger/script/scriptengine.cpp +++ b/src/plugins/debugger/script/scriptengine.cpp @@ -72,18 +72,15 @@ #include #include -//#define DEBUG_SCRIPT 1 -#if DEBUG_SCRIPT -# define SDEBUG(s) qDebug() << s -#else -# define SDEBUG(s) -#endif -# define XSDEBUG(s) qDebug() << s - namespace Debugger { namespace Internal { +enum { debugScript = 0 }; + +#define SDEBUG(s) do { if (debugScript) qDebug() << s; } while (0) +#define XSDEBUG(s) qDebug() << s + /////////////////////////////////////////////////////////////////////// // // ScriptEngine diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 48e5cee97c3..e0017e9dce9 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -61,19 +61,16 @@ #include #include -// Creates debug output for accesses to the model. -//#define DEBUG_MODEL 1 - -#if DEBUG_MODEL -# define MODEL_DEBUG(s) qDebug() << s -#else -# define MODEL_DEBUG(s) -#endif -#define MODEL_DEBUGX(s) qDebug() << s namespace Debugger { namespace Internal { +// Creates debug output for accesses to the model. +enum { debugModel = 0 }; + +#define MODEL_DEBUG(s) do { if (debugModel) qDebug() << s; } while (0) +#define MODEL_DEBUGX(s) qDebug() << s + static const QString strNotInScope = QCoreApplication::translate("Debugger::Internal::WatchData", "");