1 | /* $Id: DBGFCoreWrite.cpp 32006 2010-08-26 16:14:33Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * DBGF - Debugger Facility, Guest Core Dump.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.alldomusa.eu.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_DBGF
|
---|
23 | #include <iprt/param.h>
|
---|
24 | #include <VBox/dbgf.h>
|
---|
25 | #include "DBGFInternal.h"
|
---|
26 | #include <VBox/vm.h>
|
---|
27 | #include <VBox/err.h>
|
---|
28 | #include <VBox/log.h>
|
---|
29 |
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * EMT worker function for DBGFR3CoreWrite.
|
---|
33 | *
|
---|
34 | * @param pVM The VM handle.
|
---|
35 | * @param idCpu The target CPU ID.
|
---|
36 | * @param pszDumpPath The full path of the file to dump into.
|
---|
37 | *
|
---|
38 | * @return VBox status code.
|
---|
39 | */
|
---|
40 | static DECLCALLBACK(int) dbgfR3CoreWrite(PVM pVM, VMCPUID idCpu, const char *pszDumpPath)
|
---|
41 | {
|
---|
42 | /*
|
---|
43 | * Validate input.
|
---|
44 | */
|
---|
45 | Assert(idCpu == VMMGetCpuId(pVM));
|
---|
46 | AssertReturn(pszDumpPath, VERR_INVALID_POINTER);
|
---|
47 |
|
---|
48 | /* @todo */
|
---|
49 |
|
---|
50 | return VINF_SUCCESS;
|
---|
51 | }
|
---|
52 |
|
---|
53 |
|
---|
54 | /**
|
---|
55 | * Write core dump of the guest.
|
---|
56 | *
|
---|
57 | * @return VBox status code.
|
---|
58 | * @param pVM The VM handle.
|
---|
59 | * @param idCpu The target CPU ID.
|
---|
60 | * @param pszDumpPath The path of the file to dump into, cannot be
|
---|
61 | * NULL.
|
---|
62 | */
|
---|
63 | VMMR3DECL(int) DBGFR3CoreWrite(PVM pVM, VMCPUID idCpu, const char *pszDumpPath)
|
---|
64 | {
|
---|
65 | VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
|
---|
66 | AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
|
---|
67 | AssertReturn(pszDumpPath, VERR_INVALID_HANDLE);
|
---|
68 |
|
---|
69 | /*
|
---|
70 | * Pass the core write request down to EMT.
|
---|
71 | */
|
---|
72 | return VMR3ReqCallWaitU(pVM->pUVM, idCpu, (PFNRT)dbgfR3CoreWrite, 3, pVM, idCpu, pszDumpPath);
|
---|
73 | }
|
---|
74 |
|
---|