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.

  • 相关阅读:
    关于图片或者文件在数据库的存储方式归纳
    js默认比较第一个数字大小
    项目中empty遇到的一个问题
    thinkphp 一个页面使用2次分页的方法
    mysql处理海量数据时的一些优化查询速度方法
    项目中的一个和分页总数有关的子查询
    Mysql乱码
    HTML 5 <input> placeholder 属性
    form 表单jquery验证插件使用
    在网站制作中随时可用的10个 HTML5 代码片段
  • 原文地址:https://www.cnblogs.com/taoxu0903/p/1594451.html
Copyright © 2011-2022 走看看