zoukankan      html  css  js  c++  java
  • Debugging DLL loading issues with GFLAGS

    GFlags (Global Flags)

    Note: basically you need to install Debugging Tools For Windows from http://www.microsoft.com/whdc/devtools/debugging/default.mspx to get it.

    Gflags released as part of debugging tools for windows (x86) from MS can be used to set an option for Inventor.exe that will enable additional diagnostic output to the Visual Studio debugger output window. This can help determine who is attempting to load a missing .dll or who is unable to resolve a symbol in a dll.

    How To Use It?

    1. Get GFlags, open it and do some settings. Keep it running.

    You may have a copy of gflags.exe on your machine under c:\Program Files\Support Tools.

    Type Inventor.exe in the "Image File Name" edit control, then click on the Image File Options radio button, check the loader snaps option, then press Apply & OK.

    If not, you can install the Debugging Tools For Windows from http://www.microsoft.com/whdc/devtools/debugging/default.mspx and there is a newer gflags.exe with a slightly different UI.

    Click on the Image File tab, type Inventor.exe then <tab>, check the loader snaps option, Apply, OK.See below snapshot:

    2. Load Inventor in the Visual Studio debugger and you will see lots of LDR messages in the output window. If you get an "Entry Point Not found" error dialog showing the symbol name and the dll that was expected to contain the symbol, you can look in the debugger output window and the last entry will tell you exactly which dll was trying to resolve its symbols when the error was detected. For example if DL.dll could not find an entry point in RSe.dll you would see this:

       LDR: rse.dll used by DL.dll

       LDR: Snapping imports for DL.dll from rse.dll

    Or, if a dll is missing, for example if DL.dll was not found, you will see the following output:

       LDR: DL.dll used by DWGExt.dll

       LDR: LdrpResolveDllName - call to RtlDosSearchPath_U failed

       DllName: "DL.dll"

    If you get the error dialogs but don't get the LDR messages then it probably means the error happened on the initial load of Inventor.exe, in that case you can just run Depends.exe on Inventor.exe to figure out the cause.

    Its recommended to turn off the loader snaps option when you are done, otherwise the output window will be too cluttered with these messages during normal debugging.

  • 相关阅读:
    c# 三元运算符 表达式赋值的时候 我老容易写错 备注下
    wpf 图片操作类 ImageBrush BitmapImage
    WPF 结合 微软的手写板 进行输入
    c# 经纬度距离计算
    c# 通用类扩展方法 备注
    Android SDK Manager无法更新的解决(转帖)
    GridControl相关设置
    SDK Manager.exe运行一闪而过
    “LC.exe”已退出 或者 设计器提示控件为声明
    建立管理员帐户
  • 原文地址:https://www.cnblogs.com/taoxu0903/p/1594451.html
Copyright © 2011-2022 走看看