VirtualBox

source: vbox/trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp@ 37989

Last change on this file since 37989 was 35629, checked in by vboxsync, 14 years ago

tstDBGCParse: more tests.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.9 KB
Line 
1/* $Id: tstDBGCStubs.cpp 35629 2011-01-19 15:15:21Z vboxsync $ */
2/** @file
3 * DBGC Testcase - Command Parser, VMM Stub Functions.
4 */
5
6/*
7 * Copyright (C) 2006-2011 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#include <VBox/err.h>
19#include <VBox/vmm/vm.h>
20#include <iprt/string.h>
21
22
23
24#include <VBox/vmm/dbgf.h>
25VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PVM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr)
26{
27 return NULL;
28}
29
30VMMR3DECL(int) DBGFR3AddrFromSelOff(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off)
31{
32 return VERR_INTERNAL_ERROR;
33}
34
35VMMR3DECL(int) DBGFR3AddrToPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys)
36{
37 return VERR_INTERNAL_ERROR;
38}
39
40VMMR3DECL(int) DBGFR3AddrToHostPhys(PVMCPU pVCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
41{
42 return VERR_INTERNAL_ERROR;
43}
44
45VMMR3DECL(int) DBGFR3AddrToVolatileR3Ptr(PVMCPU pVCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
46{
47 return VERR_INTERNAL_ERROR;
48}
49
50VMMR3DECL(int) DBGFR3Attach(PVM pVM)
51{
52 return VERR_INTERNAL_ERROR;
53}
54
55VMMR3DECL(int) DBGFR3BpClear(PVM pVM, RTUINT iBp)
56{
57 return VERR_INTERNAL_ERROR;
58}
59VMMR3DECL(int) DBGFR3BpDisable(PVM pVM, RTUINT iBp)
60{
61 return VERR_INTERNAL_ERROR;
62}
63VMMR3DECL(int) DBGFR3BpEnable(PVM pVM, RTUINT iBp)
64{
65 return VERR_INTERNAL_ERROR;
66}
67VMMR3DECL(int) DBGFR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
68{
69 return VERR_INTERNAL_ERROR;
70}
71VMMR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)
72{
73 return VERR_INTERNAL_ERROR;
74}
75VMMR3DECL(int) DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
76 uint8_t fType, uint8_t cb, PRTUINT piBp)
77{
78 return VERR_INTERNAL_ERROR;
79}
80VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)
81{
82 return VERR_INTERNAL_ERROR;
83}
84VMMR3DECL(bool) DBGFR3CanWait(PVM pVM)
85{
86 return true;
87}
88VMMR3DECL(int) DBGFR3Detach(PVM pVM)
89{
90 return VERR_INTERNAL_ERROR;
91}
92VMMR3DECL(int) DBGFR3DisasInstrEx(PVM pVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
93 char *pszOutput, uint32_t cchOutput, uint32_t *pcbInstr)
94{
95 return VERR_INTERNAL_ERROR;
96}
97VMMR3DECL(int) DBGFR3EventWait(PVM pVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent)
98{
99 return VERR_INTERNAL_ERROR;
100}
101VMMR3DECL(int) DBGFR3Halt(PVM pVM)
102{
103 return VERR_INTERNAL_ERROR;
104}
105VMMR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
106{
107 return VERR_INTERNAL_ERROR;
108}
109VMMR3DECL(bool) DBGFR3IsHalted(PVM pVM)
110{
111 return true;
112}
113VMMR3DECL(int) DBGFR3LineByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine)
114{
115 return VERR_INTERNAL_ERROR;
116}
117VMMR3DECL(int) DBGFR3LogModifyDestinations(PVM pVM, const char *pszDestSettings)
118{
119 return VERR_INTERNAL_ERROR;
120}
121VMMR3DECL(int) DBGFR3LogModifyFlags(PVM pVM, const char *pszFlagSettings)
122{
123 return VERR_INTERNAL_ERROR;
124}
125VMMR3DECL(int) DBGFR3LogModifyGroups(PVM pVM, const char *pszGroupSettings)
126{
127 return VERR_INTERNAL_ERROR;
128}
129VMMR3DECL(int) DBGFR3ModuleLoad(PVM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage)
130{
131 return VERR_INTERNAL_ERROR;
132}
133VMMR3DECL(int) DBGFR3AsLoadImage(PVM pVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
134{
135 return VERR_INTERNAL_ERROR;
136}
137VMMR3DECL(int) DBGFR3AsLoadMap(PVM pVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags)
138{
139 return VERR_INTERNAL_ERROR;
140}
141VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PVM pVM, RTDBGAS hAlias)
142{
143 return NIL_RTDBGAS;
144}
145VMMR3DECL(int) DBGFR3Resume(PVM pVM)
146{
147 return VERR_INTERNAL_ERROR;
148}
149VMMR3DECL(int) DBGFR3StackWalkBegin(PVM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame)
150{
151 return VERR_INTERNAL_ERROR;
152}
153VMMR3DECL(PCDBGFSTACKFRAME) DBGFR3StackWalkNext(PCDBGFSTACKFRAME pCurrent)
154{
155 return NULL;
156}
157VMMR3DECL(void) DBGFR3StackWalkEnd(PCDBGFSTACKFRAME pFirstFrame)
158{
159}
160VMMR3DECL(int) DBGFR3Step(PVM pVM, VMCPUID idCpu)
161{
162 return VERR_INTERNAL_ERROR;
163}
164VMMR3DECL(int) DBGFR3AsSymbolByAddr(PVM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisplacement, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
165{
166 return VERR_INTERNAL_ERROR;
167}
168VMMR3DECL(int) DBGFR3AsSymbolByName(PVM pVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
169{
170 return VERR_INTERNAL_ERROR;
171}
172VMMR3DECL(int) DBGFR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign, const void *pabNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
173{
174 return VERR_INTERNAL_ERROR;
175}
176VMMR3DECL(int) DBGFR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
177{
178 return VERR_INTERNAL_ERROR;
179}
180VMMR3DECL(int) DBGFR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
181{
182 return VERR_INTERNAL_ERROR;
183}
184VMMR3DECL(int) DBGFR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, const void *pvBuf, size_t cbRead)
185{
186 return VERR_INTERNAL_ERROR;
187}
188VMMDECL(int) DBGFR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
189 uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp)
190{
191 return VERR_INTERNAL_ERROR;
192}
193VMMR3DECL(int) DBGFR3RegCpuQueryU8( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8)
194{
195 return VERR_INTERNAL_ERROR;
196}
197VMMR3DECL(int) DBGFR3RegCpuQueryU16( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16)
198{
199 return VERR_INTERNAL_ERROR;
200}
201VMMR3DECL(int) DBGFR3RegCpuQueryU32( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32)
202{
203 return VERR_INTERNAL_ERROR;
204}
205VMMR3DECL(int) DBGFR3RegCpuQueryU64( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64)
206{
207 return VERR_INTERNAL_ERROR;
208}
209VMMR3DECL(int) DBGFR3RegNmQuery(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
210{
211 if (idDefCpu == 0 || idDefCpu == DBGFREG_HYPER_VMCPUID)
212 {
213 if (!strcmp(pszReg, "ah"))
214 {
215 pValue->u16 = 0xf0;
216 *penmType = DBGFREGVALTYPE_U8;
217 return VINF_SUCCESS;
218 }
219 if (!strcmp(pszReg, "ax"))
220 {
221 pValue->u16 = 0xbabe;
222 *penmType = DBGFREGVALTYPE_U16;
223 return VINF_SUCCESS;
224 }
225 if (!strcmp(pszReg, "eax"))
226 {
227 pValue->u32 = 0xcafebabe;
228 *penmType = DBGFREGVALTYPE_U32;
229 return VINF_SUCCESS;
230 }
231 if (!strcmp(pszReg, "rax"))
232 {
233 pValue->u64 = UINT64_C(0x00beef00feedface);
234 *penmType = DBGFREGVALTYPE_U32;
235 return VINF_SUCCESS;
236 }
237 }
238 return VERR_INTERNAL_ERROR;
239}
240VMMR3DECL(int) DBGFR3RegPrintf(PVM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)
241{
242 return VERR_INTERNAL_ERROR;
243}
244VMMDECL(ssize_t) DBGFR3RegFormatValue(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType, bool fSpecial)
245{
246 return VERR_INTERNAL_ERROR;
247}
248VMMR3DECL(int) DBGFR3RegNmSet(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)
249{
250 return VERR_INTERNAL_ERROR;
251}
252
253VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PVM pVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr)
254{
255 return NULL;
256}
257VMMR3DECL(int) DBGFR3AddrToHostPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
258{
259 return VERR_INTERNAL_ERROR;
260}
261VMMR3DECL(int) DBGFR3AddrToVolatileR3Ptr(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
262{
263 return VERR_INTERNAL_ERROR;
264}
265
266VMMR3DECL(int) DBGFR3OSRegister(PVM pVM, PCDBGFOSREG pReg)
267{
268 return VERR_INTERNAL_ERROR;
269}
270VMMR3DECL(int) DBGFR3OSDetect(PVM pVM, char *pszName, size_t cchName)
271{
272 return VERR_INTERNAL_ERROR;
273}
274VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PVM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
275{
276 return VERR_INTERNAL_ERROR;
277}
278
279VMMR3DECL(int) DBGFR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
280{
281 return VERR_INTERNAL_ERROR;
282}
283
284VMMR3DECL(int) DBGFR3CoreWrite(PVM pVM, const char *pszFilename, bool fReplaceFile)
285{
286 return VERR_INTERNAL_ERROR;
287}
288
289
290//////////////////////////////////////////////////////////////////////////
291// The rest should eventually be replaced by DBGF calls and eliminated. //
292/////////////////////////////////////////////////////////////////////////
293
294#include <VBox/vmm/cpum.h>
295
296VMMDECL(uint64_t) CPUMGetGuestCR3(PVMCPU pVCpu)
297{
298 return 0;
299}
300
301VMMDECL(uint64_t) CPUMGetGuestCR4(PVMCPU pVCpu)
302{
303 return 0;
304}
305
306VMMDECL(RTSEL) CPUMGetGuestCS(PVMCPU pVCpu)
307{
308 return 0;
309}
310
311VMMDECL(PCCPUMCTXCORE) CPUMGetGuestCtxCore(PVMCPU pVCpu)
312{
313 return NULL;
314}
315
316VMMDECL(uint32_t) CPUMGetGuestEIP(PVMCPU pVCpu)
317{
318 return 0;
319}
320
321VMMDECL(uint64_t) CPUMGetGuestRIP(PVMCPU pVCpu)
322{
323 return 0;
324}
325
326VMMDECL(RTGCPTR) CPUMGetGuestIDTR(PVMCPU pVCpu, uint16_t *pcbLimit)
327{
328 return 0;
329}
330
331VMMDECL(CPUMMODE) CPUMGetGuestMode(PVMCPU pVCpu)
332{
333 return CPUMMODE_INVALID;
334}
335
336VMMDECL(RTSEL) CPUMGetHyperCS(PVMCPU pVCpu)
337{
338 return 0xfff8;
339}
340
341VMMDECL(PCCPUMCTXCORE) CPUMGetHyperCtxCore(PVMCPU pVCpu)
342{
343 return NULL;
344}
345
346VMMDECL(uint32_t) CPUMGetHyperEIP(PVMCPU pVCpu)
347{
348 return 0;
349}
350
351VMMDECL(PCPUMCTX) CPUMQueryGuestCtxPtr(PVMCPU pVCpu)
352{
353 return NULL;
354}
355
356VMMDECL(int) CPUMQueryHyperCtxPtr(PVMCPU pVCpu, PCPUMCTX *ppCtx)
357{
358 return VERR_INTERNAL_ERROR;
359}
360
361
362
363#include <VBox/vmm/mm.h>
364
365VMMR3DECL(int) MMR3HCPhys2HCVirt(PVM pVM, RTHCPHYS HCPhys, void **ppv)
366{
367 return VERR_INTERNAL_ERROR;
368}
369
370
371
372
373#include <VBox/vmm/pgm.h>
374
375VMMDECL(RTHCPHYS) PGMGetHyperCR3(PVMCPU pVCpu)
376{
377 return 0;
378}
379
380VMMDECL(PGMMODE) PGMGetShadowMode(PVMCPU pVCpu)
381{
382 return PGMMODE_INVALID;
383}
384
385VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PVM pVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)
386{
387 return VERR_INTERNAL_ERROR;
388}
389
390VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PVM pVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)
391{
392 return VERR_INTERNAL_ERROR;
393}
394VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PVM pVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys)
395{
396 return VERR_INTERNAL_ERROR;
397}
398
399
400#include <VBox/vmm/vmm.h>
401
402VMMDECL(PVMCPU) VMMGetCpuById(PVM pVM, RTCPUID idCpu)
403{
404 return NULL;
405}
406
407VMMR3DECL(int) VMR3ReqCallWait(PVM pVm, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...)
408{
409 return VERR_INTERNAL_ERROR;
410}
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