VirtualBox

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

Last change on this file since 41549 was 41546, checked in by vboxsync, 13 years ago

Debugger hacking.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 11.0 KB
Line 
1/* $Id: tstDBGCStubs.cpp 41546 2012-06-01 14:34:33Z 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.215389.xyz. 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(int) DBGFR3InfoEx(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
110{
111 return VERR_INTERNAL_ERROR;
112}
113VMMR3DECL(bool) DBGFR3IsHalted(PVM pVM)
114{
115 return true;
116}
117VMMR3DECL(int) DBGFR3LineByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine)
118{
119 return VERR_INTERNAL_ERROR;
120}
121VMMR3DECL(int) DBGFR3LogModifyDestinations(PVM pVM, const char *pszDestSettings)
122{
123 return VERR_INTERNAL_ERROR;
124}
125VMMR3DECL(int) DBGFR3LogModifyFlags(PVM pVM, const char *pszFlagSettings)
126{
127 return VERR_INTERNAL_ERROR;
128}
129VMMR3DECL(int) DBGFR3LogModifyGroups(PVM pVM, const char *pszGroupSettings)
130{
131 return VERR_INTERNAL_ERROR;
132}
133VMMR3DECL(int) DBGFR3ModuleLoad(PVM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage)
134{
135 return VERR_INTERNAL_ERROR;
136}
137VMMR3DECL(int) DBGFR3AsLoadImage(PVM pVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
138{
139 return VERR_INTERNAL_ERROR;
140}
141VMMR3DECL(int) DBGFR3AsLoadMap(PVM pVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags)
142{
143 return VERR_INTERNAL_ERROR;
144}
145VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PVM pVM, RTDBGAS hAlias)
146{
147 return NIL_RTDBGAS;
148}
149VMMR3DECL(int) DBGFR3Resume(PVM pVM)
150{
151 return VERR_INTERNAL_ERROR;
152}
153VMMR3DECL(int) DBGFR3StackWalkBegin(PVM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame)
154{
155 return VERR_INTERNAL_ERROR;
156}
157VMMR3DECL(PCDBGFSTACKFRAME) DBGFR3StackWalkNext(PCDBGFSTACKFRAME pCurrent)
158{
159 return NULL;
160}
161VMMR3DECL(void) DBGFR3StackWalkEnd(PCDBGFSTACKFRAME pFirstFrame)
162{
163}
164VMMR3DECL(int) DBGFR3Step(PVM pVM, VMCPUID idCpu)
165{
166 return VERR_INTERNAL_ERROR;
167}
168VMMR3DECL(int) DBGFR3AsSymbolByAddr(PVM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisplacement, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
169{
170 return VERR_INTERNAL_ERROR;
171}
172VMMR3DECL(int) DBGFR3AsSymbolByName(PVM pVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
173{
174 return VERR_INTERNAL_ERROR;
175}
176VMMR3DECL(int) DBGFR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign, const void *pabNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
177{
178 return VERR_INTERNAL_ERROR;
179}
180VMMR3DECL(int) DBGFR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
181{
182 return VERR_INTERNAL_ERROR;
183}
184VMMR3DECL(int) DBGFR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
185{
186 return VERR_INTERNAL_ERROR;
187}
188VMMR3DECL(int) DBGFR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, const void *pvBuf, size_t cbRead)
189{
190 return VERR_INTERNAL_ERROR;
191}
192VMMDECL(int) DBGFR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
193 uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp)
194{
195 return VERR_INTERNAL_ERROR;
196}
197VMMR3DECL(int) DBGFR3RegNmValidate(PVM pVM, VMCPUID idDefCpu, const char *pszReg)
198{
199 return VINF_SUCCESS;
200}
201VMMR3DECL(int) DBGFR3RegCpuQueryU8( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8)
202{
203 return VERR_INTERNAL_ERROR;
204}
205VMMR3DECL(int) DBGFR3RegCpuQueryU16( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16)
206{
207 return VERR_INTERNAL_ERROR;
208}
209VMMR3DECL(int) DBGFR3RegCpuQueryU32( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32)
210{
211 return VERR_INTERNAL_ERROR;
212}
213VMMR3DECL(int) DBGFR3RegCpuQueryU64( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64)
214{
215 return VERR_INTERNAL_ERROR;
216}
217VMMR3DECL(int) DBGFR3RegNmQuery(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
218{
219 if (idDefCpu == 0 || idDefCpu == DBGFREG_HYPER_VMCPUID)
220 {
221 if (!strcmp(pszReg, "ah"))
222 {
223 pValue->u16 = 0xf0;
224 *penmType = DBGFREGVALTYPE_U8;
225 return VINF_SUCCESS;
226 }
227 if (!strcmp(pszReg, "ax"))
228 {
229 pValue->u16 = 0xbabe;
230 *penmType = DBGFREGVALTYPE_U16;
231 return VINF_SUCCESS;
232 }
233 if (!strcmp(pszReg, "eax"))
234 {
235 pValue->u32 = 0xcafebabe;
236 *penmType = DBGFREGVALTYPE_U32;
237 return VINF_SUCCESS;
238 }
239 if (!strcmp(pszReg, "rax"))
240 {
241 pValue->u64 = UINT64_C(0x00beef00feedface);
242 *penmType = DBGFREGVALTYPE_U32;
243 return VINF_SUCCESS;
244 }
245 }
246 return VERR_INTERNAL_ERROR;
247}
248VMMR3DECL(int) DBGFR3RegPrintf(PVM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)
249{
250 return VERR_INTERNAL_ERROR;
251}
252VMMDECL(ssize_t) DBGFR3RegFormatValue(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType, bool fSpecial)
253{
254 return VERR_INTERNAL_ERROR;
255}
256VMMR3DECL(int) DBGFR3RegNmSet(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)
257{
258 return VERR_INTERNAL_ERROR;
259}
260
261VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PVM pVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr)
262{
263 return NULL;
264}
265VMMR3DECL(int) DBGFR3AddrToHostPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
266{
267 return VERR_INTERNAL_ERROR;
268}
269VMMR3DECL(int) DBGFR3AddrToVolatileR3Ptr(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
270{
271 return VERR_INTERNAL_ERROR;
272}
273
274VMMR3DECL(int) DBGFR3OSRegister(PVM pVM, PCDBGFOSREG pReg)
275{
276 return VERR_INTERNAL_ERROR;
277}
278VMMR3DECL(int) DBGFR3OSDetect(PVM pVM, char *pszName, size_t cchName)
279{
280 return VERR_INTERNAL_ERROR;
281}
282VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PVM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
283{
284 return VERR_INTERNAL_ERROR;
285}
286
287VMMR3DECL(int) DBGFR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
288{
289 return VERR_INTERNAL_ERROR;
290}
291
292VMMR3DECL(int) DBGFR3CoreWrite(PVM pVM, const char *pszFilename, bool fReplaceFile)
293{
294 return VERR_INTERNAL_ERROR;
295}
296
297
298//////////////////////////////////////////////////////////////////////////
299// The rest should eventually be replaced by DBGF calls and eliminated. //
300/////////////////////////////////////////////////////////////////////////
301
302#include <VBox/vmm/cpum.h>
303
304VMMDECL(uint64_t) CPUMGetGuestCR3(PVMCPU pVCpu)
305{
306 return 0;
307}
308
309VMMDECL(uint64_t) CPUMGetGuestCR4(PVMCPU pVCpu)
310{
311 return 0;
312}
313
314VMMDECL(RTSEL) CPUMGetGuestCS(PVMCPU pVCpu)
315{
316 return 0;
317}
318
319VMMDECL(PCCPUMCTXCORE) CPUMGetGuestCtxCore(PVMCPU pVCpu)
320{
321 return NULL;
322}
323
324VMMDECL(uint32_t) CPUMGetGuestEIP(PVMCPU pVCpu)
325{
326 return 0;
327}
328
329VMMDECL(uint64_t) CPUMGetGuestRIP(PVMCPU pVCpu)
330{
331 return 0;
332}
333
334VMMDECL(RTGCPTR) CPUMGetGuestIDTR(PVMCPU pVCpu, uint16_t *pcbLimit)
335{
336 return 0;
337}
338
339VMMDECL(CPUMMODE) CPUMGetGuestMode(PVMCPU pVCpu)
340{
341 return CPUMMODE_INVALID;
342}
343
344VMMDECL(RTSEL) CPUMGetHyperCS(PVMCPU pVCpu)
345{
346 return 0xfff8;
347}
348
349VMMDECL(PCCPUMCTXCORE) CPUMGetHyperCtxCore(PVMCPU pVCpu)
350{
351 return NULL;
352}
353
354VMMDECL(uint32_t) CPUMGetHyperEIP(PVMCPU pVCpu)
355{
356 return 0;
357}
358
359VMMDECL(PCPUMCTX) CPUMQueryGuestCtxPtr(PVMCPU pVCpu)
360{
361 return NULL;
362}
363
364VMMDECL(int) CPUMQueryHyperCtxPtr(PVMCPU pVCpu, PCPUMCTX *ppCtx)
365{
366 return VERR_INTERNAL_ERROR;
367}
368
369
370
371#include <VBox/vmm/mm.h>
372
373VMMR3DECL(int) MMR3HCPhys2HCVirt(PVM pVM, RTHCPHYS HCPhys, void **ppv)
374{
375 return VERR_INTERNAL_ERROR;
376}
377
378
379
380
381#include <VBox/vmm/pgm.h>
382
383VMMDECL(RTHCPHYS) PGMGetHyperCR3(PVMCPU pVCpu)
384{
385 return 0;
386}
387
388VMMDECL(PGMMODE) PGMGetShadowMode(PVMCPU pVCpu)
389{
390 return PGMMODE_INVALID;
391}
392
393VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PVM pVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)
394{
395 return VERR_INTERNAL_ERROR;
396}
397
398VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PVM pVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)
399{
400 return VERR_INTERNAL_ERROR;
401}
402VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PVM pVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys)
403{
404 return VERR_INTERNAL_ERROR;
405}
406
407
408#include <VBox/vmm/vmm.h>
409
410VMMDECL(PVMCPU) VMMGetCpuById(PVM pVM, RTCPUID idCpu)
411{
412 return NULL;
413}
414
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette