如何调试静态库的代码(libeay32.lib和ssleay32.lib) [英] How to debug code of static library (libeay32.lib and ssleay32.lib)

查看:1652
本文介绍了如何调试静态库的代码(libeay32.lib和ssleay32.lib)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用VC ++编译器使用openssl源代码构建了openssl静态库(libeay32.lib和ssleay32.lib)。我在VS2010项目中使用它们,并且工作得很好。

  #pragma comment(lib,libeay32.lib)
#pragma comment(lib,ssleay32.lib)

然后问题是我要调试VS2010中的openssl库的源代码(step into,step over ...)。例如,在openssl api中设置断点,然后进入openssl源文件。我如何才能实现?



在构建openssl静态库时,我已经尝试使用VS编译器选项Zi来生成一些.pdb文件,但是我不知道如何使用它们我尝试在Option-> Debugging-> Symbols-> Symbol文件位置添加这些.pdb文件的路径,但似乎不起作用。

解决方案

请参阅Jared的答案,网址为: 如何调试visual studio中的外部类库项目?简单来说:




  • 调试 - > Windows - >模块

  • 找到项目的DLL对

  • 右键单击 - >加载符号 - >选择您的其他项目的.PDB路径



另外,请确保PDB文件与 libeay32.lib ssleay32.lib



最后,如果您真的有麻烦,请尝试Thomas Hruska的 Win32 OpenSSL安装项目 。托马斯为您建立一切并在Windows安装程序中进行打包。


I have built openssl static libraries(libeay32.lib and ssleay32.lib) with openssl source code using VC++ compiler. I use them in a VS2010 project and they works well.

#pragma comment( lib, "libeay32.lib" )
#pragma comment( lib, "ssleay32.lib" )

Then problem is I want to debug the source code of openssl libraries in VS2010(step into, step over...). For example, set a breakpoint in the openssl api and then step into the openssl source file. how can I achieve that?

I have tried to use VS compiler option 'Zi' to generate some .pdb files when building openssl static libraries, but I don't know how to use them. I tried to add the path of those .pdb files in Option->Debugging->Symbols->Symbol file location, but seems it doesn't work.

解决方案

See Jared's answer at How to debug external class library projects in visual studio?. In short:

  • Debug -> Windows -> Modules
  • Find the DLL for the project you are interested in
  • Right Click -> Load Symbols -> Select the Path to the .PDB for your other project

Also, make sure the PDB files are in the same directory as libeay32.lib and ssleay32.lib.

Finally, if you are really having trouble, try Thomas Hruska's The Win32 OpenSSL Installation Project. Thomas prebuilds everything for you and packages it in a Windows installer.

这篇关于如何调试静态库的代码(libeay32.lib和ssleay32.lib)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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