Index: /trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp	(revision 51665)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp	(revision 51666)
@@ -510,4 +510,11 @@
 }
 
+#ifdef VBOX_WITH_DEBUGGER_GUI
+QString UIExtraDataManager::debugFlagValue(const QString &strDebugFlagKey) const
+{
+    return extraDataString(strDebugFlagKey).toLower().trimmed();
+}
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+
 QRect UIExtraDataManager::machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QString &strId) const
 {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h	(revision 51665)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h	(revision 51666)
@@ -173,4 +173,9 @@
     /** Defines selector-window preview update @a interval. */
     void setSelectorWindowPreviewUpdateInterval(PreviewUpdateIntervalType interval);
+
+#ifdef VBOX_WITH_DEBUGGER_GUI
+    /** Returns debug flag value for passed @a strDebugFlagKey. */
+    QString debugFlagValue(const QString &strDebugFlagKey) const;
+#endif /* VBOX_WITH_DEBUGGER_GUI */
 
     /** Returns geometry for machine-window with @a uScreenIndex in @a visualStateType. */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 51665)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 51666)
@@ -3849,22 +3849,22 @@
 #ifdef VBOX_WITH_DEBUGGER_GUI
 
-bool VBoxGlobal::isDebuggerEnabled(CMachine &aMachine)
-{
-    return isDebuggerWorker(&mDbgEnabled, aMachine, GUI_Dbg_Enabled);
-}
-
-bool VBoxGlobal::isDebuggerAutoShowEnabled(CMachine &aMachine)
-{
-    return isDebuggerWorker(&mDbgAutoShow, aMachine, GUI_Dbg_AutoShow);
-}
-
-bool VBoxGlobal::isDebuggerAutoShowCommandLineEnabled(CMachine &aMachine)
-{
-    return isDebuggerWorker(&mDbgAutoShowCommandLine, aMachine, GUI_Dbg_AutoShow);
-}
-
-bool VBoxGlobal::isDebuggerAutoShowStatisticsEnabled(CMachine &aMachine)
-{
-    return isDebuggerWorker(&mDbgAutoShowStatistics, aMachine, GUI_Dbg_AutoShow);
+bool VBoxGlobal::isDebuggerEnabled() const
+{
+    return isDebuggerWorker(&m_fDbgEnabled, GUI_Dbg_Enabled);
+}
+
+bool VBoxGlobal::isDebuggerAutoShowEnabled() const
+{
+    return isDebuggerWorker(&m_fDbgAutoShow, GUI_Dbg_AutoShow);
+}
+
+bool VBoxGlobal::isDebuggerAutoShowCommandLineEnabled() const
+{
+    return isDebuggerWorker(&m_fDbgAutoShowCommandLine, GUI_Dbg_AutoShow);
+}
+
+bool VBoxGlobal::isDebuggerAutoShowStatisticsEnabled() const
+{
+    return isDebuggerWorker(&m_fDbgAutoShowStatistics, GUI_Dbg_AutoShow);
 }
 
@@ -4025,10 +4025,10 @@
 #ifdef VBOX_WITH_DEBUGGER_GUI
 # ifdef VBOX_WITH_DEBUGGER_GUI_MENU
-    initDebuggerVar(&mDbgEnabled, "VBOX_GUI_DBG_ENABLED", GUI_Dbg_Enabled, true);
+    initDebuggerVar(&m_fDbgEnabled, "VBOX_GUI_DBG_ENABLED", GUI_Dbg_Enabled, true);
 # else
-    initDebuggerVar(&mDbgEnabled, "VBOX_GUI_DBG_ENABLED", GUI_Dbg_Enabled, false);
+    initDebuggerVar(&m_fDbgEnabled, "VBOX_GUI_DBG_ENABLED", GUI_Dbg_Enabled, false);
 # endif
-    initDebuggerVar(&mDbgAutoShow, "VBOX_GUI_DBG_AUTO_SHOW", GUI_Dbg_AutoShow, false);
-    mDbgAutoShowCommandLine = mDbgAutoShowStatistics = mDbgAutoShow;
+    initDebuggerVar(&m_fDbgAutoShow, "VBOX_GUI_DBG_AUTO_SHOW", GUI_Dbg_AutoShow, false);
+    m_fDbgAutoShowCommandLine = m_fDbgAutoShowStatistics = m_fDbgAutoShow;
     mStartPaused = false;
 #endif
@@ -4147,33 +4147,33 @@
 #ifdef VBOX_WITH_DEBUGGER_GUI
         else if (!::strcmp(arg, "-dbg") || !::strcmp (arg, "--dbg"))
-            setDebuggerVar(&mDbgEnabled, true);
+            setDebuggerVar(&m_fDbgEnabled, true);
         else if (!::strcmp( arg, "-debug") || !::strcmp (arg, "--debug"))
         {
-            setDebuggerVar(&mDbgEnabled, true);
-            setDebuggerVar(&mDbgAutoShow, true);
-            setDebuggerVar(&mDbgAutoShowCommandLine, true);
-            setDebuggerVar(&mDbgAutoShowStatistics, true);
+            setDebuggerVar(&m_fDbgEnabled, true);
+            setDebuggerVar(&m_fDbgAutoShow, true);
+            setDebuggerVar(&m_fDbgAutoShowCommandLine, true);
+            setDebuggerVar(&m_fDbgAutoShowStatistics, true);
             mStartPaused = true;
         }
         else if (!::strcmp(arg, "--debug-command-line"))
         {
-            setDebuggerVar(&mDbgEnabled, true);
-            setDebuggerVar(&mDbgAutoShow, true);
-            setDebuggerVar(&mDbgAutoShowCommandLine, true);
+            setDebuggerVar(&m_fDbgEnabled, true);
+            setDebuggerVar(&m_fDbgAutoShow, true);
+            setDebuggerVar(&m_fDbgAutoShowCommandLine, true);
             mStartPaused = true;
         }
         else if (!::strcmp(arg, "--debug-statistics"))
         {
-            setDebuggerVar(&mDbgEnabled, true);
-            setDebuggerVar(&mDbgAutoShow, true);
-            setDebuggerVar(&mDbgAutoShowStatistics, true);
+            setDebuggerVar(&m_fDbgEnabled, true);
+            setDebuggerVar(&m_fDbgAutoShow, true);
+            setDebuggerVar(&m_fDbgAutoShowStatistics, true);
             mStartPaused = true;
         }
         else if (!::strcmp(arg, "-no-debug") || !::strcmp(arg, "--no-debug"))
         {
-            setDebuggerVar(&mDbgEnabled, false);
-            setDebuggerVar(&mDbgAutoShow, false);
-            setDebuggerVar(&mDbgAutoShowCommandLine, false);
-            setDebuggerVar(&mDbgAutoShowStatistics, false);
+            setDebuggerVar(&m_fDbgEnabled, false);
+            setDebuggerVar(&m_fDbgAutoShow, false);
+            setDebuggerVar(&m_fDbgAutoShowCommandLine, false);
+            setDebuggerVar(&m_fDbgAutoShowStatistics, false);
         }
         /* Not quite debug options, but they're only useful with the debugger bits. */
@@ -4241,14 +4241,14 @@
     /* setup the debugger gui. */
     if (RTEnvExist("VBOX_GUI_NO_DEBUGGER"))
-        mDbgEnabled = mDbgAutoShow =  mDbgAutoShowCommandLine = mDbgAutoShowStatistics = false;
-    if (mDbgEnabled)
+        m_fDbgEnabled = m_fDbgAutoShow =  m_fDbgAutoShowCommandLine = m_fDbgAutoShowStatistics = false;
+    if (m_fDbgEnabled)
     {
         RTERRINFOSTATIC ErrInfo;
         RTErrInfoInitStatic(&ErrInfo);
-        int vrc = SUPR3HardenedLdrLoadAppPriv("VBoxDbg", &mhVBoxDbg, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core);
+        int vrc = SUPR3HardenedLdrLoadAppPriv("VBoxDbg", &m_hVBoxDbg, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core);
         if (RT_FAILURE(vrc))
         {
-            mhVBoxDbg = NIL_RTLDRMOD;
-            mDbgAutoShow =  mDbgAutoShowCommandLine = mDbgAutoShowStatistics = false;
+            m_hVBoxDbg = NIL_RTLDRMOD;
+            m_fDbgAutoShow =  m_fDbgAutoShowCommandLine = m_fDbgAutoShowStatistics = false;
             LogRel(("Failed to load VBoxDbg, rc=%Rrc - %s\n", vrc, ErrInfo.Core.pszMsg));
         }
@@ -4470,12 +4470,11 @@
  * @returns true / false.
  * @param   piDbgCfgVar         The debugger config variable to consult.
- * @param   rMachine            Reference to the machine object.
  * @param   pszExtraDataName    The extra data name relating to this variable.
  */
-bool VBoxGlobal::isDebuggerWorker(int *piDbgCfgVar, CMachine &rMachine, const char *pszExtraDataName)
-{
-    if (!(*piDbgCfgVar & VBOXGLOBAL_DBG_CFG_VAR_DONE) && !rMachine.isNull())
-    {
-        QString str = mVBox.GetExtraData(pszExtraDataName).toLower().trimmed();
+bool VBoxGlobal::isDebuggerWorker(int *piDbgCfgVar, const char *pszExtraDataName) const
+{
+    if (!(*piDbgCfgVar & VBOXGLOBAL_DBG_CFG_VAR_DONE))
+    {
+        const QString str = gEDataManager->debugFlagValue(pszExtraDataName);
         if (str.contains("veto"))
             *piDbgCfgVar = VBOXGLOBAL_DBG_CFG_VAR_DONE | VBOXGLOBAL_DBG_CFG_VAR_FALSE;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h	(revision 51665)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h	(revision 51666)
@@ -140,18 +140,13 @@
 
 #ifdef VBOX_WITH_DEBUGGER_GUI
-    bool isDebuggerEnabled(CMachine &aMachine);
-    bool isDebuggerAutoShowEnabled(CMachine &aMachine);
-    bool isDebuggerAutoShowCommandLineEnabled(CMachine &aMachine);
-    bool isDebuggerAutoShowStatisticsEnabled(CMachine &aMachine);
-    RTLDRMOD getDebuggerModule() const { return mhVBoxDbg; }
+    bool isDebuggerEnabled() const;
+    bool isDebuggerAutoShowEnabled() const;
+    bool isDebuggerAutoShowCommandLineEnabled() const;
+    bool isDebuggerAutoShowStatisticsEnabled() const;
+
+    RTLDRMOD getDebuggerModule() const { return m_hVBoxDbg; }
 
     bool isStartPausedEnabled() const { return mStartPaused; }
-#else
-    bool isDebuggerAutoShowEnabled(CMachine & /*aMachine*/) const { return false; }
-    bool isDebuggerAutoShowCommandLineEnabled(CMachine & /*aMachine*/) const { return false; }
-    bool isDebuggerAutoShowStatisticsEnabled(CMachine & /*aMachine*/) const { return false; }
-
-    bool isStartPausedEnabled() const { return false; }
-#endif
+#endif /* VBOX_WITH_DEBUGGER_GUI */
 
     /* VBox enum to/from string/icon/color convertors */
@@ -407,5 +402,5 @@
     void initDebuggerVar(int *piDbgCfgVar, const char *pszEnvVar, const char *pszExtraDataName, bool fDefault = false);
     void setDebuggerVar(int *piDbgCfgVar, bool fState);
-    bool isDebuggerWorker(int *piDbgCfgVar, CMachine &rMachine, const char *pszExtraDataName);
+    bool isDebuggerWorker(int *piDbgCfgVar, const char *pszExtraDataName) const;
 #endif
 
@@ -451,16 +446,16 @@
 #ifdef VBOX_WITH_DEBUGGER_GUI
     /** Whether the debugger should be accessible or not.
-     * Use --dbg, the env.var. VBOX_GUI_DBG_ENABLED, --debug or the env.var.
-     * VBOX_GUI_DBG_AUTO_SHOW to enable. */
-    int mDbgEnabled;
+     * Use --dbg, the env.var. VBOX_GUI_DBG_ENABLED,
+     *     --debug or the env.var. VBOX_GUI_DBG_AUTO_SHOW to enable. */
+    mutable int m_fDbgEnabled;
     /** Whether to show the debugger automatically with the console.
      * Use --debug or the env.var. VBOX_GUI_DBG_AUTO_SHOW to enable. */
-    int mDbgAutoShow;
-    /** Whether to show the command line window when mDbgAutoShow is set. */
-    int mDbgAutoShowCommandLine;
-    /** Whether to show the statistics window when mDbgAutoShow is set. */
-    int mDbgAutoShowStatistics;
+    mutable int m_fDbgAutoShow;
+    /** Whether to show the command line window when m_fDbgAutoShow is set. */
+    mutable int m_fDbgAutoShowCommandLine;
+    /** Whether to show the statistics window when m_fDbgAutoShow is set. */
+    mutable int m_fDbgAutoShowStatistics;
     /** VBoxDbg module handle. */
-    RTLDRMOD mhVBoxDbg;
+    RTLDRMOD m_hVBoxDbg;
 
     /** Whether to start the VM in paused state or not. */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 51665)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 51666)
@@ -1047,17 +1047,9 @@
 void UIMachineLogic::prepareDebugger()
 {
-    CMachine machine = uisession()->session().GetMachine();
-    if (!machine.isNull() && vboxGlobal().isDebuggerAutoShowEnabled(machine))
-    {
-        /* console in upper left corner of the desktop. */
-//        QRect rct (0, 0, 0, 0);
-//        QDesktopWidget *desktop = QApplication::desktop();
-//        if (desktop)
-//            rct = desktop->availableGeometry(pos());
-//        move (QPoint (rct.x(), rct.y()));
-
-        if (vboxGlobal().isDebuggerAutoShowStatisticsEnabled(machine))
+    if (vboxGlobal().isDebuggerAutoShowEnabled())
+    {
+        if (vboxGlobal().isDebuggerAutoShowStatisticsEnabled())
             sltShowDebugStatistics();
-        if (vboxGlobal().isDebuggerAutoShowCommandLineEnabled(machine))
+        if (vboxGlobal().isDebuggerAutoShowCommandLineEnabled())
             sltShowDebugCommandLine();
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp	(revision 51665)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp	(revision 51666)
@@ -177,6 +177,5 @@
     if (fOptions & RuntimeMenuType_Debug)
     {
-        CMachine machine = m_pSession->session().GetMachine();
-        if (vboxGlobal().isDebuggerEnabled(machine))
+        if (vboxGlobal().isDebuggerEnabled())
         {
             QMenu *pMenuDebug = gActionPool->action(UIActionIndexRuntime_Menu_Debug)->menu();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 51665)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 51666)
@@ -565,19 +565,15 @@
     if (m_sizeHintOverride.isValid())
         return m_sizeHintOverride;
-#ifdef VBOX_WITH_DEBUGGER
+#ifdef VBOX_WITH_DEBUGGER_GUI
     // TODO: Fix all DEBUGGER stuff!
     /* HACK ALERT! Really ugly workaround for the resizing to 9x1 done by DevVGA if provoked before power on. */
     QSize fb(m_pFrameBuffer->width(), m_pFrameBuffer->height());
     if (fb.width() < 16 || fb.height() < 16)
-    {
-        CMachine machine = uisession()->session().GetMachine();
-        if (   vboxGlobal().isStartPausedEnabled()
-            || vboxGlobal().isDebuggerAutoShowEnabled(machine))
-        fb = QSize(640, 480);
-    }
+        if (vboxGlobal().isStartPausedEnabled() || vboxGlobal().isDebuggerAutoShowEnabled())
+            fb = QSize(640, 480);
     return QSize(fb.width() + frameWidth() * 2, fb.height() + frameWidth() * 2);
-#else /* VBOX_WITH_DEBUGGER */
+#else /* !VBOX_WITH_DEBUGGER_GUI */
     return QSize(m_pFrameBuffer->width() + frameWidth() * 2, m_pFrameBuffer->height() + frameWidth() * 2);
-#endif /* !VBOX_WITH_DEBUGGER */
+#endif /* !VBOX_WITH_DEBUGGER_GUI */
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 51665)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 51666)
@@ -257,6 +257,10 @@
 
     /* Power UP machine: */
-    CProgress progress = vboxGlobal().isStartPausedEnabled() || vboxGlobal().isDebuggerAutoShowEnabled(machine) ?
+#ifdef VBOX_WITH_DEBUGGER_GUI
+    CProgress progress = vboxGlobal().isStartPausedEnabled() || vboxGlobal().isDebuggerAutoShowEnabled() ?
                          console.PowerUpPaused() : console.PowerUp();
+#else /* !VBOX_WITH_DEBUGGER_GUI */
+    CProgress progress = console.PowerUp();
+#endif /* !VBOX_WITH_DEBUGGER_GUI */
 
     /* Check for immediate failure: */
