将Visual Studio 2008指向第三方DLL的源代码进行调试 [英] Pointing Visual Studio 2008 to the source code of a third-party DLL for debugging

查看:540
本文介绍了将Visual Studio 2008指向第三方DLL的源代码进行调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用第三方库(Open Scene Graph)的VS 2008 C ++项目。



当我开始调试项目时,每次从这个外部库被调用,调试器只是跳过它,因为(显然)调试器没有.cpp文件在哪里查找代码。它只跳转到与我的项目链接的头文件,因为这些文件存在并且它们的位置是已知的。所以,我只能看到这些小内联函数发生了什么,但不能在我没有的.cpp文件中实现的更大的函数中。



我需要的是以某种方式通过这些第三方dll / libs的源代码与我自己的代码相同。



我下载了该库的整个源代码,并将其编译到我的机器上。现在我有dll和libs,以及.pdb文件和.cpp文件。但是,我怎么告诉Visual Studio第三方库的.cpp文件的位置,以便它知道当我想进入一个来自.dll或.lib的函数时,会打开相应的。 cpp文件(即使它不在我的项目中,位于一个完全不同的文件夹)?



这是可以吗?



我尝试将.libs,.dlls(调试版本),.pdbs复制到我的项目使用的位置和其他库目录和项目的文件夹,但这必须是不够的。 / p>

解决方案

将PDB文件的目录添加到工具 - >选项 - >调试 - >符号。


I have a VS 2008 C++ project which uses a third-party library (Open Scene Graph).

When i start debugging the project, each time a function from this external library is called, the debugger just jumps over it, because (obviously) the debugger has no .cpp files where to look up the code. It only jumps into header files which are linked to my project because those files exist and their location is known. So, i can only see what's going on in those small inline functions, but not in the bigger functions whose implementation is in .cpp files which i don't have.

I need is to somehow step thru the source code of these third-party dlls/libs the same way I do with my own code.

I downloaded the the whole source code of that library and compiled it on my machine. Now i have the dlls and libs, and the .pdb files, and the .cpp files, too. But how exactly do I tell Visual Studio the locations of the .cpp files of the third-party library, so that it knows, that when i want to step into a function coming from a .dll or a .lib it opens the corresponding .cpp file (even though it's not in my project and is located is a completely different folder)?

Is this at all possible?

I tried copying the .libs, the .dlls (debug versions), .pdbs both to the locations which my Project uses and "Additional Library Directories" and to the project's folder but this must be not enough.

解决方案

Add the dir with the PDB files to Tools -> Options -> Debugging -> Symbols.

这篇关于将Visual Studio 2008指向第三方DLL的源代码进行调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆