VirtualBox

儲存庫 vbox 的更動 16580


忽略:
時間撮記:
2009-2-9 下午12:07:53 (16 年 以前)
作者:
vboxsync
訊息:

Main: make new error functions more granular

位置:
trunk
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/include/VBox/com/errorprint2.h

    r16556 r16580  
    3939// compiled only once for all front-ends
    4040void GluePrintErrorInfo(com::ErrorInfo &info);
     41void GluePrintErrorContext(const char *pcszContext, const char *pcszSourceFile, uint32_t ulLine);
    4142void GluePrintRCMessage(HRESULT rc);
    4243void GlueHandleComError(ComPtr<IUnknown> iface, const char *pcszContext, HRESULT rc, const char *pcszSourceFile, uint32_t ulLine);
  • trunk/src/VBox/Main/glue/errorprint2.cpp

    r16555 r16580  
    5050}
    5151
     52void GluePrintErrorContext(const char *pcszContext, const char *pcszSourceFile, uint32_t ulLine)
     53{
     54    // pcszSourceFile comes from __FILE__ macro, which always contains the full path,
     55    // which we don't want to see printed:
     56    Utf8Str strFilename(RTPathFilename(pcszSourceFile));
     57    Utf8Str str = Utf8StrFmt("Context: \"%s\" at line %d of file %s\n",
     58                                pcszContext,
     59                                ulLine,
     60                                strFilename.c_str());
     61    // print and log
     62    RTPrintf("%s", str.c_str());
     63    Log(("%s", str.c_str()));
     64}
     65
    5266void GluePrintRCMessage(HRESULT rc)
    5367{
     
    6781    com::ErrorInfo info(iface);
    6882    if (info.isFullAvailable() || info.isBasicAvailable())
    69     {
    7083        GluePrintErrorInfo(info);
    71 
    72         // pcszSourceFile comes from __FILE__ macro, which always contains the full path,
    73         // which we don't want to see printed:
    74         Utf8Str strFilename(RTPathFilename(pcszSourceFile));
    75         Utf8Str str = Utf8StrFmt("Context: \"%s\" at line %d of file %s\n",
    76                                  pcszContext,
    77                                  ulLine,
    78                                  strFilename.c_str());
    79         // print and log
    80         RTPrintf("%s", str.c_str());
    81         Log(("%s", str.c_str()));
    82     }
     84    GluePrintErrorContext(pcszContext, pcszSourceFile, ulLine);
    8385}
    8486
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette