Visual Studio debugger - source search directory

一个人想着一个人 提交于 2020-07-03 06:51:10

问题


I have a crash dump (minidump, mdmp format) for an executable (native x86 code) compiled on a different computer. I have the pdb + exe corresponding to the crash dump, they are located next to the crashdump, and debugger recognizes them correctly. The pdb references sources on a path which is not available on my computers (say E:\Project). When I first opened the crash dump, the debugger has asked me for the source location. I pointed it to E:\B\Project on my computer, however once the source window appeared, I realized my choice was wrong (the sources were for a different product branch). I would like to point the debugger to a correct location E:\D\Project, however the debugger is no longer asking me. There is no solution, project or opt file for the crashdump created. I have searched the registry, but I did not find E:\B\Project anywhere.

How can one set/change source directories for Visual Studio debugger?


回答1:


I have found one way, not very intuitive, but it works:

  • create a new Visual C++ project and solution (it may be created anywhere, but a location next to the mdmp file seems convenient)
  • or use a Visual C++ project and solution you normally use to build the executable
  • set up source location in Solution (Right click) > Common Properties > Debug Source Files > Directories containing source code
  • open the crash dump using File > Open > File > select Dump Files as a filter

Note: crash dump analysis guides on the internet can be misleading when they are not recent enough, as dump files are no longer opened as projects since 2010, they are opened as files instead. See a note by R Nitzel in the MSDN Crash Dump Analysis article.




回答2:


You should be able to specify the directories containing the source code with:
Solution (Right click) > Common Properties > Debug Source Files > Directories containing source code



来源:https://stackoverflow.com/questions/19924508/visual-studio-debugger-source-search-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!