vbox的更動 61681 路徑 trunk/src/VBox/Debugger
- 時間撮記:
- 2016-6-13 下午03:06:29 (8 年 以前)
- 位置:
- trunk/src/VBox/Debugger
- 檔案:
-
- 修改 2 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp
r61628 r61681 61 61 static FNDBGCCMD dbgcCmdDumpPageTableBoth; 62 62 static FNDBGCCMD dbgcCmdDumpTSS; 63 static FNDBGCCMD dbgcCmdDumpTypeInfo; 64 static FNDBGCCMD dbgcCmdDumpTypedVal; 63 65 static FNDBGCCMD dbgcCmdEditMem; 64 66 static FNDBGCCMD dbgcCmdGo; … … 202 204 { 0, 1, DBGCVAR_CAT_NUMBER, 0, "tss", "TSS selector number." }, 203 205 { 0, 1, DBGCVAR_CAT_POINTER, 0, "tss:ign|addr", "TSS address. If the selector is a TSS selector, the offset will be ignored." } 206 }; 207 208 209 /** 'dti' arguments. */ 210 static const DBGCVARDESC g_aArgDumpTypeInfo[] = 211 { 212 /* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */ 213 { 1, 1, DBGCVAR_CAT_STRING, 0, "type", "The type to dump" }, 214 { 0, 1, DBGCVAR_CAT_NUMBER, 0, "levels", "How many levels to dump the type information" } 215 }; 216 217 218 /** 'dtv' arguments. */ 219 static const DBGCVARDESC g_aArgDumpTypedVal[] = 220 { 221 /* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */ 222 { 1, 1, DBGCVAR_CAT_STRING, 0, "type", "The type to use" }, 223 { 1, 1, DBGCVAR_CAT_POINTER, 0, "address", "Address to start dumping from." }, 224 { 0, 1, DBGCVAR_CAT_NUMBER, 0, "levels", "How many levels to dump" } 204 225 }; 205 226 … … 351 372 { "dt32", 0, 1, &g_aArgDumpTSS[0], RT_ELEMENTS(g_aArgDumpTSS), 0, dbgcCmdDumpTSS, "[tss|tss:ign|addr]", "Dump the 32-bit task state segment (TSS)." }, 352 373 { "dt64", 0, 1, &g_aArgDumpTSS[0], RT_ELEMENTS(g_aArgDumpTSS), 0, dbgcCmdDumpTSS, "[tss|tss:ign|addr]", "Dump the 64-bit task state segment (TSS)." }, 374 { "dti", 1, 2, &g_aArgDumpTypeInfo[0],RT_ELEMENTS(g_aArgDumpTypeInfo), 0, dbgcCmdDumpTypeInfo,"<type> [levels]", "Dump type information." }, 375 { "dtv", 2, 3, &g_aArgDumpTypedVal[0],RT_ELEMENTS(g_aArgDumpTypedVal), 0, dbgcCmdDumpTypedVal,"<type> <addr> [levels]", "Dump a memory buffer using the information in the given type." }, 353 376 { "dw", 0, 1, &g_aArgDumpMem[0], RT_ELEMENTS(g_aArgDumpMem), 0, dbgcCmdDumpMem, "[addr]", "Dump memory in words." }, 354 377 /** @todo add 'e', 'ea str', 'eza str', 'eu str' and 'ezu str'. See also … … 3667 3690 3668 3691 /** 3692 * @callback_method_impl{FNDBGFR3TYPEDUMP, The 'dti' command dumper callback.} 3693 */ 3694 static DECLCALLBACK(int) dbgcCmdDumpTypeInfoCallback(uint32_t off, const char *pszField, uint32_t iLvl, 3695 const char *pszType, uint32_t fTypeFlags, 3696 uint32_t cElements, void *pvUser) 3697 { 3698 PDBGCCMDHLP pCmdHlp = (PDBGCCMDHLP)pvUser; 3699 3700 /* Pad with spaces to match the level. */ 3701 for (uint32_t i = 0; i < iLvl; i++); 3702 DBGCCmdHlpPrintf(pCmdHlp, " "); 3703 3704 size_t cbWritten = 0; 3705 DBGCCmdHlpPrintfEx(pCmdHlp, &cbWritten, "+0x%04x %s", off, pszField); 3706 while (cbWritten < 32) 3707 { 3708 /* Fill with spaces to get proper aligning. */ 3709 DBGCCmdHlpPrintf(pCmdHlp, " "); 3710 cbWritten++; 3711 } 3712 3713 DBGCCmdHlpPrintf(pCmdHlp, ": "); 3714 if (fTypeFlags & DBGFTYPEREGMEMBER_F_ARRAY) 3715 DBGCCmdHlpPrintf(pCmdHlp, "[%u] ", cElements); 3716 if (fTypeFlags & DBGFTYPEREGMEMBER_F_POINTER) 3717 DBGCCmdHlpPrintf(pCmdHlp, "Ptr "); 3718 DBGCCmdHlpPrintf(pCmdHlp, "%s\n", pszType); 3719 3720 return VINF_SUCCESS; 3721 } 3722 3723 3724 /** 3725 * @callback_method_impl{FNDBGCCMD, The 'dti' command.} 3726 */ 3727 static DECLCALLBACK(int) dbgcCmdDumpTypeInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3728 { 3729 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 3730 int rc; 3731 3732 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 3733 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 1 || cArgs == 2); 3734 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, paArgs[0].enmType == DBGCVAR_TYPE_STRING); 3735 if (cArgs == 2) 3736 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, paArgs[1].enmType == DBGCVAR_TYPE_NUMBER); 3737 3738 uint32_t cLvlMax = cArgs == 2 ? (uint32_t)paArgs[1].u.u64Number : UINT32_MAX; 3739 return DBGFR3TypeDumpEx(pUVM, paArgs[0].u.pszString, 0 /* fFlags */, cLvlMax, 3740 dbgcCmdDumpTypeInfoCallback, pCmdHlp); 3741 } 3742 3743 3744 static void dbgcCmdDumpTypedValCallbackBuiltin(PDBGCCMDHLP pCmdHlp, DBGFTYPEBUILTIN enmType, size_t cbType, 3745 PDBGFTYPEVALBUF pValBuf) 3746 { 3747 switch (enmType) 3748 { 3749 case DBGFTYPEBUILTIN_UINT8: 3750 DBGCCmdHlpPrintf(pCmdHlp, "%RU8", pValBuf->u8); 3751 break; 3752 case DBGFTYPEBUILTIN_INT8: 3753 DBGCCmdHlpPrintf(pCmdHlp, "%RI8", pValBuf->i8); 3754 break; 3755 case DBGFTYPEBUILTIN_UINT16: 3756 DBGCCmdHlpPrintf(pCmdHlp, "%RU16", pValBuf->u16); 3757 break; 3758 case DBGFTYPEBUILTIN_INT16: 3759 DBGCCmdHlpPrintf(pCmdHlp, "%RI16", pValBuf->i16); 3760 break; 3761 case DBGFTYPEBUILTIN_UINT32: 3762 DBGCCmdHlpPrintf(pCmdHlp, "%RU32", pValBuf->u32); 3763 break; 3764 case DBGFTYPEBUILTIN_INT32: 3765 DBGCCmdHlpPrintf(pCmdHlp, "%RI32", pValBuf->i32); 3766 break; 3767 case DBGFTYPEBUILTIN_UINT64: 3768 DBGCCmdHlpPrintf(pCmdHlp, "%RU64", pValBuf->u64); 3769 break; 3770 case DBGFTYPEBUILTIN_INT64: 3771 DBGCCmdHlpPrintf(pCmdHlp, "%RI64", pValBuf->i64); 3772 break; 3773 case DBGFTYPEBUILTIN_PTR32: 3774 DBGCCmdHlpPrintf(pCmdHlp, "%RX32", pValBuf->GCPtr); 3775 break; 3776 case DBGFTYPEBUILTIN_PTR64: 3777 DBGCCmdHlpPrintf(pCmdHlp, "%RX64", pValBuf->GCPtr); 3778 break; 3779 case DBGFTYPEBUILTIN_PTR: 3780 if (cbType == sizeof(uint32_t)) 3781 DBGCCmdHlpPrintf(pCmdHlp, "%RX32", pValBuf->GCPtr); 3782 else if (cbType == sizeof(uint64_t)) 3783 DBGCCmdHlpPrintf(pCmdHlp, "%RX64", pValBuf->GCPtr); 3784 else 3785 DBGCCmdHlpPrintf(pCmdHlp, "<Unsupported pointer width %u>", cbType); 3786 break; 3787 case DBGFTYPEBUILTIN_SIZE: 3788 if (cbType == sizeof(uint32_t)) 3789 DBGCCmdHlpPrintf(pCmdHlp, "%RU32", pValBuf->size); 3790 else if (cbType == sizeof(uint64_t)) 3791 DBGCCmdHlpPrintf(pCmdHlp, "%RU64", pValBuf->size); 3792 else 3793 DBGCCmdHlpPrintf(pCmdHlp, "<Unsupported size width %u>", cbType); 3794 break; 3795 case DBGFTYPEBUILTIN_FLOAT32: 3796 case DBGFTYPEBUILTIN_FLOAT64: 3797 case DBGFTYPEBUILTIN_COMPOUND: 3798 default: 3799 AssertMsgFailed(("Invalid built-in type: %d\n", enmType)); 3800 } 3801 } 3802 3803 /** 3804 * @callback_method_impl{FNDBGFR3TYPEDUMP, The 'dtv' command dumper callback.} 3805 */ 3806 static DECLCALLBACK(int) dbgcCmdDumpTypedValCallback(uint32_t off, const char *pszField, uint32_t iLvl, 3807 DBGFTYPEBUILTIN enmType, size_t cbType, 3808 PDBGFTYPEVALBUF pValBuf, uint32_t cValBufs, 3809 void *pvUser) 3810 { 3811 PDBGCCMDHLP pCmdHlp = (PDBGCCMDHLP)pvUser; 3812 3813 /* Pad with spaces to match the level. */ 3814 for (uint32_t i = 0; i < iLvl; i++); 3815 DBGCCmdHlpPrintf(pCmdHlp, " "); 3816 3817 size_t cbWritten = 0; 3818 DBGCCmdHlpPrintfEx(pCmdHlp, &cbWritten, "+0x%04x %s", off, pszField); 3819 while (cbWritten < 32) 3820 { 3821 /* Fill with spaces to get proper aligning. */ 3822 DBGCCmdHlpPrintf(pCmdHlp, " "); 3823 cbWritten++; 3824 } 3825 3826 DBGCCmdHlpPrintf(pCmdHlp, ": "); 3827 if (cValBufs > 1) 3828 DBGCCmdHlpPrintf(pCmdHlp, "[%u] [ ", cValBufs); 3829 3830 for (uint32_t i = 0; i < cValBufs; i++) 3831 { 3832 dbgcCmdDumpTypedValCallbackBuiltin(pCmdHlp, enmType, cbType, pValBuf); 3833 if (i < cValBufs - 1) 3834 DBGCCmdHlpPrintf(pCmdHlp, " , "); 3835 pValBuf++; 3836 } 3837 3838 if (cValBufs > 1) 3839 DBGCCmdHlpPrintf(pCmdHlp, " ]"); 3840 DBGCCmdHlpPrintf(pCmdHlp, "\n"); 3841 3842 return VINF_SUCCESS; 3843 } 3844 3845 3846 /** 3847 * @callback_method_impl{FNDBGCCMD, The 'dtv' command.} 3848 */ 3849 static DECLCALLBACK(int) dbgcCmdDumpTypedVal(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3850 { 3851 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 3852 int rc; 3853 3854 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 3855 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 2 || cArgs == 3); 3856 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, paArgs[0].enmType == DBGCVAR_TYPE_STRING); 3857 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, DBGCVAR_ISGCPOINTER(paArgs[1].enmType)); 3858 if (cArgs == 3) 3859 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, paArgs[2].enmType == DBGCVAR_TYPE_NUMBER); 3860 3861 /* 3862 * Make DBGF address and fix the range. 3863 */ 3864 DBGFADDRESS Address; 3865 rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[1], &Address); 3866 if (RT_FAILURE(rc)) 3867 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "VarToDbgfAddr(,%Dv,)\n", &paArgs[1]); 3868 3869 uint32_t cLvlMax = cArgs == 3 ? (uint32_t)paArgs[2].u.u64Number : UINT32_MAX; 3870 return DBGFR3TypeValDumpEx(pUVM, &Address, paArgs[0].u.pszString, 0 /* fFlags */, cLvlMax, 3871 dbgcCmdDumpTypedValCallback, pCmdHlp); 3872 } 3873 3874 /** 3669 3875 * @callback_method_impl{FNDBGCCMD, The 'm' command.} 3670 3876 */ -
trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp
r59229 r61681 342 342 { 343 343 } 344 VMMR3DECL(int) DBGFR3TypeRegister( PUVM pUVM, uint32_t cTypes, PCDBGFTYPEREG paTypes) 345 { 346 return VERR_INTERNAL_ERROR; 347 } 348 VMMR3DECL(int) DBGFR3TypeDeregister(PUVM pUVM, const char *pszType) 349 { 350 return VERR_INTERNAL_ERROR; 351 } 352 VMMR3DECL(int) DBGFR3TypeQueryReg( PUVM pUVM, const char *pszType, PCDBGFTYPEREG *ppTypeReg) 353 { 354 return VERR_INTERNAL_ERROR; 355 } 356 VMMR3DECL(int) DBGFR3TypeQuerySize( PUVM pUVM, const char *pszType, size_t *pcbType) 357 { 358 return VERR_INTERNAL_ERROR; 359 } 360 VMMR3DECL(int) DBGFR3TypeSetSize( PUVM pUVM, const char *pszType, size_t cbType) 361 { 362 return VERR_INTERNAL_ERROR; 363 } 364 VMMR3DECL(int) DBGFR3TypeDumpEx( PUVM pUVM, const char *pszType, uint32_t fFlags, 365 uint32_t cLvlMax, PFNDBGFR3TYPEDUMP pfnDump, void *pvUser) 366 { 367 return VERR_INTERNAL_ERROR; 368 } 369 VMMR3DECL(int) DBGFR3TypeQueryValByType(PUVM pUVM, PCDBGFADDRESS pAddress, const char *pszType, 370 PDBGFTYPEVAL *ppVal) 371 { 372 return VERR_INTERNAL_ERROR; 373 } 374 VMMR3DECL(void) DBGFR3TypeValFree(PDBGFTYPEVAL pVal) 375 { 376 } 377 VMMR3DECL(int) DBGFR3TypeValDumpEx(PUVM pUVM, PCDBGFADDRESS pAddress, const char *pszType, uint32_t fFlags, 378 uint32_t cLvlMax, FNDBGFR3TYPEVALDUMP pfnDump, void *pvUser) 379 { 380 return VERR_INTERNAL_ERROR; 381 } 344 382 345 383 #include <VBox/vmm/cfgm.h>
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器