儲存庫 vbox 的更動 89720
圖例:
- 未更動
- 新增
- 刪除
-
trunk/include/VBox/com/errorprint.h
r86141 r89720 48 48 // compiled only once for all front-ends 49 49 void GluePrintErrorInfo(const com::ErrorInfo &info); 50 void GluePrintErrorContext(const char *pcszContext, const char *pcszSourceFile, uint32_t uLine );50 void GluePrintErrorContext(const char *pcszContext, const char *pcszSourceFile, uint32_t uLine, bool fWarning = false); 51 51 void GluePrintRCMessage(HRESULT rc); 52 52 void GlueHandleComError(ComPtr<IUnknown> iface, const char *pcszContext, HRESULT rc, const char *pcszSourceFile, uint32_t uLine); … … 88 88 if (1) { \ 89 89 type hrc = iface->method; \ 90 if (SUCCEEDED(hrc) ) \90 if (SUCCEEDED(hrc) && !SUCCEEDED_WARNING(hrc)) \ 91 91 { /*likely*/ } \ 92 92 else \ 93 93 { \ 94 94 com::GlueHandleComError(iface, #method, (hrc), __FILE__, __LINE__); \ 95 stmtError; \ 95 if (!SUCCEEDED_WARNING(hrc)) \ 96 { \ 97 stmtError; \ 98 } \ 96 99 } \ 97 100 } else do { /* nothing */ } while (0) … … 112 115 do { \ 113 116 rc = iface->method; \ 114 if (FAILED(rc) ) \117 if (FAILED(rc) || SUCCEEDED_WARNING(rc)) \ 115 118 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \ 116 119 } while (0) … … 144 147 do { \ 145 148 rc = iface->method; \ 146 if (FAILED(rc)) \ 147 { \ 148 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \ 149 stmt; \ 149 if (FAILED(rc) || SUCCEEDED_WARNING(rc)) \ 150 { \ 151 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \ 152 if (!SUCCEEDED_WARNING(rc) \ 153 { \ 154 stmt; \ 155 } \ 150 156 } \ 151 157 } while (0) … … 183 189 ({ \ 184 190 rc = iface->method; \ 185 if (FAILED(rc)) \ 186 { \ 187 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \ 188 break; \ 191 if (FAILED(rc) || SUCCEEDED_WARNING(rc)) \ 192 { \ 193 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \ 194 if (!SUCCEEDED_WARNING(rc)) \ 195 break; \ 189 196 } \ 190 197 }) … … 197 204 { \ 198 205 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \ 199 break; \ 206 if (!SUCCEEDED_WARNING(rc)) \ 207 break; \ 200 208 } \ 201 209 } \ … … 243 251 do { \ 244 252 rc = iface->method; \ 245 if (FAILED(rc)) \ 246 { \ 247 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \ 248 return (ret); \ 253 if (FAILED(rc) || SUCCEEDED_WARNING(rc)) \ 254 { \ 255 com::GlueHandleComError(iface, #method, rc, __FILE__, __LINE__); \ 256 if (!SUCCEEDED_WARNING(rc)) \ 257 return (ret); \ 249 258 } \ 250 259 } while (0) -
trunk/src/VBox/Main/glue/errorprint.cpp
r86141 r89720 47 47 try 48 48 { 49 HRESULT rc = S_OK; 49 50 Utf8Str str; 50 51 RTCList<Utf8Str> comp; … … 55 56 bstrDetailsText.raw()); 56 57 if (haveResultCode) 57 comp.append(Utf8StrFmt("code %Rhrc (0x%RX32)", 58 info.getResultCode(), 59 info.getResultCode())); 58 { 59 rc = info.getResultCode(); 60 comp.append(Utf8StrFmt("code %Rhrc (0x%RX32)", rc, rc)); 61 } 60 62 if (haveComponent) 61 63 comp.append(Utf8StrFmt("component %ls", … … 78 80 79 81 // print and log 80 RTMsgError("%s", str.c_str()); 81 Log(("ERROR: %s", str.c_str())); 82 if (FAILED(rc)) 83 { 84 RTMsgError("%s", str.c_str()); 85 Log(("ERROR: %s", str.c_str())); 86 } 87 else 88 { 89 RTMsgWarning("%s", str.c_str()); 90 Log(("WARNING: %s", str.c_str())); 91 } 82 92 } 83 93 catch (std::bad_alloc &) … … 88 98 } 89 99 90 void GluePrintErrorContext(const char *pcszContext, const char *pcszSourceFile, uint32_t ulLine )100 void GluePrintErrorContext(const char *pcszContext, const char *pcszSourceFile, uint32_t ulLine, bool fWarning /* = false */) 91 101 { 92 102 // pcszSourceFile comes from __FILE__ macro, which always contains the full path, … … 94 104 // print and log 95 105 const char *pszFilenameOnly = RTPathFilename(pcszSourceFile); 96 RTMsgError("Context: \"%s\" at line %d of file %s\n", pcszContext, ulLine, pszFilenameOnly); 97 Log(("Context: \"%s\" at line %d of file %s\n", pcszContext, ulLine, pszFilenameOnly)); 106 if (!fWarning) 107 { 108 RTMsgError("Context: \"%s\" at line %d of file %s\n", pcszContext, ulLine, pszFilenameOnly); 109 Log(("ERROR: Context: \"%s\" at line %d of file %s\n", pcszContext, ulLine, pszFilenameOnly)); 110 } 111 else 112 { 113 RTMsgWarning("Context: \"%s\" at line %d of file %s\n", pcszContext, ulLine, pszFilenameOnly); 114 Log(("WARNING: Context: \"%s\" at line %d of file %s\n", pcszContext, ulLine, pszFilenameOnly)); 115 } 98 116 } 99 117 … … 101 119 { 102 120 // print and log 103 RTMsgError("Code %Rhra (extended info not available)\n", rc); 104 Log(("ERROR: Code %Rhra (extended info not available)\n", rc)); 121 if (FAILED(rc)) 122 { 123 RTMsgError("Code %Rhra (extended info not available)\n", rc); 124 Log(("ERROR: Code %Rhra (extended info not available)\n", rc)); 125 } 126 else 127 { 128 RTMsgWarning("Code %Rhra (extended info not available)\n", rc); 129 Log(("WARNING: Code %Rhra (extended info not available)\n", rc)); 130 } 105 131 } 106 132 … … 117 143 { 118 144 GluePrintErrorInfo(*pInfo); 145 146 /* Use rc for figuring out if there were just warnings. */ 147 HRESULT rc2 = pInfo->getResultCode(); 148 if ( (SUCCEEDED_WARNING(rc) && FAILED(rc2)) 149 || (SUCCEEDED(rc) && (FAILED(rc2) || SUCCEEDED_WARNING(rc2)))) 150 rc = rc2; 119 151 120 152 pInfo = pInfo->getNext(); … … 136 168 137 169 if (pcszContext != NULL || pcszSourceFile != NULL) 138 GluePrintErrorContext(pcszContext, pcszSourceFile, ulLine );170 GluePrintErrorContext(pcszContext, pcszSourceFile, ulLine, SUCCEEDED_WARNING(rc)); 139 171 } 140 172
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器