VirtualBox

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

Last change on this file since 4753 was 4071, checked in by vboxsync, 17 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1/** @file
2 *
3 * VBox Debugger GUI - Base class.
4 */
5
6/*
7 * Copyright (C) 2006-2007 innotek GmbH
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 as published by the Free Software Foundation,
13 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14 * distribution. VirtualBox OSE is distributed in the hope that it will
15 * be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19/*******************************************************************************
20* Header Files *
21*******************************************************************************/
22#include <VBox/err.h>
23#include <iprt/assert.h>
24#include "VBoxDbgBase.h"
25
26
27
28VBoxDbgBase::VBoxDbgBase(PVM pVM) : m_pVM(pVM)
29{
30 /*
31 * Register
32 */
33 int rc = VMR3AtStateRegister(pVM, atStateChange, this);
34 AssertRC(rc);
35}
36
37VBoxDbgBase::~VBoxDbgBase()
38{
39 /*
40 * If the VM is still around.
41 */
42 if (m_pVM)
43 {
44 int rc = VMR3AtStateDeregister(m_pVM, atStateChange, this);
45 AssertRC(rc);
46 m_pVM = NULL;
47 }
48}
49
50int VBoxDbgBase::stamReset(const char *pszPat)
51{
52 if (m_pVM)
53 return STAMR3Reset(m_pVM, pszPat);
54 return VERR_INVALID_HANDLE;
55}
56
57int VBoxDbgBase::stamEnum(const char *pszPat, PFNSTAMR3ENUM pfnEnum, void *pvUser)
58{
59 if (m_pVM)
60 return STAMR3Enum(m_pVM, pszPat, pfnEnum, pvUser);
61 return VERR_INVALID_HANDLE;
62}
63
64int VBoxDbgBase::dbgcCreate(PDBGCBACK pBack, unsigned fFlags)
65{
66 if (m_pVM)
67 return DBGCCreate(m_pVM, pBack, fFlags);
68 return VERR_INVALID_HANDLE;
69}
70
71/*static*/ DECLCALLBACK(void) VBoxDbgBase::atStateChange(PVM /*pVM*/, VMSTATE enmState, VMSTATE /*enmOldState*/, void *pvUser)
72{
73 VBoxDbgBase *pThis = (VBoxDbgBase *)pvUser;
74 switch (enmState)
75 {
76 case VMSTATE_TERMINATED:
77 pThis->sigTerminated();
78 pThis->m_pVM = NULL;
79 break;
80
81 default:
82 break;
83 }
84}
85
86void VBoxDbgBase::sigTerminated()
87{
88}
89
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