- Timestamp:
- Sep 28, 2013 3:21:23 AM (11 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Include/Library/DebugLib.h
r48747 r48748 477 477 CHAR16 *VBoxDebugHandleDevicePath2Str(IN EFI_HANDLE hHandle); 478 478 # endif 479 VOID EFIAPI VBoxLogWorker(const char *pszFormat, ...); 480 479 481 /** See RT_XSTR */ 480 482 # define VBOX_XSTR(str) VBOX_STR(str) … … 484 486 # define VBoxLogFlowFuncEnter() DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) ": ENTER\n", __FUNCTION__)) 485 487 # define VBoxLogFlowFuncLeave() DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) ": LEAVE\n", __FUNCTION__)) 486 # define VBoxLogFlowFuncLeaveRC(rc) DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) ": LEAVE " #rc "=%r\n", \487 __FUNCTION__, rc))488 488 # define VBoxLogFlowFuncMark() DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) "\n", __FUNCTION__)) 489 # define VBoxLogFlowFuncMarkRC(rc) DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) ": " #rc "=%r\n", __FUNCTION__, rc)) 489 # define VBoxLogFlowFuncLeaveRC(rc) \ 490 do { \ 491 EFI_STATUS rcLog = (rc); \ 492 DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) ": LEAVE " #rc "=0x%x (%r)\n", __FUNCTION__, rcLog, rcLog)); \ 493 } while (0) 490 494 # define VBoxLogFlowFuncMarkVar(var, varfmt) \ 491 DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) " " #var "=" varfmt "\n", __FUNCTION__, (var))) 492 # define VBoxLogFlowFuncMarkDP(dp) DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) ": " #dp "=%s\n", \ 493 __FUNCTION__, VBoxDebugDevicePath2Str(dp))) 494 # define VBoxLogFlowFuncMarkHandleDP(dp) DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) ": " #dp "=%s\n", \ 495 __FUNCTION__, VBoxDebugHandleDevicePath2Str(dp))) 495 DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) ": " #var "=" varfmt "\n", __FUNCTION__, (var))) 496 # define VBoxLogFlowFuncMarkRC(rc) \ 497 do { \ 498 EFI_STATUS rcLog = (rc); \ 499 DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) ": " #rc "=0x%x (%r)\n", __FUNCTION__, rcLog, rcLog)); \ 500 } while (0) 501 # define VBoxLogFlowFuncMarkDP(dp) \ 502 DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) ": " #dp "=%s\n", __FUNCTION__, VBoxDebugDevicePath2Str(dp))) 503 # define VBoxLogFlowFuncMarkHandleDP(dp)\ 504 DEBUG((DEBUG_INFO, "%a:" VBOX_XSTR(__LINE__) ": " #dp "=%s\n", __FUNCTION__, VBoxDebugHandleDevicePath2Str(dp))) 505 # define VBoxLog(a) VBoxLogWorker a 496 506 # else 497 507 # define VBoxLogFlowFuncEnter() do {} while (0) … … 499 509 # define VBoxLogFlowFuncLeaveRC(rc) do {} while (0) 500 510 # define VBoxLogFlowFuncMark() do {} while (0) 511 # define VBoxLogFlowFuncMarkVar(var, varfmt) do {} while (0) 501 512 # define VBoxLogFlowFuncMarkRC(rc) do {} while (0) 502 # define VBoxLogFlowFuncMarkVar(var, varfmt) do {} while (0)503 513 # define VBoxLogFlowFuncMarkDP(dp) do {} while (0) 504 514 # define VBoxLogLogFlowFuncMarkHandleDP(dp) do {} while (0) 515 # define VBoxLog(a) do {} while (0) 505 516 # endif 506 517 #endif -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.c
r48727 r48748 67 67 szBuf[cch] = '\0'; 68 68 69 /* Output the log string. */ 69 70 SavedFlags = ASMIntDisableFlags(); 70 71 … … 76 77 77 78 ASMSetFlags(SavedFlags); 78 79 } 80 81 /** 82 * Our own log worker function, avoid the dbg/00000xxx prefix and makes it clear 83 * which log statements we added.. 84 * 85 * @param pszFormat Format string. EFI style! 86 * @param ... Argument referneced in the format string. 87 */ 88 VOID EFIAPI 89 VBoxLogWorker(const char *pszFormat, ...) 90 { 91 CHAR8 szBuf[384]; 92 VA_LIST va; 93 UINTN cch; 94 RTCCUINTREG SavedFlags; 95 96 VA_START(va, pszFormat); 97 cch = AsciiVSPrint(szBuf, sizeof(szBuf), pszFormat, va); 98 VA_END(va); 99 100 /* make sure it's terminated and doesn't end with a newline */ 101 if (cch >= sizeof(szBuf)) 102 cch = sizeof(szBuf) - 1; 103 while (cch > 0 && (szBuf[cch - 1] == '\n' || szBuf[cch - 1] == '\r')) 104 cch--; 105 szBuf[cch] = '\0'; 106 107 /* Output the log string. */ 108 SavedFlags = ASMIntDisableFlags(); 109 110 VBoxPrintString(szBuf); 111 VBoxPrintChar('\n'); 112 113 ASMSetFlags(SavedFlags); 79 114 } 80 115 -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/fsw_efi.c
r48730 r48748 282 282 pVolume); 283 283 284 VBoxLogFlowFuncMark Var(Status, "%r");284 VBoxLogFlowFuncMarkRC(Status); 285 285 if (!EFI_ERROR(Status)) { 286 286 // register the SimpleFileSystem protocol
Note:
See TracChangeset
for help on using the changeset viewer.