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.

你可能感兴趣的:(debug)