VirtualBox

source: vbox/trunk/src/VBox/Debugger/VBoxDbgBase.cpp@ 9206

Last change on this file since 9206 was 9206, checked in by vboxsync, 16 years ago

Fixed the console crash: setFocus was called from the console thread.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1/** @file
2 *
3 * VBox Debugger GUI - Base class.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22
23/*******************************************************************************
24* Header Files *
25*******************************************************************************/
26#include <VBox/err.h>
27#include <iprt/assert.h>
28#include "VBoxDbgBase.h"
29
30
31
32VBoxDbgBase::VBoxDbgBase(PVM pVM) : m_pVM(pVM), m_hGUIThread(RTThreadNativeSelf())
33{
34 /*
35 * Register
36 */
37 int rc = VMR3AtStateRegister(pVM, atStateChange, this);
38 AssertRC(rc);
39}
40
41VBoxDbgBase::~VBoxDbgBase()
42{
43 /*
44 * If the VM is still around.
45 */
46 if (m_pVM)
47 {
48 int rc = VMR3AtStateDeregister(m_pVM, atStateChange, this);
49 AssertRC(rc);
50 m_pVM = NULL;
51 }
52}
53
54int VBoxDbgBase::stamReset(const char *pszPat)
55{
56 if (m_pVM)
57 return STAMR3Reset(m_pVM, pszPat);
58 return VERR_INVALID_HANDLE;
59}
60
61int VBoxDbgBase::stamEnum(const char *pszPat, PFNSTAMR3ENUM pfnEnum, void *pvUser)
62{
63 if (m_pVM)
64 return STAMR3Enum(m_pVM, pszPat, pfnEnum, pvUser);
65 return VERR_INVALID_HANDLE;
66}
67
68int VBoxDbgBase::dbgcCreate(PDBGCBACK pBack, unsigned fFlags)
69{
70 if (m_pVM)
71 return DBGCCreate(m_pVM, pBack, fFlags);
72 return VERR_INVALID_HANDLE;
73}
74
75/*static*/ DECLCALLBACK(void) VBoxDbgBase::atStateChange(PVM /*pVM*/, VMSTATE enmState, VMSTATE /*enmOldState*/, void *pvUser)
76{
77 VBoxDbgBase *pThis = (VBoxDbgBase *)pvUser;
78 switch (enmState)
79 {
80 case VMSTATE_TERMINATED:
81 pThis->sigTerminated();
82 pThis->m_pVM = NULL;
83 break;
84
85 default:
86 break;
87 }
88}
89
90void VBoxDbgBase::sigTerminated()
91{
92}
93
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette