Changeset 51666 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 19, 2014 2:07:14 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 94434
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r51665 r51666 510 510 } 511 511 512 #ifdef VBOX_WITH_DEBUGGER_GUI 513 QString UIExtraDataManager::debugFlagValue(const QString &strDebugFlagKey) const 514 { 515 return extraDataString(strDebugFlagKey).toLower().trimmed(); 516 } 517 #endif /* VBOX_WITH_DEBUGGER_GUI */ 518 512 519 QRect UIExtraDataManager::machineWindowGeometry(UIVisualStateType visualStateType, ulong uScreenIndex, const QString &strId) const 513 520 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r51665 r51666 173 173 /** Defines selector-window preview update @a interval. */ 174 174 void setSelectorWindowPreviewUpdateInterval(PreviewUpdateIntervalType interval); 175 176 #ifdef VBOX_WITH_DEBUGGER_GUI 177 /** Returns debug flag value for passed @a strDebugFlagKey. */ 178 QString debugFlagValue(const QString &strDebugFlagKey) const; 179 #endif /* VBOX_WITH_DEBUGGER_GUI */ 175 180 176 181 /** Returns geometry for machine-window with @a uScreenIndex in @a visualStateType. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r51579 r51666 3849 3849 #ifdef VBOX_WITH_DEBUGGER_GUI 3850 3850 3851 bool VBoxGlobal::isDebuggerEnabled( CMachine &aMachine)3852 { 3853 return isDebuggerWorker(&m DbgEnabled, aMachine, GUI_Dbg_Enabled);3854 } 3855 3856 bool VBoxGlobal::isDebuggerAutoShowEnabled( CMachine &aMachine)3857 { 3858 return isDebuggerWorker(&m DbgAutoShow, aMachine, GUI_Dbg_AutoShow);3859 } 3860 3861 bool VBoxGlobal::isDebuggerAutoShowCommandLineEnabled( CMachine &aMachine)3862 { 3863 return isDebuggerWorker(&m DbgAutoShowCommandLine, aMachine, GUI_Dbg_AutoShow);3864 } 3865 3866 bool VBoxGlobal::isDebuggerAutoShowStatisticsEnabled( CMachine &aMachine)3867 { 3868 return isDebuggerWorker(&m DbgAutoShowStatistics, aMachine, GUI_Dbg_AutoShow);3851 bool VBoxGlobal::isDebuggerEnabled() const 3852 { 3853 return isDebuggerWorker(&m_fDbgEnabled, GUI_Dbg_Enabled); 3854 } 3855 3856 bool VBoxGlobal::isDebuggerAutoShowEnabled() const 3857 { 3858 return isDebuggerWorker(&m_fDbgAutoShow, GUI_Dbg_AutoShow); 3859 } 3860 3861 bool VBoxGlobal::isDebuggerAutoShowCommandLineEnabled() const 3862 { 3863 return isDebuggerWorker(&m_fDbgAutoShowCommandLine, GUI_Dbg_AutoShow); 3864 } 3865 3866 bool VBoxGlobal::isDebuggerAutoShowStatisticsEnabled() const 3867 { 3868 return isDebuggerWorker(&m_fDbgAutoShowStatistics, GUI_Dbg_AutoShow); 3869 3869 } 3870 3870 … … 4025 4025 #ifdef VBOX_WITH_DEBUGGER_GUI 4026 4026 # ifdef VBOX_WITH_DEBUGGER_GUI_MENU 4027 initDebuggerVar(&m DbgEnabled, "VBOX_GUI_DBG_ENABLED", GUI_Dbg_Enabled, true);4027 initDebuggerVar(&m_fDbgEnabled, "VBOX_GUI_DBG_ENABLED", GUI_Dbg_Enabled, true); 4028 4028 # else 4029 initDebuggerVar(&m DbgEnabled, "VBOX_GUI_DBG_ENABLED", GUI_Dbg_Enabled, false);4029 initDebuggerVar(&m_fDbgEnabled, "VBOX_GUI_DBG_ENABLED", GUI_Dbg_Enabled, false); 4030 4030 # endif 4031 initDebuggerVar(&m DbgAutoShow, "VBOX_GUI_DBG_AUTO_SHOW", GUI_Dbg_AutoShow, false);4032 m DbgAutoShowCommandLine = mDbgAutoShowStatistics = mDbgAutoShow;4031 initDebuggerVar(&m_fDbgAutoShow, "VBOX_GUI_DBG_AUTO_SHOW", GUI_Dbg_AutoShow, false); 4032 m_fDbgAutoShowCommandLine = m_fDbgAutoShowStatistics = m_fDbgAutoShow; 4033 4033 mStartPaused = false; 4034 4034 #endif … … 4147 4147 #ifdef VBOX_WITH_DEBUGGER_GUI 4148 4148 else if (!::strcmp(arg, "-dbg") || !::strcmp (arg, "--dbg")) 4149 setDebuggerVar(&m DbgEnabled, true);4149 setDebuggerVar(&m_fDbgEnabled, true); 4150 4150 else if (!::strcmp( arg, "-debug") || !::strcmp (arg, "--debug")) 4151 4151 { 4152 setDebuggerVar(&m DbgEnabled, true);4153 setDebuggerVar(&m DbgAutoShow, true);4154 setDebuggerVar(&m DbgAutoShowCommandLine, true);4155 setDebuggerVar(&m DbgAutoShowStatistics, true);4152 setDebuggerVar(&m_fDbgEnabled, true); 4153 setDebuggerVar(&m_fDbgAutoShow, true); 4154 setDebuggerVar(&m_fDbgAutoShowCommandLine, true); 4155 setDebuggerVar(&m_fDbgAutoShowStatistics, true); 4156 4156 mStartPaused = true; 4157 4157 } 4158 4158 else if (!::strcmp(arg, "--debug-command-line")) 4159 4159 { 4160 setDebuggerVar(&m DbgEnabled, true);4161 setDebuggerVar(&m DbgAutoShow, true);4162 setDebuggerVar(&m DbgAutoShowCommandLine, true);4160 setDebuggerVar(&m_fDbgEnabled, true); 4161 setDebuggerVar(&m_fDbgAutoShow, true); 4162 setDebuggerVar(&m_fDbgAutoShowCommandLine, true); 4163 4163 mStartPaused = true; 4164 4164 } 4165 4165 else if (!::strcmp(arg, "--debug-statistics")) 4166 4166 { 4167 setDebuggerVar(&m DbgEnabled, true);4168 setDebuggerVar(&m DbgAutoShow, true);4169 setDebuggerVar(&m DbgAutoShowStatistics, true);4167 setDebuggerVar(&m_fDbgEnabled, true); 4168 setDebuggerVar(&m_fDbgAutoShow, true); 4169 setDebuggerVar(&m_fDbgAutoShowStatistics, true); 4170 4170 mStartPaused = true; 4171 4171 } 4172 4172 else if (!::strcmp(arg, "-no-debug") || !::strcmp(arg, "--no-debug")) 4173 4173 { 4174 setDebuggerVar(&m DbgEnabled, false);4175 setDebuggerVar(&m DbgAutoShow, false);4176 setDebuggerVar(&m DbgAutoShowCommandLine, false);4177 setDebuggerVar(&m DbgAutoShowStatistics, false);4174 setDebuggerVar(&m_fDbgEnabled, false); 4175 setDebuggerVar(&m_fDbgAutoShow, false); 4176 setDebuggerVar(&m_fDbgAutoShowCommandLine, false); 4177 setDebuggerVar(&m_fDbgAutoShowStatistics, false); 4178 4178 } 4179 4179 /* Not quite debug options, but they're only useful with the debugger bits. */ … … 4241 4241 /* setup the debugger gui. */ 4242 4242 if (RTEnvExist("VBOX_GUI_NO_DEBUGGER")) 4243 m DbgEnabled = mDbgAutoShow = mDbgAutoShowCommandLine = mDbgAutoShowStatistics = false;4244 if (m DbgEnabled)4243 m_fDbgEnabled = m_fDbgAutoShow = m_fDbgAutoShowCommandLine = m_fDbgAutoShowStatistics = false; 4244 if (m_fDbgEnabled) 4245 4245 { 4246 4246 RTERRINFOSTATIC ErrInfo; 4247 4247 RTErrInfoInitStatic(&ErrInfo); 4248 int vrc = SUPR3HardenedLdrLoadAppPriv("VBoxDbg", &m hVBoxDbg, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core);4248 int vrc = SUPR3HardenedLdrLoadAppPriv("VBoxDbg", &m_hVBoxDbg, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core); 4249 4249 if (RT_FAILURE(vrc)) 4250 4250 { 4251 m hVBoxDbg = NIL_RTLDRMOD;4252 m DbgAutoShow = mDbgAutoShowCommandLine = mDbgAutoShowStatistics = false;4251 m_hVBoxDbg = NIL_RTLDRMOD; 4252 m_fDbgAutoShow = m_fDbgAutoShowCommandLine = m_fDbgAutoShowStatistics = false; 4253 4253 LogRel(("Failed to load VBoxDbg, rc=%Rrc - %s\n", vrc, ErrInfo.Core.pszMsg)); 4254 4254 } … … 4470 4470 * @returns true / false. 4471 4471 * @param piDbgCfgVar The debugger config variable to consult. 4472 * @param rMachine Reference to the machine object.4473 4472 * @param pszExtraDataName The extra data name relating to this variable. 4474 4473 */ 4475 bool VBoxGlobal::isDebuggerWorker(int *piDbgCfgVar, CMachine &rMachine, const char *pszExtraDataName)4476 { 4477 if (!(*piDbgCfgVar & VBOXGLOBAL_DBG_CFG_VAR_DONE) && !rMachine.isNull())4478 { 4479 QString str = mVBox.GetExtraData(pszExtraDataName).toLower().trimmed();4474 bool VBoxGlobal::isDebuggerWorker(int *piDbgCfgVar, const char *pszExtraDataName) const 4475 { 4476 if (!(*piDbgCfgVar & VBOXGLOBAL_DBG_CFG_VAR_DONE)) 4477 { 4478 const QString str = gEDataManager->debugFlagValue(pszExtraDataName); 4480 4479 if (str.contains("veto")) 4481 4480 *piDbgCfgVar = VBOXGLOBAL_DBG_CFG_VAR_DONE | VBOXGLOBAL_DBG_CFG_VAR_FALSE; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r51579 r51666 140 140 141 141 #ifdef VBOX_WITH_DEBUGGER_GUI 142 bool isDebuggerEnabled(CMachine &aMachine); 143 bool isDebuggerAutoShowEnabled(CMachine &aMachine); 144 bool isDebuggerAutoShowCommandLineEnabled(CMachine &aMachine); 145 bool isDebuggerAutoShowStatisticsEnabled(CMachine &aMachine); 146 RTLDRMOD getDebuggerModule() const { return mhVBoxDbg; } 142 bool isDebuggerEnabled() const; 143 bool isDebuggerAutoShowEnabled() const; 144 bool isDebuggerAutoShowCommandLineEnabled() const; 145 bool isDebuggerAutoShowStatisticsEnabled() const; 146 147 RTLDRMOD getDebuggerModule() const { return m_hVBoxDbg; } 147 148 148 149 bool isStartPausedEnabled() const { return mStartPaused; } 149 #else 150 bool isDebuggerAutoShowEnabled(CMachine & /*aMachine*/) const { return false; } 151 bool isDebuggerAutoShowCommandLineEnabled(CMachine & /*aMachine*/) const { return false; } 152 bool isDebuggerAutoShowStatisticsEnabled(CMachine & /*aMachine*/) const { return false; } 153 154 bool isStartPausedEnabled() const { return false; } 155 #endif 150 #endif /* VBOX_WITH_DEBUGGER_GUI */ 156 151 157 152 /* VBox enum to/from string/icon/color convertors */ … … 407 402 void initDebuggerVar(int *piDbgCfgVar, const char *pszEnvVar, const char *pszExtraDataName, bool fDefault = false); 408 403 void setDebuggerVar(int *piDbgCfgVar, bool fState); 409 bool isDebuggerWorker(int *piDbgCfgVar, CMachine &rMachine, const char *pszExtraDataName);404 bool isDebuggerWorker(int *piDbgCfgVar, const char *pszExtraDataName) const; 410 405 #endif 411 406 … … 451 446 #ifdef VBOX_WITH_DEBUGGER_GUI 452 447 /** Whether the debugger should be accessible or not. 453 * Use --dbg, the env.var. VBOX_GUI_DBG_ENABLED, --debug or the env.var.454 * VBOX_GUI_DBG_AUTO_SHOW to enable. */455 int mDbgEnabled;448 * Use --dbg, the env.var. VBOX_GUI_DBG_ENABLED, 449 * --debug or the env.var. VBOX_GUI_DBG_AUTO_SHOW to enable. */ 450 mutable int m_fDbgEnabled; 456 451 /** Whether to show the debugger automatically with the console. 457 452 * Use --debug or the env.var. VBOX_GUI_DBG_AUTO_SHOW to enable. */ 458 int mDbgAutoShow;459 /** Whether to show the command line window when m DbgAutoShow is set. */460 int mDbgAutoShowCommandLine;461 /** Whether to show the statistics window when m DbgAutoShow is set. */462 int mDbgAutoShowStatistics;453 mutable int m_fDbgAutoShow; 454 /** Whether to show the command line window when m_fDbgAutoShow is set. */ 455 mutable int m_fDbgAutoShowCommandLine; 456 /** Whether to show the statistics window when m_fDbgAutoShow is set. */ 457 mutable int m_fDbgAutoShowStatistics; 463 458 /** VBoxDbg module handle. */ 464 RTLDRMOD m hVBoxDbg;459 RTLDRMOD m_hVBoxDbg; 465 460 466 461 /** Whether to start the VM in paused state or not. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r51596 r51666 1047 1047 void UIMachineLogic::prepareDebugger() 1048 1048 { 1049 CMachine machine = uisession()->session().GetMachine(); 1050 if (!machine.isNull() && vboxGlobal().isDebuggerAutoShowEnabled(machine)) 1051 { 1052 /* console in upper left corner of the desktop. */ 1053 // QRect rct (0, 0, 0, 0); 1054 // QDesktopWidget *desktop = QApplication::desktop(); 1055 // if (desktop) 1056 // rct = desktop->availableGeometry(pos()); 1057 // move (QPoint (rct.x(), rct.y())); 1058 1059 if (vboxGlobal().isDebuggerAutoShowStatisticsEnabled(machine)) 1049 if (vboxGlobal().isDebuggerAutoShowEnabled()) 1050 { 1051 if (vboxGlobal().isDebuggerAutoShowStatisticsEnabled()) 1060 1052 sltShowDebugStatistics(); 1061 if (vboxGlobal().isDebuggerAutoShowCommandLineEnabled( machine))1053 if (vboxGlobal().isDebuggerAutoShowCommandLineEnabled()) 1062 1054 sltShowDebugCommandLine(); 1063 1055 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp
r51565 r51666 177 177 if (fOptions & RuntimeMenuType_Debug) 178 178 { 179 CMachine machine = m_pSession->session().GetMachine(); 180 if (vboxGlobal().isDebuggerEnabled(machine)) 179 if (vboxGlobal().isDebuggerEnabled()) 181 180 { 182 181 QMenu *pMenuDebug = gActionPool->action(UIActionIndexRuntime_Menu_Debug)->menu(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r51592 r51666 565 565 if (m_sizeHintOverride.isValid()) 566 566 return m_sizeHintOverride; 567 #ifdef VBOX_WITH_DEBUGGER 567 #ifdef VBOX_WITH_DEBUGGER_GUI 568 568 // TODO: Fix all DEBUGGER stuff! 569 569 /* HACK ALERT! Really ugly workaround for the resizing to 9x1 done by DevVGA if provoked before power on. */ 570 570 QSize fb(m_pFrameBuffer->width(), m_pFrameBuffer->height()); 571 571 if (fb.width() < 16 || fb.height() < 16) 572 { 573 CMachine machine = uisession()->session().GetMachine(); 574 if ( vboxGlobal().isStartPausedEnabled() 575 || vboxGlobal().isDebuggerAutoShowEnabled(machine)) 576 fb = QSize(640, 480); 577 } 572 if (vboxGlobal().isStartPausedEnabled() || vboxGlobal().isDebuggerAutoShowEnabled()) 573 fb = QSize(640, 480); 578 574 return QSize(fb.width() + frameWidth() * 2, fb.height() + frameWidth() * 2); 579 #else /* VBOX_WITH_DEBUGGER*/575 #else /* !VBOX_WITH_DEBUGGER_GUI */ 580 576 return QSize(m_pFrameBuffer->width() + frameWidth() * 2, m_pFrameBuffer->height() + frameWidth() * 2); 581 #endif /* !VBOX_WITH_DEBUGGER */577 #endif /* !VBOX_WITH_DEBUGGER_GUI */ 582 578 } 583 579 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r51593 r51666 257 257 258 258 /* Power UP machine: */ 259 CProgress progress = vboxGlobal().isStartPausedEnabled() || vboxGlobal().isDebuggerAutoShowEnabled(machine) ? 259 #ifdef VBOX_WITH_DEBUGGER_GUI 260 CProgress progress = vboxGlobal().isStartPausedEnabled() || vboxGlobal().isDebuggerAutoShowEnabled() ? 260 261 console.PowerUpPaused() : console.PowerUp(); 262 #else /* !VBOX_WITH_DEBUGGER_GUI */ 263 CProgress progress = console.PowerUp(); 264 #endif /* !VBOX_WITH_DEBUGGER_GUI */ 261 265 262 266 /* Check for immediate failure: */
Note:
See TracChangeset
for help on using the changeset viewer.