Root > Advanced topics > Using EurekaLog in DLL > Using Microsoft DbgHelp DLL

Using Microsoft DbgHelp DLL

Previous pageReturn to chapter overviewNext page   

You can use MS debug format to get information for system DLLs. By default Windows comes in "release" version - i.e. without debug information for system DLLs (so-called "free build"). This prevents you from getting proper information. In fact, you only can get heuristic information based on DLL exports. However, you can ask Microsoft for debug information and get full coverage for Microsoft DLLs.

 

Basically, when your application needs debug information about system DLL - it can ask Microsoft server for specific version of system DLL and download corresponding debug information file. Unfortunately, this process is not well-suited for end-users machines, but acceptable for developers machines. This information can be used not only by EurekaLog, but also by other tools.

 

1. You'll need a good internet connection.
2. A lot of free disk space (about 512 Mb).
3. You need to create a writable folder which will be used as local cache.
4. You have to use the latest DbgHelp.dll. Default DLL which ships with Windows will not work. Use DLL either from Microsoft Debugging Tools for Windows or from \Bin (\Bin64) folders of EurekaLog installation.
5. You have to setup retrieving debug information (see below).

 

Warning: using this process will slow down building call stacks and bug reports in your application - because information will be downloaded from the internet. This is especially true for the first time use, when many information needs to be downloaded and it not present in the cache. Therefore you should disable hang detection in your application.

 

A sample call stack without using debug information for system DLLs (information was provided by DLL exports provider):

 

| Module     | Unit       | Class Name | Routine Name                    | Line   |

|richedit.exe|remain      |            |Enumer                           |216[2]  |

|USER32.dll  |USER32      |            |(possible GetWindow+508)         |        |

|USER32.dll  |USER32      |            |EnumWindows                      |        |

|richedit.exe|remain      |TMainForm   |UpdateStatus                     |225[1]  |

|richedit.exe|remain      |TMainForm   |SetFileName                      |234[4]  |

|richedit.exe|remain      |TMainForm   |PerformFileOpen                  |325[3]  |

|richedit.exe|remain      |TMainForm   |FileOpen                         |361[4]  |

...

|USER32.dll  |USER32      |            |(possible GetThreadDesktop+296)  |        |

...

|richedit.exe|Classes     |            |StdWndProc                       |        |

|USER32.dll  |USER32      |            |(possible gapfnScSendMessage+818)|        |

|USER32.dll  |USER32      |            |(possible GetThreadDesktop+128)  |        |

|USER32.dll  |USER32      |            |(possible CharPrevW+307)         |        |

|USER32.dll  |USER32      |            |DispatchMessageW                 |        |

|richedit.exe|Forms       |TApplication|HandleMessage                    |        |

|richedit.exe|Forms       |TApplication|Run                              |        |

|richedit.exe|richeditdemo|            |Initialization                   |24[4]   |

|kernel32.dll|kernel32    |            |BaseThreadInitThunk              |        |

 

As you can see - entries from User32.dll are confusing. Some of them mentions only "possible" match and this match is usually wrong. This is the best that you can do without debug information.

 

Consider the same call stack when retrieving debug information is set (information was provided by Microsoft provider):

 

| Module     | Unit       | Class Name | Routine Name          | Line   |

|richedit.exe|remain      |            |Enumer                 |216[2]  |

|USER32.dll  |USER32      |            |InternalEnumWindows    |        |

|USER32.dll  |USER32      |            |EnumWindows            |        |

|richedit.exe|remain      |TMainForm   |UpdateStatus           |225[1]  |

|richedit.exe|remain      |TMainForm   |SetFileName            |234[4]  |

|richedit.exe|remain      |TMainForm   |PerformFileOpen        |325[3]  |

|richedit.exe|remain      |TMainForm   |FileOpen               |361[4]  |

...

|USER32.dll  |USER32      |            |CallWindowProcAorW     |        |

...

|richedit.exe|Classes     |            |StdWndProc             |        |

|USER32.dll  |USER32      |            |InternalCallWinProc    |        |

|USER32.dll  |USER32      |            |UserCallWinProcCheckWow|        |

|USER32.dll  |USER32      |            |DispatchMessageWorker  |        |

|USER32.dll  |USER32      |            |DispatchMessageW       |        |

|richedit.exe|Forms       |TApplication|HandleMessage          |        |

|richedit.exe|Forms       |TApplication|Run                    |        |

|richedit.exe|richeditdemo|            |Initialization         |24[4]   |

|kernel32.dll|kernel32    |            |BaseThreadInitThunk    |        |

 

As you can see - entries from User32.dll are now correct.

 

 

Enabling downloading debug information for developer machine

You can enable this feature by going to "Tools" / "EurekaLog" / "IDE options" menu item:

 

 

Opening global EurekaLog options

 

You'll see a dialog to set global EurekaLog options:

 

 

EurekaLog IDE options

 

1. "DbgHelp.dll path" option specifies full file name to DbgHelp DLL. You can find it in EurekaLog's installation folder (like: C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Bin\dbghelp.dll). You can also change this path to alternative library. This is DLL from Debugging tools for Microsoft Windows.

 

2. "Cache" option specifies read-write folder to be used as cache for debug info symbols. It's empty by default, which means disabled feature. You can click on "Use defaults" button to set default preference (which is sub-folder in your %APPDATA%, for example: C:\Users\User\AppData\Roaming\Neos Eureka S.r.l\EurekaLog\SYMBOLS) or select your own folder. Be sure that this folder is writable and disk have some free space (500 Mb minimum). This cache folder is used by MS Debug info provider to store debug symbols for system libraries.

 

3. "Debug symbol sources" option specifies debug info sources for MS Debug info provider. You can add one or more sources here by using edit-box and buttons below. Source can be local folder (like: C:\Symbols), shared network path (like: \\server\symbols) or URL of symbol's server (like: http://server/symbols). It's empty by default, which means disabled feature. You can click on "Use defaults" button to set default preference (which is default Microsoft's symbol server: http://msdl.microsoft.com/download/symbols) or select your own sources.

 

To quickly enable feature - you can just click on "Use defaults" button and close options dialog via OK button. To disable feature - remove all debug symbol sources.

 

 

Enabling downloading debug information for other machines

To enable or disable this feature on any other machine you can use "Set Debug Symbols Path" tool, which can be found in \Bin\SetDebugSymbolsPath.exe under EurekaLog installation folder. This tool can be copied on another machine and used to set up path to DLL, to cache, and to debug symbols source. It has the same UI as IDE options dialog:

 

 

Set Debug Symbols Path Tool

 

To enable feature - select DbgHelp.dll, specify path to writable folder, add URL, and click on "Set for EurekaLog" button. To disable feature - remove all debug symbol sources and click on "Set for EurekaLog" button.

 

 

Enabling downloading debug information for other tools (non-EurekaLog)

You can also use the similar feature in other debugging software. You can use "Set Debug Symbols Path" tool to setup this feature or you can do it manually. To setup it with "Set Debug Symbols Path" tool - copy \Bin\SetDebugSymbolsPath.exe file to another machine, run it, specify all data and click on "Set for Process Explorer tool" to set these settings for Process Explorer tool or "Set other" to set these settings for any other tool. To use "Set other" button you need to run the tool under administrator account.

 

To configure this feature manually - you need to build "configuration string" in the following format:

 

SRV*folder*URL

 

For example:

 

SRV*C:\ProgramData\DebugSymbols*http://msdl.microsoft.com/download/symbols

 

Then you'll need to enter this string into your tool as "Symbols path" folder. Refer to documentation of your tool on where to find this setting. For example, for Process Explorer tool you can find it under "Options" / "Configure symbols" menu item.

 

 

Configuring EurekaLog projects to use Microsoft symbols

Any EurekaLog-enabled application can use Microsoft symbols to get information about system functions when building call stack. You can enable this feature by checking "Microsoft DBG/PDB" option in debug information providers configuration.

 

 

See also:




Send feedback... Build date: 2018-11-26
Last edited: 2018-06-14
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/using_microsoft_dbghelp.php