Changeset 35694 in vbox
- Timestamp:
- Jan 24, 2011 5:35:59 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
include/VBox/dbg.h (modified) (5 diffs)
-
include/VBox/vmm/dbgf.h (modified) (1 diff)
-
src/VBox/Debugger/DBGCCmdHlp.cpp (modified) (18 diffs)
-
src/VBox/Debugger/DBGCEmulateCodeView.cpp (modified) (29 diffs)
-
src/VBox/Debugger/DBGCInternal.h (modified) (2 diffs)
-
src/VBox/VMM/VMMR3/CSAM.cpp (modified) (3 diffs)
-
src/VBox/VMM/VMMR3/DBGFBp.cpp (modified) (15 diffs)
-
src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp (modified) (5 diffs)
-
src/VBox/VMM/VMMR3/STAM.cpp (modified) (5 diffs)
-
src/VBox/VMM/include/DBGFInternal.h (modified) (1 diff)
-
src/recompiler/VBoxRecompiler.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/dbg.h
r35673 r35694 371 371 typedef struct DBGCCMDHLP *PDBGCCMDHLP; 372 372 373 /**374 * Command helper for writing text to the debug console.375 *376 * @returns VBox status.377 * @param pCmdHlp Pointer to the command callback structure.378 * @param pvBuf What to write.379 * @param cbBuf Number of bytes to write.380 * @param pcbWritten Where to store the number of bytes actually written.381 * If NULL the entire buffer must be successfully written.382 */383 typedef DECLCALLBACK(int) FNDBGCHLPWRITE(PDBGCCMDHLP pCmdHlp, const void *pvBuf, size_t cbBuf, size_t *pcbWritten);384 /** Pointer to a FNDBGCHLPWRITE() function. */385 typedef FNDBGCHLPWRITE *PFNDBGCHLPWRITE;386 387 /**388 * Command helper for writing formatted text to the debug console.389 *390 * @returns VBox status.391 * @param pCmdHlp Pointer to the command callback structure.392 * @param pcb Where to store the number of bytes written.393 * @param pszFormat The format string.394 * This is using the log formatter, so it's format extensions can be used.395 * @param ... Arguments specified in the format string.396 */397 typedef DECLCALLBACK(int) FNDBGCHLPPRINTF(PDBGCCMDHLP pCmdHlp, size_t *pcbWritten, const char *pszFormat, ...);398 /** Pointer to a FNDBGCHLPPRINTF() function. */399 typedef FNDBGCHLPPRINTF *PFNDBGCHLPPRINTF;400 401 /**402 * Command helper for writing formatted text to the debug console.403 *404 * @returns VBox status.405 * @param pCmdHlp Pointer to the command callback structure.406 * @param pcb Where to store the number of bytes written.407 * @param pszFormat The format string.408 * This is using the log formatter, so it's format extensions can be used.409 * @param args Arguments specified in the format string.410 */411 typedef DECLCALLBACK(int) FNDBGCHLPPRINTFV(PDBGCCMDHLP pCmdHlp, size_t *pcbWritten, const char *pszFormat, va_list args);412 /** Pointer to a FNDBGCHLPPRINTFV() function. */413 typedef FNDBGCHLPPRINTFV *PFNDBGCHLPPRINTFV;414 415 /**416 * Command helper for formatting and error message for a VBox status code.417 *418 * @returns VBox status code appropriate to return from a command.419 * @param pCmdHlp Pointer to the command callback structure.420 * @param rc The VBox status code.421 * @param pszFormat Format string for additional messages. Can be NULL.422 * @param ... Format arguments, optional.423 */424 typedef DECLCALLBACK(int) FNDBGCHLPVBOXERROR(PDBGCCMDHLP pCmdHlp, int rc, const char *pszFormat, ...);425 /** Pointer to a FNDBGCHLPVBOXERROR() function. */426 typedef FNDBGCHLPVBOXERROR *PFNDBGCHLPVBOXERROR;427 428 /**429 * Command helper for formatting and error message for a VBox status code.430 *431 * @returns VBox status code appropriate to return from a command.432 * @param pCmdHlp Pointer to the command callback structure.433 * @param rc The VBox status code.434 * @param pcb Where to store the number of bytes written.435 * @param pszFormat Format string for additional messages. Can be NULL.436 * @param args Format arguments, optional.437 */438 typedef DECLCALLBACK(int) FNDBGCHLPVBOXERRORV(PDBGCCMDHLP pCmdHlp, int rc, const char *pszFormat, va_list args);439 /** Pointer to a FNDBGCHLPVBOXERRORV() function. */440 typedef FNDBGCHLPVBOXERRORV *PFNDBGCHLPVBOXERRORV;441 442 /**443 * Command helper for reading memory specified by a DBGC variable.444 *445 * @returns VBox status code appropriate to return from a command.446 * @param pCmdHlp Pointer to the command callback structure.447 * @param pVM VM handle if GC or physical HC address.448 * @param pvBuffer Where to store the read data.449 * @param cbRead Number of bytes to read.450 * @param pVarPointer DBGC variable specifying where to start reading.451 * @param pcbRead Where to store the number of bytes actually read.452 * This optional, but it's useful when read GC virtual memory where a453 * page in the requested range might not be present.454 * If not specified not-present failure or end of a HC physical page455 * will cause failure.456 */457 typedef DECLCALLBACK(int) FNDBGCHLPMEMREAD(PDBGCCMDHLP pCmdHlp, PVM pVM, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead);458 /** Pointer to a FNDBGCHLPMEMREAD() function. */459 typedef FNDBGCHLPMEMREAD *PFNDBGCHLPMEMREAD;460 461 /**462 * Command helper for writing memory specified by a DBGC variable.463 *464 * @returns VBox status code appropriate to return from a command.465 * @param pCmdHlp Pointer to the command callback structure.466 * @param pVM VM handle if GC or physical HC address.467 * @param pvBuffer What to write.468 * @param cbWrite Number of bytes to write.469 * @param pVarPointer DBGC variable specifying where to start reading.470 * @param pcbWritten Where to store the number of bytes written.471 * This is optional. If NULL be aware that some of the buffer472 * might have been written to the specified address.473 */474 typedef DECLCALLBACK(int) FNDBGCHLPMEMWRITE(PDBGCCMDHLP pCmdHlp, PVM pVM, const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten);475 /** Pointer to a FNDBGCHLPMEMWRITE() function. */476 typedef FNDBGCHLPMEMWRITE *PFNDBGCHLPMEMWRITE;477 478 479 480 /**481 * Executes command an expression.482 * (Hopefully the parser and functions are fully reentrant.)483 *484 * @returns VBox status code appropriate to return from a command.485 * @param pCmdHlp Pointer to the command callback structure.486 * @param pszExpr The expression. Format string with the format DBGC extensions.487 * @param ... Format arguments.488 */489 typedef DECLCALLBACK(int) FNDBGCHLPEXEC(PDBGCCMDHLP pCmdHlp, const char *pszExpr, ...);490 /** Pointer to a FNDBGCHLPEVAL() function. */491 typedef FNDBGCHLPEXEC *PFNDBGCHLPEXEC;492 493 373 494 374 /** … … 497 377 typedef struct DBGCCMDHLP 498 378 { 499 /** Pointer to a FNDBCHLPWRITE() function. */ 500 PFNDBGCHLPWRITE pfnWrite; 501 /** Pointer to a FNDBGCHLPPRINTF() function. */ 502 PFNDBGCHLPPRINTF pfnPrintf; 503 /** Pointer to a FNDBGCHLPPRINTFV() function. */ 504 PFNDBGCHLPPRINTFV pfnPrintfV; 505 /** Pointer to a FNDBGCHLPVBOXERROR() function. */ 506 PFNDBGCHLPVBOXERROR pfnVBoxError; 507 /** Pointer to a FNDBGCHLPVBOXERRORV() function. */ 508 PFNDBGCHLPVBOXERRORV pfnVBoxErrorV; 509 /** Pointer to a FNDBGCHLPMEMREAD() function. */ 510 PFNDBGCHLPMEMREAD pfnMemRead; 511 /** Pointer to a FNDBGCHLPMEMWRITE() function. */ 512 PFNDBGCHLPMEMWRITE pfnMemWrite; 513 /** Pointer to a FNDBGCHLPEXEC() function. */ 514 PFNDBGCHLPEXEC pfnExec; 379 /** Magic value (DBGCCMDHLP_MAGIC). */ 380 uint32_t u32Magic; 381 382 /** 383 * Command helper for writing formatted text to the debug console. 384 * 385 * @returns VBox status. 386 * @param pCmdHlp Pointer to the command callback structure. 387 * @param pcb Where to store the number of bytes written. 388 * @param pszFormat The format string. 389 * This is using the log formatter, so it's format extensions can be used. 390 * @param ... Arguments specified in the format string. 391 */ 392 DECLCALLBACKMEMBER(int, pfnPrintf)(PDBGCCMDHLP pCmdHlp, size_t *pcbWritten, const char *pszFormat, ...); 393 394 /** 395 * Command helper for writing formatted text to the debug console. 396 * 397 * @returns VBox status. 398 * @param pCmdHlp Pointer to the command callback structure. 399 * @param pcb Where to store the number of bytes written. 400 * @param pszFormat The format string. 401 * This is using the log formatter, so it's format extensions can be used. 402 * @param args Arguments specified in the format string. 403 */ 404 DECLCALLBACKMEMBER(int, pfnPrintfV)(PDBGCCMDHLP pCmdHlp, size_t *pcbWritten, const char *pszFormat, va_list args); 405 406 /** 407 * Command helper for formatting and error message for a VBox status code. 408 * 409 * @returns VBox status code appropriate to return from a command. 410 * @param pCmdHlp Pointer to the command callback structure. 411 * @param rc The VBox status code. 412 * @param pszFormat Format string for additional messages. Can be NULL. 413 * @param ... Format arguments, optional. 414 */ 415 DECLCALLBACKMEMBER(int, pfnVBoxError)(PDBGCCMDHLP pCmdHlp, int rc, const char *pszFormat, ...); 416 417 /** 418 * Command helper for formatting and error message for a VBox status code. 419 * 420 * @returns VBox status code appropriate to return from a command. 421 * @param pCmdHlp Pointer to the command callback structure. 422 * @param rc The VBox status code. 423 * @param pcb Where to store the number of bytes written. 424 * @param pszFormat Format string for additional messages. Can be NULL. 425 * @param args Format arguments, optional. 426 */ 427 DECLCALLBACKMEMBER(int, pfnVBoxErrorV)(PDBGCCMDHLP pCmdHlp, int rc, const char *pszFormat, va_list args); 428 429 /** 430 * Command helper for reading memory specified by a DBGC variable. 431 * 432 * @returns VBox status code appropriate to return from a command. 433 * @param pCmdHlp Pointer to the command callback structure. 434 * @param pVM VM handle if GC or physical HC address. 435 * @param pvBuffer Where to store the read data. 436 * @param cbRead Number of bytes to read. 437 * @param pVarPointer DBGC variable specifying where to start reading. 438 * @param pcbRead Where to store the number of bytes actually read. 439 * This optional, but it's useful when read GC virtual memory where a 440 * page in the requested range might not be present. 441 * If not specified not-present failure or end of a HC physical page 442 * will cause failure. 443 */ 444 DECLCALLBACKMEMBER(int, pfnMemRead)(PDBGCCMDHLP pCmdHlp, PVM pVM, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead); 445 446 /** 447 * Command helper for writing memory specified by a DBGC variable. 448 * 449 * @returns VBox status code appropriate to return from a command. 450 * @param pCmdHlp Pointer to the command callback structure. 451 * @param pVM VM handle if GC or physical HC address. 452 * @param pvBuffer What to write. 453 * @param cbWrite Number of bytes to write. 454 * @param pVarPointer DBGC variable specifying where to start reading. 455 * @param pcbWritten Where to store the number of bytes written. 456 * This is optional. If NULL be aware that some of the buffer 457 * might have been written to the specified address. 458 */ 459 DECLCALLBACKMEMBER(int, pfnMemWrite)(PDBGCCMDHLP pCmdHlp, PVM pVM, const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten); 460 461 /** 462 * Executes command an expression. 463 * (Hopefully the parser and functions are fully reentrant.) 464 * 465 * @returns VBox status code appropriate to return from a command. 466 * @param pCmdHlp Pointer to the command callback structure. 467 * @param pszExpr The expression. Format string with the format DBGC extensions. 468 * @param ... Format arguments. 469 */ 470 DECLCALLBACKMEMBER(int, pfnExec)(PDBGCCMDHLP pCmdHlp, const char *pszExpr, ...); 515 471 516 472 /** … … 537 493 */ 538 494 DECLCALLBACKMEMBER(int, pfnFailV)(PDBGCCMDHLP pCmdHlp, PCDBGCCMD pCmd, const char *pszFormat, va_list va); 495 496 /** 497 * Print an error and fail the current command. 498 * 499 * @returns VBox status code to pass upwards. 500 * 501 * @param pCmdHlp Pointer to the command callback structure. 502 * @param pCmd The failing command. 503 * @param rc The status code indicating the failure. This will 504 * be appended to the message after a colon (': '). 505 * @param pszFormat The error message format string. 506 * @param va Format arguments. 507 * 508 * @see DBGCCmdHlpFailRc 509 */ 510 DECLCALLBACKMEMBER(int, pfnFailRcV)(PDBGCCMDHLP pCmdHlp, PCDBGCCMD pCmd, int rc, const char *pszFormat, va_list va); 511 512 /** 513 * Parser error. 514 * 515 * @returns VBox status code to pass upwards. 516 * 517 * @param pCmdHlp Pointer to the command callback structure. 518 * @param pCmd The failing command, can be NULL but shouldn't. 519 * @param iArg The offending argument, -1 when lazy. 520 * @param pszExpr The expression. 521 * @param iLine The line number. 522 */ 523 DECLCALLBACKMEMBER(int, pfnParserError)(PDBGCCMDHLP pCmdHlp, PCDBGCCMD pCmd, int iArg, const char *pszExpr, unsigned iLine); 539 524 540 525 /** … … 615 600 DECLCALLBACKMEMBER(PCDBGFINFOHLP, pfnGetDbgfOutputHlp)(PDBGCCMDHLP pCmdHlp); 616 601 602 /** End marker (DBGCCMDHLP_MAGIC). */ 603 uint32_t u32EndMarker; 617 604 } DBGCCMDHLP; 605 606 /** Magic value for DBGCCMDHLP::u32Magic. (Fyodor Mikhaylovich Dostoyevsky) */ 607 #define DBGCCMDHLP_MAGIC UINT32_C(18211111) 618 608 619 609 … … 706 696 return rc; 707 697 } 698 699 /** 700 * Print an error and fail the current command. 701 * 702 * Usage example: 703 * @code 704 int rc = VMMR3Something(pVM); 705 if (RT_FAILURE(rc)) 706 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "VMMR3Something"); 707 return VINF_SUCCESS; 708 * @endcode 709 * 710 * @returns VBox status code to pass upwards. 711 * 712 * @param pCmdHlp Pointer to the command callback structure. 713 * @param pCmd The failing command. 714 * @param rc The status code indicating the failure. 715 * @param pszFormat The error message format string. 716 * @param ... Format arguments. 717 */ 718 DECLINLINE(int) DBGCCmdHlpFailRc(PDBGCCMDHLP pCmdHlp, PCDBGCCMD pCmd, int rc, const char *pszFormat, ...) 719 { 720 va_list va; 721 722 va_start(va, pszFormat); 723 rc = pCmdHlp->pfnFailRcV(pCmdHlp, pCmd, rc, pszFormat, va); 724 va_end(va); 725 726 return rc; 727 } 728 729 /** 730 * @copydoc DBGCCMDHLP::pfnParserError 731 */ 732 DECLINLINE(int) DBGCCmdHlpParserError(PDBGCCMDHLP pCmdHlp, PCDBGCCMD pCmd, int iArg, const char *pszExpr, unsigned iLine) 733 { 734 return pCmdHlp->pfnParserError(pCmdHlp, pCmd, iArg, pszExpr, iLine); 735 } 736 737 /** Assert+return like macro for checking parser sanity. 738 * Returns with failure if the precodition is not met. */ 739 #define DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, iArg, expr) \ 740 do { \ 741 if (!(expr)) \ 742 return DBGCCmdHlpParserError(pCmdHlp, pCmd, iArg, #expr, __LINE__); \ 743 } while (0) 744 745 /** Assert+return like macro that the VM handle is present. 746 * Returns with failure if the VM handle is NIL. */ 747 #define DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM) \ 748 do { \ 749 if (!(pVM)) \ 750 return DBGCCmdHlpFail(pCmdHlp, pCmd, "No VM selected"); \ 751 } while (0) 708 752 709 753 /** -
trunk/include/VBox/vmm/dbgf.h
r35625 r35694 378 378 379 379 380 VMMR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINTpiBp);380 VMMR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp); 381 381 VMMR3DECL(int) DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, 382 uint8_t fType, uint8_t cb, PRTUINTpiBp);383 VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINTpiBp);384 VMMR3DECL(int) DBGFR3BpClear(PVM pVM, RTUINTiBp);385 VMMR3DECL(int) DBGFR3BpEnable(PVM pVM, RTUINTiBp);386 VMMR3DECL(int) DBGFR3BpDisable(PVM pVM, RTUINTiBp);382 uint8_t fType, uint8_t cb, uint32_t *piBp); 383 VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp); 384 VMMR3DECL(int) DBGFR3BpClear(PVM pVM, uint32_t iBp); 385 VMMR3DECL(int) DBGFR3BpEnable(PVM pVM, uint32_t iBp); 386 VMMR3DECL(int) DBGFR3BpDisable(PVM pVM, uint32_t iBp); 387 387 388 388 /** -
trunk/src/VBox/Debugger/DBGCCmdHlp.cpp
r35673 r35694 37 37 38 38 /** 39 * Command helper for writing text to the debug console. 40 * 41 * @returns VBox status. 42 * @param pCmdHlp Pointer to the command callback structure. 43 * @param pvBuf What to write. 44 * @param cbBuf Number of bytes to write. 45 * @param pcbWritten Where to store the number of bytes actually written. 46 * If NULL the entire buffer must be successfully written. 47 */ 48 static DECLCALLBACK(int) dbgcHlpWrite(PDBGCCMDHLP pCmdHlp, const void *pvBuf, size_t cbBuf, size_t *pcbWritten) 49 { 50 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 51 return pDbgc->pBack->pfnWrite(pDbgc->pBack, pvBuf, cbBuf, pcbWritten); 52 } 53 54 55 /** 56 * Command helper for writing formatted text to the debug console. 57 * 58 * @returns VBox status. 59 * @param pCmdHlp Pointer to the command callback structure. 60 * @param pcb Where to store the number of bytes written. 61 * @param pszFormat The format string. 62 * This is using the log formatter, so it's format extensions can be used. 63 * @param ... Arguments specified in the format string. 39 * @interface_method_impl{DBGCCMDHLP,pfnPrintf} 64 40 */ 65 41 static DECLCALLBACK(int) dbgcHlpPrintf(PDBGCCMDHLP pCmdHlp, size_t *pcbWritten, const char *pszFormat, ...) … … 77 53 78 54 /** 79 * Callback to format non-standard format specifiers. 55 * Callback to format non-standard format specifiers, employed by dbgcPrintfV 56 * and others. 80 57 * 81 58 * @returns The number of bytes formatted. … … 190 167 191 168 /** 192 * Output callback .169 * Output callback employed by dbgcHlpPrintfV. 193 170 * 194 171 * @returns number of bytes written. … … 199 176 static DECLCALLBACK(size_t) dbgcFormatOutput(void *pvArg, const char *pachChars, size_t cbChars) 200 177 { 201 PDBGC pDbgc = (PDBGC)pvArg;178 PDBGC pDbgc = (PDBGC)pvArg; 202 179 if (cbChars) 203 180 { 204 181 int rc = pDbgc->pBack->pfnWrite(pDbgc->pBack, pachChars, cbChars, NULL); 205 if (RT_FAILURE(rc)) 182 if (RT_SUCCESS(rc)) 183 pDbgc->chLastOutput = pachChars[cbChars - 1]; 184 else 206 185 { 207 186 pDbgc->rcOutput = rc; … … 216 195 217 196 /** 218 * Command helper for writing formatted text to the debug console. 219 * 220 * @returns VBox status. 221 * @param pCmdHlp Pointer to the command callback structure. 222 * @param pcbWritten Where to store the number of bytes written. 223 * @param pszFormat The format string. 224 * This is using the log formatter, so it's format extensions can be used. 225 * @param args Arguments specified in the format string. 197 * @interface_method_impl{DBGCCMDHLP,pfnPrintfV} 226 198 */ 227 199 static DECLCALLBACK(int) dbgcHlpPrintfV(PDBGCCMDHLP pCmdHlp, size_t *pcbWritten, const char *pszFormat, va_list args) … … 243 215 244 216 /** 245 * Reports an error from a DBGF call. 246 * 247 * @returns VBox status code appropriate to return from a command. 248 * @param pCmdHlp Pointer to command helpers. 249 * @param rc The VBox status code returned by a DBGF call. 250 * @param pszFormat Format string for additional messages. Can be NULL. 251 * @param ... Format arguments, optional. 217 * @interface_method_impl{DBGCCMDHLP,pfnVBoxErrorV} 252 218 */ 253 219 static DECLCALLBACK(int) dbgcHlpVBoxErrorV(PDBGCCMDHLP pCmdHlp, int rc, const char *pszFormat, va_list args) … … 271 237 272 238 /** 273 * Reports an error from a DBGF call. 274 * 275 * @returns VBox status code appropriate to return from a command. 276 * @param pCmdHlp Pointer to command helpers. 277 * @param rc The VBox status code returned by a DBGF call. 278 * @param pszFormat Format string for additional messages. Can be NULL. 279 * @param ... Format arguments, optional. 239 * @interface_method_impl{DBGCCMDHLP,pfnVBoxError} 280 240 */ 281 241 static DECLCALLBACK(int) dbgcHlpVBoxError(PDBGCCMDHLP pCmdHlp, int rc, const char *pszFormat, ...) … … 290 250 291 251 /** 292 * Command helper for reading memory specified by a DBGC variable. 293 * 294 * @returns VBox status code appropriate to return from a command. 295 * @param pCmdHlp Pointer to the command callback structure. 296 * @param pVM VM handle if GC or physical HC address. 297 * @param pvBuffer Where to store the read data. 298 * @param cbRead Number of bytes to read. 299 * @param pVarPointer DBGC variable specifying where to start reading. 300 * @param pcbRead Where to store the number of bytes actually read. 301 * This optional, but it's useful when read GC virtual memory where a 302 * page in the requested range might not be present. 303 * If not specified not-present failure or end of a HC physical page 304 * will cause failure. 252 * @interface_method_impl{DBGCCMDHLP,pfnMemRead} 305 253 */ 306 254 static DECLCALLBACK(int) dbgcHlpMemRead(PDBGCCMDHLP pCmdHlp, PVM pVM, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead) … … 472 420 } 473 421 474 /** 475 * Command helper for writing memory specified by a DBGC variable. 476 * 477 * @returns VBox status code appropriate to return from a command. 478 * @param pCmdHlp Pointer to the command callback structure. 479 * @param pVM VM handle if GC or physical HC address. 480 * @param pvBuffer What to write. 481 * @param cbWrite Number of bytes to write. 482 * @param pVarPointer DBGC variable specifying where to start reading. 483 * @param pcbWritten Where to store the number of bytes written. 484 * This is optional. If NULL be aware that some of the buffer 485 * might have been written to the specified address. 422 423 /** 424 * @interface_method_impl{DBGCCMDHLP,pfnMemWrite} 486 425 */ 487 426 static DECLCALLBACK(int) dbgcHlpMemWrite(PDBGCCMDHLP pCmdHlp, PVM pVM, const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten) … … 618 557 619 558 /** 620 * Executes one command expression. 621 * (Hopefully the parser and functions are fully reentrant.) 622 * 623 * @returns VBox status code appropriate to return from a command. 624 * @param pCmdHlp Pointer to the command callback structure. 625 * @param pszExpr The expression. Format string with the format DBGC extensions. 626 * @param ... Format arguments. 559 * @interface_method_impl{DBGCCMDHLP,pfnHlpExec} 627 560 */ 628 561 static DECLCALLBACK(int) dbgcHlpExec(PDBGCCMDHLP pCmdHlp, const char *pszExpr, ...) … … 694 627 if (RT_FAILURE(pDbgc->rcOutput)) 695 628 return pDbgc->rcOutput; 629 if (pDbgc->chLastOutput != '\n') 630 dbgcFormatOutput(pDbgc, "\n", 1); 631 return VERR_DBGC_COMMAND_FAILED; 632 } 633 634 635 /** 636 * @copydoc DBGCCMDHLP::pfnFailV 637 */ 638 static DECLCALLBACK(int) dbgcHlpFailRcV(PDBGCCMDHLP pCmdHlp, PCDBGCCMD pCmd, int rc, const char *pszFormat, va_list va) 639 { 640 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 641 642 /* 643 * Do the formatting and output. 644 */ 645 pDbgc->rcOutput = VINF_SUCCESS; 646 RTStrFormat(dbgcFormatOutput, pDbgc, dbgcStringFormatter, pDbgc, "%s: error: ", pCmd->pszCmd); 647 if (RT_FAILURE(pDbgc->rcOutput)) 648 return pDbgc->rcOutput; 649 RTStrFormatV(dbgcFormatOutput, pDbgc, dbgcStringFormatter, pDbgc, pszFormat, va); 650 if (RT_FAILURE(pDbgc->rcOutput)) 651 return pDbgc->rcOutput; 652 RTStrFormat(dbgcFormatOutput, pDbgc, dbgcStringFormatter, pDbgc, ": %Rrc\n", rc); 653 if (RT_FAILURE(pDbgc->rcOutput)) 654 return pDbgc->rcOutput; 655 696 656 return VERR_DBGC_COMMAND_FAILED; 697 657 } … … 778 738 779 739 /** 780 * Converts a DBGC variable to a number. 781 * 782 * @returns VBox status code. 783 * @param pCmdHlp Pointer to the command callback structure. 784 * @param pVar The variable to convert. 785 * @param pu64Number Where to store the number value. 740 * @interface_method_impl{DBGCCMDHLP,pfnVarToNumber} 786 741 */ 787 742 static DECLCALLBACK(int) dbgcHlpVarToNumber(PDBGCCMDHLP pCmdHlp, PCDBGCVAR pVar, uint64_t *pu64Number) … … 823 778 824 779 /** 825 * Converts a DBGC variable to a boolean. 826 * 827 * @returns VBox status code. 828 * @param pCmdHlp Pointer to the command callback structure. 829 * @param pVar The variable to convert. 830 * @param pf Where to store the boolean. 780 * @interface_method_impl{DBGCCMDHLP,pfnVarToBool} 831 781 */ 832 782 static DECLCALLBACK(int) dbgcHlpVarToBool(PDBGCCMDHLP pCmdHlp, PCDBGCVAR pVar, bool *pf) … … 1255 1205 1256 1206 /** 1257 * Info helper callback wrapper - print formatted string. 1258 * 1259 * @param pHlp Pointer to this structure. 1260 * @param pszFormat The format string. 1261 * @param ... Arguments. 1207 * @interface_method_impl{DBGFINFOHLP,pfnPrintf} 1262 1208 */ 1263 1209 static DECLCALLBACK(void) dbgcHlpGetDbgfOutputHlp_Printf(PCDBGFINFOHLP pHlp, const char *pszFormat, ...) … … 1272 1218 1273 1219 /** 1274 * Info helper callback wrapper - print formatted string. 1275 * 1276 * @param pHlp Pointer to this structure. 1277 * @param pszFormat The format string. 1278 * @param args Argument list. 1220 * @interface_method_impl{DBGFINFOHLP,pfnPrintfV} 1279 1221 */ 1280 1222 static DECLCALLBACK(void) dbgcHlpGetDbgfOutputHlp_PrintfV(PCDBGFINFOHLP pHlp, const char *pszFormat, va_list args) … … 1310 1252 void dbgcInitCmdHlp(PDBGC pDbgc) 1311 1253 { 1312 pDbgc->CmdHlp. pfnWrite = dbgcHlpWrite;1254 pDbgc->CmdHlp.u32Magic = DBGCCMDHLP_MAGIC; 1313 1255 pDbgc->CmdHlp.pfnPrintfV = dbgcHlpPrintfV; 1314 1256 pDbgc->CmdHlp.pfnPrintf = dbgcHlpPrintf; … … 1320 1262 pDbgc->CmdHlp.pfnExec = dbgcHlpExec; 1321 1263 pDbgc->CmdHlp.pfnFailV = dbgcHlpFailV; 1264 pDbgc->CmdHlp.pfnFailRcV = dbgcHlpFailRcV; 1322 1265 pDbgc->CmdHlp.pfnVarToDbgfAddr = dbgcHlpVarToDbgfAddr; 1323 1266 pDbgc->CmdHlp.pfnVarFromDbgfAddr = dbgcHlpVarFromDbgfAddr; … … 1327 1270 pDbgc->CmdHlp.pfnVarConvert = dbgcHlpVarConvert; 1328 1271 pDbgc->CmdHlp.pfnGetDbgfOutputHlp = dbgcHlpGetDbgfOutputHlp; 1329 } 1330 1272 pDbgc->CmdHlp.u32EndMarker = DBGCCMDHLP_MAGIC; 1273 } 1274 -
trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp
r35673 r35694 390 390 static DECLCALLBACK(int) dbgcCmdGo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult) 391 391 { 392 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 393 392 394 /* 393 395 * Check if the VM is halted or not before trying to resume it. 394 396 */ 395 397 if (!DBGFR3IsHalted(pVM)) 396 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "warning: The VM is already running...\n"); 397 else 398 { 399 int rc = DBGFR3Resume(pVM); 400 if (RT_FAILURE(rc)) 401 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Executing DBGFR3Resume()."); 402 } 403 404 NOREF(pCmd); 405 NOREF(paArgs); 406 NOREF(cArgs); 407 NOREF(pResult); 408 return 0; 398 return DBGCCmdHlpFail(pCmdHlp, pCmd, "The VM is already running"); 399 400 int rc = DBGFR3Resume(pVM); 401 if (RT_FAILURE(rc)) 402 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3Resume"); 403 404 NOREF(paArgs); NOREF(cArgs); NOREF(pResult); 405 return VINF_SUCCESS; 409 406 } 410 407 … … 422 419 static DECLCALLBACK(int) dbgcCmdBrkAccess(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR /*pResult*/) 423 420 { 421 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 422 424 423 /* 425 424 * Interpret access type. … … 427 426 if ( !strchr("xrwi", paArgs[0].u.pszString[0]) 428 427 || paArgs[0].u.pszString[1]) 429 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid access type '%s' for '%s'. Valid types are 'e', 'r', 'w' and 'i'.\n",430 paArgs[0].u.pszString, pCmd->pszCmd);428 return DBGCCmdHlpFail(pCmdHlp, pCmd, "Invalid access type '%s' for '%s'. Valid types are 'e', 'r', 'w' and 'i'", 429 paArgs[0].u.pszString, pCmd->pszCmd); 431 430 uint8_t fType = 0; 432 431 switch (paArgs[0].u.pszString[0]) … … 442 441 */ 443 442 if (fType == X86_DR7_RW_EO && paArgs[1].u.u64Number != 1) 444 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid access size %RX64 for '%s'. 'x' access type requires size 1!\n",445 paArgs[1].u.u64Number, pCmd->pszCmd);443 return DBGCCmdHlpFail(pCmdHlp, pCmd, "Invalid access size %RX64 for '%s'. 'x' access type requires size 1!", 444 paArgs[1].u.u64Number, pCmd->pszCmd); 446 445 switch (paArgs[1].u.u64Number) 447 446 { … … 452 451 /*case 8: - later*/ 453 452 default: 454 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid access size %RX64 for '%s'. 1, 2 or 4!\n",455 paArgs[1].u.u64Number, pCmd->pszCmd);453 return DBGCCmdHlpFail(pCmdHlp, pCmd, "Invalid access size %RX64 for '%s'. 1, 2 or 4!", 454 paArgs[1].u.u64Number, pCmd->pszCmd); 456 455 } 457 456 uint8_t cb = (uint8_t)paArgs[1].u.u64Number; … … 461 460 */ 462 461 DBGFADDRESS Address; 463 int rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[2], &Address);462 int rc = DBGCCmdHlpVarToDbgfAddr(pCmdHlp, &paArgs[2], &Address); 464 463 if (RT_FAILURE(rc)) 465 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Couldn't convert '%DV' to a DBGF address, rc=%Rrc.\n", &paArgs[2], rc);464 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGCCmdHlpVarToDbgfAddr(,%DV,)", &paArgs[2]); 466 465 467 466 /* … … 491 490 * Try set the breakpoint. 492 491 */ 493 RTUINTiBp;492 uint32_t iBp; 494 493 rc = DBGFR3BpSetReg(pVM, &Address, iHitTrigger, iHitDisable, fType, cb, &iBp); 495 494 if (RT_SUCCESS(rc)) … … 498 497 rc = dbgcBpAdd(pDbgc, iBp, pszCmds); 499 498 if (RT_SUCCESS(rc)) 500 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Set access breakpoint %u at %RGv\n", iBp, Address.FlatPtr);499 return DBGCCmdHlpPrintf(pCmdHlp, "Set access breakpoint %u at %RGv\n", iBp, Address.FlatPtr); 501 500 if (rc == VERR_DBGC_BP_EXISTS) 502 501 { 503 502 rc = dbgcBpUpdate(pDbgc, iBp, pszCmds); 504 503 if (RT_SUCCESS(rc)) 505 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Updated access breakpoint %u at %RGv\n", iBp, Address.FlatPtr);504 return DBGCCmdHlpPrintf(pCmdHlp, "Updated access breakpoint %u at %RGv\n", iBp, Address.FlatPtr); 506 505 } 507 506 int rc2 = DBGFR3BpClear(pDbgc->pVM, iBp); 508 507 AssertRC(rc2); 509 508 } 510 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Failed to set access breakpoint at %RGv, rc=%Rrc.\n", Address.FlatPtr, rc);509 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "Failed to set access breakpoint at %RGv", Address.FlatPtr); 511 510 } 512 511 … … 524 523 static DECLCALLBACK(int) dbgcCmdBrkClear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR /*pResult*/) 525 524 { 525 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 526 526 527 /* 527 528 * Enumerate the arguments. 528 529 */ 529 530 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 530 int rc = VINF_SUCCESS;531 int rc = VINF_SUCCESS; 531 532 for (unsigned iArg = 0; iArg < cArgs && RT_SUCCESS(rc); iArg++) 532 533 { … … 534 535 { 535 536 /* one */ 536 RTUINT iBp = (RTUINT)paArgs[iArg].u.u64Number;537 if (iBp != paArgs[iArg].u.u64Number)537 uint32_t iBp = (uint32_t)paArgs[iArg].u.u64Number; 538 if (iBp == paArgs[iArg].u.u64Number) 538 539 { 539 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Breakpoint id %RX64 is too large!\n", paArgs[iArg].u.u64Number); 540 break; 540 int rc2 = DBGFR3BpClear(pVM, iBp); 541 if (RT_FAILURE(rc2)) 542 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpClear(,%#x)", iBp); 543 if (RT_SUCCESS(rc2) || rc2 == VERR_DBGF_BP_NOT_FOUND) 544 dbgcBpDelete(pDbgc, iBp); 541 545 } 542 int rc2 = DBGFR3BpClear(pVM, iBp); 543 if (RT_FAILURE(rc2)) 544 rc = pCmdHlp->pfnVBoxError(pCmdHlp, rc2, "DBGFR3BpClear failed for breakpoint %u!\n", iBp); 545 if (RT_SUCCESS(rc2) || rc2 == VERR_DBGF_BP_NOT_FOUND) 546 dbgcBpDelete(pDbgc, iBp); 546 else 547 rc = DBGCCmdHlpFail(pCmdHlp, pCmd, "Breakpoint id %RX64 is too large", paArgs[iArg].u.u64Number); 547 548 } 548 549 else if (!strcmp(paArgs[iArg].u.pszString, "all")) … … 552 553 while (pBp) 553 554 { 554 RTUINTiBp = pBp->iBp;555 uint32_t iBp = pBp->iBp; 555 556 pBp = pBp->pNext; 556 557 557 558 int rc2 = DBGFR3BpClear(pVM, iBp); 558 559 if (RT_FAILURE(rc2)) 559 rc = pCmdHlp->pfnVBoxError(pCmdHlp, rc2, "DBGFR3BpClear failed for breakpoint %u!\n", iBp);560 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpClear(,%#x)", iBp); 560 561 if (RT_SUCCESS(rc2) || rc2 == VERR_DBGF_BP_NOT_FOUND) 561 562 dbgcBpDelete(pDbgc, iBp); … … 563 564 } 564 565 else 565 { 566 /* invalid parameter */ 567 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid argument '%s' to '%s'!\n", paArgs[iArg].u.pszString, pCmd->pszCmd); 568 break; 569 } 566 rc = DBGCCmdHlpFail(pCmdHlp, pCmd, "Invalid argument '%s'", paArgs[iArg].u.pszString); 570 567 } 571 568 return rc; … … 594 591 { 595 592 /* one */ 596 RTUINT iBp = (RTUINT)paArgs[iArg].u.u64Number;597 if (iBp != paArgs[iArg].u.u64Number)593 uint32_t iBp = (uint32_t)paArgs[iArg].u.u64Number; 594 if (iBp == paArgs[iArg].u.u64Number) 598 595 { 599 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Breakpoint id %RX64 is too large!\n", paArgs[iArg].u.u64Number); 600 break; 596 rc = DBGFR3BpDisable(pVM, iBp); 597 if (RT_FAILURE(rc)) 598 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3BpDisable failed for breakpoint %#x", iBp); 601 599 } 602 rc = DBGFR3BpDisable(pVM, iBp); 603 if (RT_FAILURE(rc)) 604 rc = pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3BpDisable failed for breakpoint %u!\n", iBp); 600 else 601 rc = DBGCCmdHlpFail(pCmdHlp, pCmd, "Breakpoint id %RX64 is too large", paArgs[iArg].u.u64Number); 605 602 } 606 603 else if (!strcmp(paArgs[iArg].u.pszString, "all")) … … 610 607 for (PDBGCBP pBp = pDbgc->pFirstBp; pBp; pBp = pBp->pNext) 611 608 { 612 rc= DBGFR3BpDisable(pVM, pBp->iBp);613 if (RT_FAILURE(rc ))614 rc = pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3BpDisable failed for breakpoint %u!\n", pBp->iBp);609 int rc2 = DBGFR3BpDisable(pVM, pBp->iBp); 610 if (RT_FAILURE(rc2)) 611 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpDisable failed for breakpoint %#x", pBp->iBp); 615 612 } 616 613 } 617 614 else 618 { 619 /* invalid parameter */ 620 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid argument '%s' to '%s'!\n", paArgs[iArg].u.pszString, pCmd->pszCmd); 621 break; 622 } 615 rc = DBGCCmdHlpFail(pCmdHlp, pCmd, "Invalid argument '%s'", paArgs[iArg].u.pszString); 623 616 } 624 617 return rc; … … 638 631 static DECLCALLBACK(int) dbgcCmdBrkEnable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR /*pResult*/) 639 632 { 633 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 634 640 635 /* 641 636 * Enumerate the arguments. … … 647 642 { 648 643 /* one */ 649 RTUINT iBp = (RTUINT)paArgs[iArg].u.u64Number;650 if (iBp != paArgs[iArg].u.u64Number)644 uint32_t iBp = (uint32_t)paArgs[iArg].u.u64Number; 645 if (iBp == paArgs[iArg].u.u64Number) 651 646 { 652 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Breakpoint id %RX64 is too large!\n", paArgs[iArg].u.u64Number); 653 break; 647 rc = DBGFR3BpEnable(pVM, iBp); 648 if (RT_FAILURE(rc)) 649 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3BpEnable failed for breakpoint %#x", iBp); 654 650 } 655 rc = DBGFR3BpEnable(pVM, iBp); 656 if (RT_FAILURE(rc)) 657 rc = pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3BpEnable failed for breakpoint %u!\n", iBp); 651 else 652 rc = DBGCCmdHlpFail(pCmdHlp, pCmd, "Breakpoint id %RX64 is too large", paArgs[iArg].u.u64Number); 658 653 } 659 654 else if (!strcmp(paArgs[iArg].u.pszString, "all")) … … 663 658 for (PDBGCBP pBp = pDbgc->pFirstBp; pBp; pBp = pBp->pNext) 664 659 { 665 rc= DBGFR3BpEnable(pVM, pBp->iBp);666 if (RT_FAILURE(rc ))667 rc = pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3BpEnable failed for breakpoint %u!\n", pBp->iBp);660 int rc2 = DBGFR3BpEnable(pVM, pBp->iBp); 661 if (RT_FAILURE(rc2)) 662 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpEnable failed for breakpoint %#x", pBp->iBp); 668 663 } 669 664 } 670 665 else 671 { 672 /* invalid parameter */ 673 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid argument '%s' to '%s'!\n", paArgs[iArg].u.pszString, pCmd->pszCmd); 674 break; 675 } 666 rc = DBGCCmdHlpFail(pCmdHlp, pCmd, "Invalid argument '%s'", paArgs[iArg].u.pszString); 676 667 } 677 668 return rc; … … 689 680 static DECLCALLBACK(int) dbgcEnumBreakpointsCallback(PVM pVM, void *pvUser, PCDBGFBP pBp) 690 681 { 691 PDBGC pDbgc= (PDBGC)pvUser;682 PDBGC pDbgc = (PDBGC)pvUser; 692 683 PDBGCBP pDbgcBp = dbgcBpGet(pDbgc, pBp->iBp); 693 684 … … 722 713 } 723 714 724 pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "%2u%c %d %c %RGv %04RX64 (%04RX64 to ",725 pBp->iBp, pBp->fEnabled ? 'e' : 'd', cb, chType,726 pBp->GCPtr, pBp->cHits, pBp->iHitTrigger);715 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "%4#x %c %d %c %RGv %04RX64 (%04RX64 to ", 716 pBp->iBp, pBp->fEnabled ? 'e' : 'd', cb, chType, 717 pBp->GCPtr, pBp->cHits, pBp->iHitTrigger); 727 718 if (pBp->iHitDisable == ~(uint64_t)0) 728 pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "~0) ");719 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "~0) "); 729 720 else 730 pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "%04RX64)");721 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "%04RX64)"); 731 722 732 723 /* … … 740 731 { 741 732 if (!off) 742 pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "%s", Sym.szName);733 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "%s", Sym.szName); 743 734 else if (off > 0) 744 pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "%s+%RGv", Sym.szName, off);735 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "%s+%RGv", Sym.szName, off); 745 736 else 746 pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "%s+%RGv", Sym.szName, -off);737 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "%s+%RGv", Sym.szName, -off); 747 738 } 748 739 … … 753 744 { 754 745 if (pDbgcBp->cchCmd) 755 pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\n cmds: '%s'\n", 756 pDbgcBp->szCmd); 746 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "\n cmds: '%s'\n", pDbgcBp->szCmd); 757 747 else 758 pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\n");748 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "\n"); 759 749 } 760 750 else 761 pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, " [unknown bp]\n");751 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " [unknown bp]\n"); 762 752 763 753 return VINF_SUCCESS; … … 775 765 * @param cArgs Number of arguments in the array. 776 766 */ 777 static DECLCALLBACK(int) dbgcCmdBrkList(PCDBGCCMD /*pCmd*/, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR /*paArgs*/, unsigned /*cArgs*/, PDBGCVAR /*pResult*/) 778 { 767 static DECLCALLBACK(int) dbgcCmdBrkList(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR /*paArgs*/, unsigned cArgs, PDBGCVAR /*pResult*/) 768 { 769 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 770 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs == 0); 771 772 /* 773 * Enumerate the breakpoints. 774 */ 779 775 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 780 781 /*782 * Enumerate the breakpoints.783 */784 776 int rc = DBGFR3BpEnum(pVM, dbgcEnumBreakpointsCallback, pDbgc); 785 777 if (RT_FAILURE(rc)) 786 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3BpEnum failed.\n");778 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3BpEnum"); 787 779 return rc; 788 780 } … … 799 791 * @param cArgs Number of arguments in the array. 800 792 */ 801 static DECLCALLBACK(int) dbgcCmdBrkSet(PCDBGCCMD /*pCmd*/, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR /*pResult*/)793 static DECLCALLBACK(int) dbgcCmdBrkSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR /*pResult*/) 802 794 { 803 795 /* … … 805 797 */ 806 798 DBGFADDRESS Address; 807 int rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[0], &Address);799 int rc = DBGCCmdHlpVarToDbgfAddr(pCmdHlp, &paArgs[0], &Address); 808 800 if (RT_FAILURE(rc)) 809 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Couldn't convert '%DV' to a DBGF address, rc=%Rrc.\n", &paArgs[0], rc);801 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGCCmdHlpVarToDbgfAddr(,'%DV',)", &paArgs[0]); 810 802 811 803 /* … … 835 827 * Try set the breakpoint. 836 828 */ 837 RTUINTiBp;829 uint32_t iBp; 838 830 rc = DBGFR3BpSet(pVM, &Address, iHitTrigger, iHitDisable, &iBp); 839 831 if (RT_SUCCESS(rc)) 840 832 { 841 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);833 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 842 834 rc = dbgcBpAdd(pDbgc, iBp, pszCmds); 843 835 if (RT_SUCCESS(rc)) 844 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Set breakpoint %u at %RGv\n", iBp, Address.FlatPtr);836 return DBGCCmdHlpPrintf(pCmdHlp, "Set breakpoint %u at %RGv\n", iBp, Address.FlatPtr); 845 837 if (rc == VERR_DBGC_BP_EXISTS) 846 838 { 847 839 rc = dbgcBpUpdate(pDbgc, iBp, pszCmds); 848 840 if (RT_SUCCESS(rc)) 849 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Updated breakpoint %u at %RGv\n", iBp, Address.FlatPtr);841 return DBGCCmdHlpPrintf(pCmdHlp, "Updated breakpoint %u at %RGv\n", iBp, Address.FlatPtr); 850 842 } 851 843 int rc2 = DBGFR3BpClear(pDbgc->pVM, iBp); 852 844 AssertRC(rc2); 853 845 } 854 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Failed to set breakpoint at %RGv, rc=%Rrc.\n", Address.FlatPtr, rc);846 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "Failed to set breakpoint at %RGv", Address.FlatPtr); 855 847 } 856 848 … … 866 858 * @param cArgs Number of arguments in the array. 867 859 */ 868 static DECLCALLBACK(int) dbgcCmdBrkREM(PCDBGCCMD /*pCmd*/, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR /*pResult*/)860 static DECLCALLBACK(int) dbgcCmdBrkREM(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR /*pResult*/) 869 861 { 870 862 /* … … 872 864 */ 873 865 DBGFADDRESS Address; 874 int rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[0], &Address);866 int rc = DBGCCmdHlpVarToDbgfAddr(pCmdHlp, &paArgs[0], &Address); 875 867 if (RT_FAILURE(rc)) 876 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Couldn't convert '%DV' to a DBGF address, rc=%Rrc.\n", &paArgs[0], rc);868 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGCCmdHlpVarToDbgfAddr(,'%DV',)", &paArgs[0]); 877 869 878 870 /* … … 902 894 * Try set the breakpoint. 903 895 */ 904 RTUINTiBp;896 uint32_t iBp; 905 897 rc = DBGFR3BpSetREM(pVM, &Address, iHitTrigger, iHitDisable, &iBp); 906 898 if (RT_SUCCESS(rc)) … … 909 901 rc = dbgcBpAdd(pDbgc, iBp, pszCmds); 910 902 if (RT_SUCCESS(rc)) 911 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Set REM breakpoint %u at %RGv\n", iBp, Address.FlatPtr);903 return DBGCCmdHlpPrintf(pCmdHlp, "Set REM breakpoint %u at %RGv\n", iBp, Address.FlatPtr); 912 904 if (rc == VERR_DBGC_BP_EXISTS) 913 905 { 914 906 rc = dbgcBpUpdate(pDbgc, iBp, pszCmds); 915 907 if (RT_SUCCESS(rc)) 916 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Updated REM breakpoint %u at %RGv\n", iBp, Address.FlatPtr);908 return DBGCCmdHlpPrintf(pCmdHlp, "Updated REM breakpoint %u at %RGv\n", iBp, Address.FlatPtr); 917 909 } 918 910 int rc2 = DBGFR3BpClear(pDbgc->pVM, iBp); 919 911 AssertRC(rc2); 920 912 } 921 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Failed to set REM breakpoint at %RGv, rc=%Rrc.\n", Address.FlatPtr, rc);913 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "Failed to set REM breakpoint at %RGv", Address.FlatPtr); 922 914 } 923 915 -
trunk/src/VBox/Debugger/DBGCInternal.h
r35673 r35694 80 80 struct DBGCBP *pNext; 81 81 /** The breakpoint identifier. */ 82 RTUINTiBp;82 uint32_t iBp; 83 83 /** The size of the command. */ 84 84 size_t cchCmd; … … 239 239 /** rc from the last dbgcHlpPrintfV(). */ 240 240 int rcOutput; 241 /** The last character we wrote. */ 242 char chLastOutput; 243 241 244 /** rc from the last command. */ 242 245 int rcCmd; -
trunk/src/VBox/VMM/VMMR3/CSAM.cpp
r35348 r35694 2663 2663 2664 2664 #ifdef VBOX_WITH_DEBUGGER 2665 2665 2666 /** 2666 2667 * The '.csamoff' command. … … 2675 2676 static DECLCALLBACK(int) csamr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult) 2676 2677 { 2677 /* 2678 * Validate input. 2679 */ 2680 if (!pVM) 2681 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n"); 2682 2683 CSAMDisableScanning(pVM); 2684 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "CSAM Scanning disabled\n"); 2678 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 2679 2680 int rc = CSAMDisableScanning(pVM); 2681 if (RT_FAILURE(rc)) 2682 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMDisableScanning"); 2683 return DBGCCmdHlpPrintf(pCmdHlp, "CSAM Scanning disabled\n"); 2685 2684 } 2686 2685 … … 2697 2696 static DECLCALLBACK(int) csamr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult) 2698 2697 { 2699 /* 2700 * Validate input. 2701 */ 2702 if (!pVM) 2703 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n"); 2704 2705 CSAMEnableScanning(pVM); 2706 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "CSAM Scanning enabled\n"); 2707 } 2708 #endif 2698 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 2699 2700 int rc = CSAMEnableScanning(pVM); 2701 if (RT_FAILURE(rc)) 2702 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMEnableScanning"); 2703 return DBGCCmdHlpPrintf(pCmdHlp, "CSAM Scanning enabled\n"); 2704 } 2705 2706 #endif /* VBOX_WITH_DEBUGGER */ -
trunk/src/VBox/VMM/VMMR3/DBGFBp.cpp
r35346 r35694 38 38 RT_C_DECLS_BEGIN 39 39 static DECLCALLBACK(int) dbgfR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, 40 uint8_t u8Type, uint8_t cb, PRTUINTpiBp);41 static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, PRTUINTpiBp);42 static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, PRTUINTpiBp);43 static DECLCALLBACK(int) dbgfR3BpClear(PVM pVM, RTUINTiBp);44 static DECLCALLBACK(int) dbgfR3BpEnable(PVM pVM, RTUINTiBp);45 static DECLCALLBACK(int) dbgfR3BpDisable(PVM pVM, RTUINTiBp);40 uint8_t u8Type, uint8_t cb, uint32_t *piBp); 41 static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp); 42 static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp); 43 static DECLCALLBACK(int) dbgfR3BpClear(PVM pVM, uint32_t iBp); 44 static DECLCALLBACK(int) dbgfR3BpEnable(PVM pVM, uint32_t iBp); 45 static DECLCALLBACK(int) dbgfR3BpDisable(PVM pVM, uint32_t iBp); 46 46 static DECLCALLBACK(int) dbgfR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser); 47 47 static int dbgfR3BpRegArm(PVM pVM, PDBGFBP pBp); … … 101 101 * Determine which array to search. 102 102 */ 103 unsigned cBps;104 PRTUINTpcBpsCur;105 PDBGFBP paBps;103 unsigned cBps; 104 uint32_t *pcBpsCur; 105 PDBGFBP paBps; 106 106 switch (enmType) 107 107 { … … 149 149 * @param iBp The breakpoint id. 150 150 */ 151 static PDBGFBP dbgfR3BpGet(PVM pVM, RTUINTiBp)151 static PDBGFBP dbgfR3BpGet(PVM pVM, uint32_t iBp) 152 152 { 153 153 /* Find it. */ … … 278 278 * @thread Any thread. 279 279 */ 280 VMMR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINTpiBp)280 VMMR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp) 281 281 { 282 282 /* … … 303 303 * @thread Any thread. 304 304 */ 305 static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, PRTUINTpiBp)305 static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp) 306 306 { 307 307 /* … … 435 435 */ 436 436 VMMR3DECL(int) DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, 437 uint8_t fType, uint8_t cb, PRTUINTpiBp)437 uint8_t fType, uint8_t cb, uint32_t *piBp) 438 438 { 439 439 /** @todo SMP - broadcast, VT-x/AMD-V. */ … … 466 466 */ 467 467 static DECLCALLBACK(int) dbgfR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, 468 uint8_t fType, uint8_t cb, PRTUINTpiBp)468 uint8_t fType, uint8_t cb, uint32_t *piBp) 469 469 { 470 470 /* … … 603 603 * @thread Any thread. 604 604 */ 605 VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINTpiBp)605 VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp) 606 606 { 607 607 /* … … 628 628 * @internal 629 629 */ 630 static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, PRTUINTpiBp)630 static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp) 631 631 { 632 632 /* … … 695 695 * @thread Any thread. 696 696 */ 697 VMMR3DECL(int) DBGFR3BpClear(PVM pVM, RTUINTiBp)697 VMMR3DECL(int) DBGFR3BpClear(PVM pVM, uint32_t iBp) 698 698 { 699 699 /* … … 715 715 * @internal 716 716 */ 717 static DECLCALLBACK(int) dbgfR3BpClear(PVM pVM, RTUINTiBp)717 static DECLCALLBACK(int) dbgfR3BpClear(PVM pVM, uint32_t iBp) 718 718 { 719 719 /* … … 768 768 * @thread Any thread. 769 769 */ 770 VMMR3DECL(int) DBGFR3BpEnable(PVM pVM, RTUINTiBp)770 VMMR3DECL(int) DBGFR3BpEnable(PVM pVM, uint32_t iBp) 771 771 { 772 772 /* … … 788 788 * @internal 789 789 */ 790 static DECLCALLBACK(int) dbgfR3BpEnable(PVM pVM, RTUINTiBp)790 static DECLCALLBACK(int) dbgfR3BpEnable(PVM pVM, uint32_t iBp) 791 791 { 792 792 /* … … 841 841 * @thread Any thread. 842 842 */ 843 VMMR3DECL(int) DBGFR3BpDisable(PVM pVM, RTUINTiBp)843 VMMR3DECL(int) DBGFR3BpDisable(PVM pVM, uint32_t iBp) 844 844 { 845 845 /* … … 861 861 * @internal 862 862 */ 863 static DECLCALLBACK(int) dbgfR3BpDisable(PVM pVM, RTUINTiBp)863 static DECLCALLBACK(int) dbgfR3BpDisable(PVM pVM, uint32_t iBp) 864 864 { 865 865 /* -
trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp
r35346 r35694 86 86 { 1, 1, DBGCVAR_CAT_STRING, 0, "direction", "write/read." }, 87 87 { 1, 1, DBGCVAR_CAT_STRING, 0, "filename", "Filename." }, 88 { 1, 1, DBGCVAR_CAT_ STRING, 0, "errcode", "IPRT errorcode." },88 { 1, 1, DBGCVAR_CAT_NUMBER, 0, "errcode", "VBox status code." }, 89 89 }; 90 90 … … 699 699 static DECLCALLBACK(int) pdmacEpFileErrorInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArgs, unsigned cArgs, PDBGCVAR pResult) 700 700 { 701 bool fWrite;702 PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile;703 704 701 /* 705 702 * Validate input. 706 703 */ 707 if (!pVM) 708 return DBGCCmdHlpPrintf(pCmdHlp, "error: The command requires a VM to be selected.\n"); 709 if ( cArgs != 3 710 || pArgs[0].enmType != DBGCVAR_TYPE_STRING 711 || pArgs[1].enmType != DBGCVAR_TYPE_STRING 712 || pArgs[2].enmType != DBGCVAR_TYPE_STRING) 713 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: parser error, invalid arguments.\n"); 714 704 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 705 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs == 3); 706 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, pArgs[0].enmType == DBGCVAR_TYPE_STRING); 707 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 1, pArgs[1].enmType == DBGCVAR_TYPE_STRING); 708 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 2, pArgs[2].enmType == DBGCVAR_TYPE_NUMBER); 709 710 PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile; 715 711 pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pVM->pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE]; 716 712 717 713 /* Syntax is "read|write <filename> <status code>" */ 714 bool fWrite; 718 715 if (!RTStrCmp(pArgs[0].u.pszString, "read")) 719 716 fWrite = false; … … 721 718 fWrite = true; 722 719 else 723 { 724 DBGCCmdHlpPrintf(pCmdHlp, "error: invalid transefr direction '%s'.\n", pArgs[0].u.pszString); 725 return VINF_SUCCESS; 726 } 727 728 /* Search for the matching endpoint. */ 720 return DBGCCmdHlpFail(pCmdHlp, pCmd, "invalid transfer direction '%s'", pArgs[0].u.pszString); 721 722 int32_t rcToInject = (int32_t)pArgs[2].u.u64Number; 723 if ((uint64_t)rcToInject != pArgs[2].u.u64Number) 724 return DBGCCmdHlpFail(pCmdHlp, pCmd, "The status code '%lld' is out of range", pArgs[0].u.u64Number); 725 726 727 /* 728 * Search for the matching endpoint. 729 */ 729 730 RTCritSectEnter(&pEpClassFile->Core.CritSect); 731 730 732 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEpClassFile->Core.pEndpointsHead; 731 732 733 while (pEpFile) 733 734 { … … 736 737 pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEpFile->Core.pNext; 737 738 } 738 739 739 if (pEpFile) 740 740 { 741 int rcToInject = RTStrToInt32(pArgs[2].u.pszString); 742 741 /* 742 * Do the job. 743 */ 743 744 if (fWrite) 744 745 ASMAtomicXchgS32(&pEpFile->rcReqWrite, rcToInject); 745 746 else 746 ASMAtomicXchgS32(&pEpFile->rcReqRead, rcToInject); 747 748 DBGCCmdHlpPrintf(pCmdHlp, "Injected %Rrc into '%s' for %s\n", 749 rcToInject, pArgs[1].u.pszString, pArgs[0].u.pszString); 750 } 751 else 752 DBGCCmdHlpPrintf(pCmdHlp, "No file with name '%s' found\n", NULL, pArgs[1].u.pszString); 747 ASMAtomicXchgS32(&pEpFile->rcReqRead, rcToInject); 748 749 DBGCCmdHlpPrintf(pCmdHlp, "Injected %Rrc into '%s' for %s\n", 750 (int)rcToInject, pArgs[1].u.pszString, pArgs[0].u.pszString); 751 } 753 752 754 753 RTCritSectLeave(&pEpClassFile->Core.CritSect); 754 755 if (!pEpFile) 756 return DBGCCmdHlpFail(pCmdHlp, pCmd, "No file with name '%s' found", pArgs[1].u.pszString); 755 757 return VINF_SUCCESS; 756 758 } 757 #endif 759 #endif /* VBOX_WITH_DEBUGGER */ 758 760 759 761 static int pdmacFileInitialize(PPDMASYNCCOMPLETIONEPCLASS pClassGlobals, PCFGMNODE pCfgNode) … … 830 832 if (RT_SUCCESS(rc)) 831 833 { 832 rc = DBGCRegisterCommands(&g_aCmds[0], 1);834 rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds)); 833 835 AssertRC(rc); 834 836 } -
trunk/src/VBox/VMM/VMMR3/STAM.cpp
r35346 r35694 172 172 { 173 173 /* pszCmd, cArgsMin, cArgsMax, paArgDesc, cArgDescs, pResultDesc, fFlags, pfnHandler pszSyntax, ....pszDescription */ 174 { "stats", 0, 1, &g_aArgPat[0], RT_ELEMENTS(g_aArgPat), NULL, 0, stamR3CmdStats, "[pattern]", "Display statistics." },175 { "statsreset", 0, 1, &g_aArgPat[0], RT_ELEMENTS(g_aArgPat), NULL, 0, stamR3CmdStatsReset,"[pattern]", "Resets statistics." }174 { "stats", 0, 1, &g_aArgPat[0], RT_ELEMENTS(g_aArgPat), NULL, 0, stamR3CmdStats, "[pattern]", "Display statistics." }, 175 { "statsreset", 0, 1, &g_aArgPat[0], RT_ELEMENTS(g_aArgPat), NULL, 0, stamR3CmdStatsReset,"[pattern]", "Resets statistics." } 176 176 }; 177 177 #endif … … 1922 1922 * Validate input. 1923 1923 */ 1924 if (!pVM) 1925 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n"); 1924 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 1926 1925 PUVM pUVM = pVM->pUVM; 1927 1926 if (!pUVM->stam.s.pHead) 1928 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Sorry, no statistics present.\n");1927 return DBGCCmdHlpFail(pCmdHlp, pCmd, "No statistics present"); 1929 1928 1930 1929 /* … … 1932 1931 */ 1933 1932 STAMR3PRINTONEARGS Args; 1934 Args.pVM = pVM;1935 Args.pvArg = pCmdHlp;1936 Args.pfnPrintf = stamR3EnumDbgfPrintf;1933 Args.pVM = pVM; 1934 Args.pvArg = pCmdHlp; 1935 Args.pfnPrintf = stamR3EnumDbgfPrintf; 1937 1936 1938 1937 return stamR3EnumU(pUVM, cArgs ? paArgs[0].u.pszString : NULL, true /* fUpdateRing0 */, stamR3PrintOne, &Args); … … 1974 1973 * Validate input. 1975 1974 */ 1976 if (!pVM) 1977 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n"); 1975 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 1978 1976 PUVM pUVM = pVM->pUVM; 1979 1977 if (!pUVM->stam.s.pHead) 1980 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Sorry, no statistics present.\n");1978 return DBGCCmdHlpFail(pCmdHlp, pCmd, "No statistics present"); 1981 1979 1982 1980 /* … … 1985 1983 int rc = STAMR3ResetU(pUVM, cArgs ? paArgs[0].u.pszString : NULL); 1986 1984 if (RT_SUCCESS(rc)) 1987 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "info: Statistics reset.\n"); 1988 1989 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Resetting statistics.\n"); 1985 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "STAMR3ResetU"); 1986 return DBGCCmdHlpPrintf(pCmdHlp, "Statistics have been reset.\n"); 1990 1987 } 1991 1988 -
trunk/src/VBox/VMM/include/DBGFInternal.h
r35601 r35694 245 245 bool fSymInited; 246 246 /** Alignment padding. */ 247 RTUINTuAlignment0;247 uint32_t uAlignment0; 248 248 249 249 /** The number of hardware breakpoints. */ 250 RTUINTcHwBreakpoints;250 uint32_t cHwBreakpoints; 251 251 /** The number of active breakpoints. */ 252 RTUINTcBreakpoints;252 uint32_t cBreakpoints; 253 253 /** Array of hardware breakpoints. (0..3) 254 254 * This is shared among all the CPUs because life is much simpler that way. */ -
trunk/src/recompiler/VBoxRecompiler.c
r35346 r35694 3669 3669 static DECLCALLBACK(int) remR3CmdDisasEnableStepping(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult) 3670 3670 { 3671 bool fEnable;3672 3671 int rc; 3673 3672 3674 /* print status */3675 3673 if (cArgs == 0) 3676 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "DisasStepping is %s\n", 3677 pVM->rem.s.Env.state & CPU_EMULATE_SINGLE_STEP ? "enabled" : "disabled"); 3678 3679 /* convert the argument and change the mode. */ 3680 rc = pCmdHlp->pfnVarToBool(pCmdHlp, &paArgs[0], &fEnable); 3681 if (RT_FAILURE(rc)) 3682 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "boolean conversion failed!\n"); 3683 rc = REMR3DisasEnableStepping(pVM, fEnable); 3684 if (RT_FAILURE(rc)) 3685 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "REMR3DisasEnableStepping failed!\n"); 3674 /* 3675 * Print the current status. 3676 */ 3677 rc = DBGCCmdHlpPrintf(pCmdHlp, "DisasStepping is %s\n", 3678 pVM->rem.s.Env.state & CPU_EMULATE_SINGLE_STEP ? "enabled" : "disabled"); 3679 else 3680 { 3681 /* 3682 * Convert the argument and change the mode. 3683 */ 3684 bool fEnable; 3685 rc = DBGCCmdHlpVarToBool(pCmdHlp, &paArgs[0], &fEnable); 3686 if (RT_SUCCESS(rc)) 3687 { 3688 rc = REMR3DisasEnableStepping(pVM, fEnable); 3689 if (RT_SUCCESS(rc)) 3690 rc = DBGCCmdHlpPrintf(pCmdHlp, "DisasStepping was %s\n", fEnable ? "enabled" : "disabled"); 3691 else 3692 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "REMR3DisasEnableStepping"); 3693 } 3694 else 3695 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGCCmdHlpVarToBool"); 3696 } 3686 3697 return rc; 3687 3698 } 3688 #endif 3699 #endif /* VBOX_WITH_DEBUGGER && !win.amd64 */ 3689 3700 3690 3701
Note:
See TracChangeset
for help on using the changeset viewer.

