Changeset 35629 in vbox for trunk/src/VBox/Debugger
- Timestamp:
- Jan 19, 2011 3:15:21 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 69534
- Location:
- trunk/src/VBox/Debugger
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGCInternal.h
r35628 r35629 152 152 /** Pointer to the current VM. */ 153 153 PVM pVM; 154 /** The current virtual CPU id. */154 /** The ID of current virtual CPU. */ 155 155 VMCPUID idCpu; 156 156 /** The current address space handle. */ -
trunk/src/VBox/Debugger/DBGConsole.cpp
r35628 r35629 861 861 pDbgc->pBack = pBack; 862 862 pDbgc->pVM = NULL; 863 pDbgc->idCpu = NIL_VMCPUID;863 pDbgc->idCpu = 0; 864 864 pDbgc->hDbgAs = DBGF_AS_GLOBAL; 865 865 pDbgc->pszEmulation = "CodeView/WinDbg"; … … 975 975 if (RT_SUCCESS(rc)) 976 976 { 977 pDbgc->pVM = pVM;977 pDbgc->pVM = pVM; 978 978 pDbgc->idCpu = 0; 979 979 rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, -
trunk/src/VBox/Debugger/testcase/tstDBGCParser.cpp
r31932 r35629 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 30 30 *******************************************************************************/ 31 31 static DECLCALLBACK(bool) tstDBGCBackInput(PDBGCBACK pBack, uint32_t cMillies); 32 static DECLCALLBACK(int) tstDBGCBackRead(PDBGCBACK pBack, void *pvBuf, size_t cbBuf, size_t *pcbRead);33 static DECLCALLBACK(int) tstDBGCBackWrite(PDBGCBACK pBack, const void *pvBuf, size_t cbBuf, size_t *pcbWritten);32 static DECLCALLBACK(int) tstDBGCBackRead(PDBGCBACK pBack, void *pvBuf, size_t cbBuf, size_t *pcbRead); 33 static DECLCALLBACK(int) tstDBGCBackWrite(PDBGCBACK pBack, const void *pvBuf, size_t cbBuf, size_t *pcbWritten); 34 34 static DECLCALLBACK(void) tstDBGCBackSetReady(PDBGCBACK pBack, bool fReady); 35 35 … … 269 269 * Create a DBGC instance. 270 270 */ 271 RTTestSub(g_hTest, "dbgcCreate"); 271 272 PDBGC pDbgc; 272 273 rc = dbgcCreate(&pDbgc, &g_tstBack, 0); … … 277 278 if (RT_SUCCESS(rc)) 278 279 { 280 RTTestSub(g_hTest, "basic parsing"); 279 281 tstTry(pDbgc, "stop\n", VINF_SUCCESS); 280 282 tstTry(pDbgc, "format 1\n", VINF_SUCCESS); … … 283 285 tstTry(pDbgc, "sa 3 23 4 'q' \"21123123\" 'b' \n", VINF_SUCCESS); 284 286 285 tstNumOp(pDbgc, "1", 1); 286 tstNumOp(pDbgc, "1", 1); 287 tstNumOp(pDbgc, "1", 1); 288 289 tstNumOp(pDbgc, "+1", 1); 290 tstNumOp(pDbgc, "++++++1", 1); 291 292 tstNumOp(pDbgc, "-1", UINT64_MAX); 293 tstNumOp(pDbgc, "--1", 1); 294 tstNumOp(pDbgc, "---1", UINT64_MAX); 295 tstNumOp(pDbgc, "----1", 1); 296 297 tstNumOp(pDbgc, "~0", UINT64_MAX); 298 tstNumOp(pDbgc, "~1", UINT64_MAX-1); 299 tstNumOp(pDbgc, "~~0", 0); 300 tstNumOp(pDbgc, "~~1", 1); 301 302 tstNumOp(pDbgc, "!1", 0); 303 tstNumOp(pDbgc, "!0", 1); 304 tstNumOp(pDbgc, "!42", 0); 305 tstNumOp(pDbgc, "!!42", 1); 306 tstNumOp(pDbgc, "!!!42", 0); 307 tstNumOp(pDbgc, "!!!!42", 1); 308 309 tstNumOp(pDbgc, "1 +1", 2); 310 tstNumOp(pDbgc, "1 + 1", 2); 311 tstNumOp(pDbgc, "1+1", 2); 312 tstNumOp(pDbgc, "1+ 1", 2); 313 314 tstNumOp(pDbgc, "1 - 1", 0); 315 tstNumOp(pDbgc, "99 - 90", 9); 316 317 tstNumOp(pDbgc, "2 * 2", 4); 318 319 tstNumOp(pDbgc, "2 / 2", 1); 320 tstNumOp(pDbgc, "2 / 0", UINT64_MAX); 321 tstNumOp(pDbgc, "0i1024 / 0i4", 256); 322 323 tstNumOp(pDbgc, "1<<1", 2); 324 tstNumOp(pDbgc, "1<<0i32", UINT64_C(0x0000000100000000)); 325 tstNumOp(pDbgc, "1<<0i48", UINT64_C(0x0001000000000000)); 326 tstNumOp(pDbgc, "1<<0i63", UINT64_C(0x8000000000000000)); 327 328 tstNumOp(pDbgc, "fedcba0987654321>>0i04", UINT64_C(0x0fedcba098765432)); 329 tstNumOp(pDbgc, "fedcba0987654321>>0i32", UINT64_C(0xfedcba09)); 330 tstNumOp(pDbgc, "fedcba0987654321>>0i48", UINT64_C(0x0000fedc)); 331 332 tstNumOp(pDbgc, "0ef & 4", 4); 333 tstNumOp(pDbgc, "01234567891 & fff", UINT64_C(0x00000000891)); 334 tstNumOp(pDbgc, "01234567891 & ~fff", UINT64_C(0x01234567000)); 335 336 tstNumOp(pDbgc, "1 | 1", 1); 337 tstNumOp(pDbgc, "0 | 4", 4); 338 tstNumOp(pDbgc, "4 | 0", 4); 339 tstNumOp(pDbgc, "4 | 4", 4); 340 tstNumOp(pDbgc, "1 | 4 | 2", 7); 341 342 tstNumOp(pDbgc, "1 ^ 1", 0); 343 tstNumOp(pDbgc, "1 ^ 0", 1); 344 tstNumOp(pDbgc, "0 ^ 1", 1); 345 tstNumOp(pDbgc, "3 ^ 1", 2); 346 tstNumOp(pDbgc, "7 ^ 3", 4); 347 348 tstNumOp(pDbgc, "7 || 3", 1); 349 tstNumOp(pDbgc, "1 || 0", 1); 350 tstNumOp(pDbgc, "0 || 1", 1); 351 tstNumOp(pDbgc, "0 || 0", 0); 352 353 tstNumOp(pDbgc, "0 && 0", 0); 354 tstNumOp(pDbgc, "1 && 0", 0); 355 tstNumOp(pDbgc, "0 && 1", 0); 356 tstNumOp(pDbgc, "1 && 1", 1); 357 tstNumOp(pDbgc, "4 && 1", 1); 358 287 if (RTTestErrorCount(g_hTest) == 0) 288 { 289 RTTestSub(g_hTest, "Operators"); 290 tstNumOp(pDbgc, "1", 1); 291 tstNumOp(pDbgc, "1", 1); 292 tstNumOp(pDbgc, "1", 1); 293 294 tstNumOp(pDbgc, "+1", 1); 295 tstNumOp(pDbgc, "++++++1", 1); 296 297 tstNumOp(pDbgc, "-1", UINT64_MAX); 298 tstNumOp(pDbgc, "--1", 1); 299 tstNumOp(pDbgc, "---1", UINT64_MAX); 300 tstNumOp(pDbgc, "----1", 1); 301 302 tstNumOp(pDbgc, "~0", UINT64_MAX); 303 tstNumOp(pDbgc, "~1", UINT64_MAX-1); 304 tstNumOp(pDbgc, "~~0", 0); 305 tstNumOp(pDbgc, "~~1", 1); 306 307 tstNumOp(pDbgc, "!1", 0); 308 tstNumOp(pDbgc, "!0", 1); 309 tstNumOp(pDbgc, "!42", 0); 310 tstNumOp(pDbgc, "!!42", 1); 311 tstNumOp(pDbgc, "!!!42", 0); 312 tstNumOp(pDbgc, "!!!!42", 1); 313 314 tstNumOp(pDbgc, "1 +1", 2); 315 tstNumOp(pDbgc, "1 + 1", 2); 316 tstNumOp(pDbgc, "1+1", 2); 317 tstNumOp(pDbgc, "1+ 1", 2); 318 319 tstNumOp(pDbgc, "1 - 1", 0); 320 tstNumOp(pDbgc, "99 - 90", 9); 321 322 tstNumOp(pDbgc, "2 * 2", 4); 323 324 tstNumOp(pDbgc, "2 / 2", 1); 325 tstNumOp(pDbgc, "2 / 0", UINT64_MAX); 326 tstNumOp(pDbgc, "0i1024 / 0i4", 256); 327 328 tstNumOp(pDbgc, "1<<1", 2); 329 tstNumOp(pDbgc, "1<<0i32", UINT64_C(0x0000000100000000)); 330 tstNumOp(pDbgc, "1<<0i48", UINT64_C(0x0001000000000000)); 331 tstNumOp(pDbgc, "1<<0i63", UINT64_C(0x8000000000000000)); 332 333 tstNumOp(pDbgc, "fedcba0987654321>>0i04", UINT64_C(0x0fedcba098765432)); 334 tstNumOp(pDbgc, "fedcba0987654321>>0i32", UINT64_C(0xfedcba09)); 335 tstNumOp(pDbgc, "fedcba0987654321>>0i48", UINT64_C(0x0000fedc)); 336 337 tstNumOp(pDbgc, "0ef & 4", 4); 338 tstNumOp(pDbgc, "01234567891 & fff", UINT64_C(0x00000000891)); 339 tstNumOp(pDbgc, "01234567891 & ~fff", UINT64_C(0x01234567000)); 340 341 tstNumOp(pDbgc, "1 | 1", 1); 342 tstNumOp(pDbgc, "0 | 4", 4); 343 tstNumOp(pDbgc, "4 | 0", 4); 344 tstNumOp(pDbgc, "4 | 4", 4); 345 tstNumOp(pDbgc, "1 | 4 | 2", 7); 346 347 tstNumOp(pDbgc, "1 ^ 1", 0); 348 tstNumOp(pDbgc, "1 ^ 0", 1); 349 tstNumOp(pDbgc, "0 ^ 1", 1); 350 tstNumOp(pDbgc, "3 ^ 1", 2); 351 tstNumOp(pDbgc, "7 ^ 3", 4); 352 353 tstNumOp(pDbgc, "7 || 3", 1); 354 tstNumOp(pDbgc, "1 || 0", 1); 355 tstNumOp(pDbgc, "0 || 1", 1); 356 tstNumOp(pDbgc, "0 || 0", 0); 357 358 tstNumOp(pDbgc, "0 && 0", 0); 359 tstNumOp(pDbgc, "1 && 0", 0); 360 tstNumOp(pDbgc, "0 && 1", 0); 361 tstNumOp(pDbgc, "1 && 1", 1); 362 tstNumOp(pDbgc, "4 && 1", 1); 363 } 364 365 if (RTTestErrorCount(g_hTest) == 0) 366 { 367 RTTestSub(g_hTest, "Odd cases"); 368 tstTry(pDbgc, "r @rax\n", VINF_SUCCESS); 369 tstTry(pDbgc, "r @eax\n", VINF_SUCCESS); 370 tstTry(pDbgc, "r @ah\n", VINF_SUCCESS); 371 } 359 372 } 360 373 -
trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp
r35625 r35629 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 18 18 #include <VBox/err.h> 19 19 #include <VBox/vmm/vm.h> 20 #include <iprt/string.h> 20 21 21 22 … … 206 207 return VERR_INTERNAL_ERROR; 207 208 } 208 VMMR3DECL(int) DBGFR3RegNmQuery( PVM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType) 209 { 209 VMMR3DECL(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 } 210 238 return VERR_INTERNAL_ERROR; 211 239 }
Note:
See TracChangeset
for help on using the changeset viewer.