1 | /* $Id: DBGPlugInDiggers.cpp 31530 2010-08-10 12:24:45Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * DBGPlugInDiggers - Debugger and Guest OS Digger Plug-in.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2010 Oracle Corporation
|
---|
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 |
|
---|
18 |
|
---|
19 | /*******************************************************************************
|
---|
20 | * Header Files *
|
---|
21 | *******************************************************************************/
|
---|
22 | #define LOG_GROUP LOG_GROUP_DBGC
|
---|
23 | #include <VBox/dbg.h>
|
---|
24 | #include <VBox/dbgf.h>
|
---|
25 | #include "DBGPlugIns.h"
|
---|
26 | #include <VBox/version.h>
|
---|
27 | #include <VBox/err.h>
|
---|
28 |
|
---|
29 |
|
---|
30 | DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, PVM pVM, uintptr_t uArg)
|
---|
31 | {
|
---|
32 | static PCDBGFOSREG s_aPlugIns[] =
|
---|
33 | {
|
---|
34 | //&g_DBGDiggerFreeBSD,
|
---|
35 | &g_DBGDiggerLinux,
|
---|
36 | //&g_DBGDiggerOS2,
|
---|
37 | &g_DBGDiggerSolaris,
|
---|
38 | &g_DBGDiggerWinNt
|
---|
39 | };
|
---|
40 |
|
---|
41 | switch (enmOperation)
|
---|
42 | {
|
---|
43 | case DBGCPLUGINOP_INIT:
|
---|
44 | {
|
---|
45 | if (uArg != VBOX_VERSION)
|
---|
46 | return VERR_VERSION_MISMATCH;
|
---|
47 |
|
---|
48 | for (unsigned i = 0; i < RT_ELEMENTS(s_aPlugIns); i++)
|
---|
49 | {
|
---|
50 | int rc = DBGFR3OSRegister(pVM, s_aPlugIns[i]);
|
---|
51 | if (RT_FAILURE(rc))
|
---|
52 | {
|
---|
53 | AssertRC(rc);
|
---|
54 | while (i-- > 0)
|
---|
55 | DBGFR3OSDeregister(pVM, s_aPlugIns[i]);
|
---|
56 | return rc;
|
---|
57 | }
|
---|
58 | }
|
---|
59 | return VINF_SUCCESS;
|
---|
60 | }
|
---|
61 |
|
---|
62 | case DBGCPLUGINOP_TERM:
|
---|
63 | {
|
---|
64 | for (unsigned i = 0; i < RT_ELEMENTS(s_aPlugIns); i++)
|
---|
65 | {
|
---|
66 | int rc = DBGFR3OSDeregister(pVM, s_aPlugIns[i]);
|
---|
67 | AssertRC(rc);
|
---|
68 | }
|
---|
69 | return VINF_SUCCESS;
|
---|
70 | }
|
---|
71 |
|
---|
72 | default:
|
---|
73 | return VERR_NOT_SUPPORTED;
|
---|
74 | }
|
---|
75 | }
|
---|
76 |
|
---|