VirtualBox

source: vbox/trunk/src/VBox/VMM/DBGFLog.cpp@ 7122

Last change on this file since 7122 was 5999, checked in by vboxsync, 17 years ago

The Giant CDDL Dual-License Header Change.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
1/* $Id: DBGFLog.cpp 5999 2007-12-07 15:05:06Z vboxsync $ */
2/** @file
3 * VMM DBGF - Debugger Facility, Log Manager.
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 (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/*******************************************************************************
21* Header Files *
22*******************************************************************************/
23#include <VBox/vmapi.h>
24#include <VBox/vmm.h>
25#include <VBox/dbgf.h>
26#include <VBox/log.h>
27#include <VBox/err.h>
28#include <iprt/assert.h>
29
30
31/*******************************************************************************
32* Internal Functions *
33*******************************************************************************/
34static DECLCALLBACK(int) dbgfR3LogModifyGroups(PVM pVM, const char *pszGroupSettings);
35static DECLCALLBACK(int) dbgfR3LogModifyFlags(PVM pVM, const char *pszFlagSettings);
36static DECLCALLBACK(int) dbgfR3LogModifyDestinations(PVM pVM, const char *pszDestSettings);
37
38
39/**
40 * Changes the logger group settings.
41 *
42 * @returns VBox status code.
43 * @param pVM The VM handle.
44 * @param pszGroupSettings The group settings string. (VBOX_LOG)
45 */
46DBGFR3DECL(int) DBGFR3LogModifyGroups(PVM pVM, const char *pszGroupSettings)
47{
48 AssertReturn(VALID_PTR(pVM), VERR_INVALID_POINTER);
49 AssertReturn(VALID_PTR(pszGroupSettings), VERR_INVALID_POINTER);
50
51 PVMREQ pReq;
52 int rc = VMR3ReqCall(pVM, &pReq, RT_INDEFINITE_WAIT, (PFNRT)dbgfR3LogModifyGroups, 2, pVM, pszGroupSettings);
53 if (VBOX_SUCCESS(rc))
54 rc = pReq->iStatus;
55 VMR3ReqFree(pReq);
56 return rc;
57}
58
59
60/**
61 * EMT worker for DBGFR3LogModifyGroups.
62 *
63 * @returns VBox status code.
64 * @param pVM The VM handle.
65 * @param pszGroupSettings The group settings string. (VBOX_LOG)
66 */
67static DECLCALLBACK(int) dbgfR3LogModifyGroups(PVM pVM, const char *pszGroupSettings)
68{
69 int rc = RTLogGroupSettings(NULL, pszGroupSettings);
70 if (VBOX_SUCCESS(rc))
71 rc = VMMR3UpdateLoggers(pVM);
72 return rc;
73}
74
75
76/**
77 * Changes the logger flag settings.
78 *
79 * @returns VBox status code.
80 * @param pVM The VM handle.
81 * @param pszFlagSettings The group settings string. (VBOX_LOG_FLAGS)
82 */
83DBGFR3DECL(int) DBGFR3LogModifyFlags(PVM pVM, const char *pszFlagSettings)
84{
85 AssertReturn(VALID_PTR(pVM), VERR_INVALID_POINTER);
86 AssertReturn(VALID_PTR(pszFlagSettings), VERR_INVALID_POINTER);
87
88 PVMREQ pReq;
89 int rc = VMR3ReqCall(pVM, &pReq, RT_INDEFINITE_WAIT, (PFNRT)dbgfR3LogModifyFlags, 2, pVM, pszFlagSettings);
90 if (VBOX_SUCCESS(rc))
91 rc = pReq->iStatus;
92 VMR3ReqFree(pReq);
93 return rc;
94}
95
96
97/**
98 * EMT worker for DBGFR3LogModifyFlags.
99 *
100 * @returns VBox status code.
101 * @param pVM The VM handle.
102 * @param pszFlagSettings The group settings string. (VBOX_LOG_FLAGS)
103 */
104static DECLCALLBACK(int) dbgfR3LogModifyFlags(PVM pVM, const char *pszFlagSettings)
105{
106 int rc = RTLogFlags(NULL, pszFlagSettings);
107 if (VBOX_SUCCESS(rc))
108 rc = VMMR3UpdateLoggers(pVM);
109 return rc;
110}
111
112
113/**
114 * Changes the logger destination settings.
115 *
116 * @returns VBox status code.
117 * @param pVM The VM handle.
118 * @param pszDestSettings The destination settings string. (VBOX_LOG_DEST)
119 */
120DBGFR3DECL(int) DBGFR3LogModifyDestinations(PVM pVM, const char *pszDestSettings)
121{
122 AssertReturn(VALID_PTR(pVM), VERR_INVALID_POINTER);
123 AssertReturn(VALID_PTR(pszDestSettings), VERR_INVALID_POINTER);
124
125 PVMREQ pReq;
126 int rc = VMR3ReqCall(pVM, &pReq, RT_INDEFINITE_WAIT, (PFNRT)dbgfR3LogModifyDestinations, 2, pVM, pszDestSettings);
127 if (VBOX_SUCCESS(rc))
128 rc = pReq->iStatus;
129 VMR3ReqFree(pReq);
130 return rc;
131}
132
133
134/**
135 * EMT worker for DBGFR3LogModifyFlags.
136 *
137 * @returns VBox status code.
138 * @param pVM The VM handle.
139 * @param pszDestSettings The destination settings string. (VBOX_LOG_DEST)
140 */
141static DECLCALLBACK(int) dbgfR3LogModifyDestinations(PVM pVM, const char *pszDestSettings)
142{
143 int rc = VERR_NOT_IMPLEMENTED; //RTLogDestination(NULL, pszDestSettings);
144 if (VBOX_SUCCESS(rc))
145 rc = VMMR3UpdateLoggers(pVM);
146 return rc;
147}
148
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