debug symbol issue

2019-06-10 08:42发布

I am interested in which symbol file is used when we analyze dump file using Windbg or Visual Studio. Suppose my application is using a utility library, and the utility library has related private symbol file. When there is crash dump in my application, I need the symbol of the utility library to analyze the full call stack. But sometimes the build/runtime/debug environments are installed with different versions of the utility library -- which are (for sure) of different versions of utility library symbols.

Suppose we have a version (e.g. version A) of utility library (and related symbol) for build (link) my application, using another version (e.g. version B) of utility library (and related symbol) in runtime when there is crash, and using another different version (e.g. version C) of utility library (and related symbol) in Windbg when I analyze the crash dump.

My question is, when the crash is genarated in runtime, version B symbol is used to generate the crash dump (to fill the dump with symbol information)? But when using a different version of symbol C in Windbg debugging environment, there will be symbol mis-match issue? And which version of library is used to build does not matter? Are my understandings all correct?

thanks in advance, George

2条回答
太酷不给撩
2楼-- · 2019-06-10 09:23

Generally the symbols should be in the same file as the code (that's why debug versions are generally bigger). I can't recall a case where a debugger would pull the symbols from one binary while running another--but then, this is from general knowledge and not from any specialized information about your environment.

查看更多
对你真心纯属浪费
3楼-- · 2019-06-10 09:26

It sounds like you want to use a Symbol Server so that WinDBG or VS can pull down symbols that correspond to the build of the library you're debugging. If it's a third party component and you have private symbols you can either put them symbols in your own server or see if the third party has a public symbol server.

Windbg won't load symbols if they don't match the dll you're debugging, you can use !sym noisy to see more about the symbol loading process. If you choose not to use a symbol server you can manage all the pdb's by hand and load them manually into windbg (use lm v to get detailed information about a module loaded in your process)

查看更多
登录 后发表回答