简体   繁体   English

如何使用mingw构建库时生成pdb文件?

[英]how to generate pdb files while building library using mingw?

I am cross compiling from linux to windows using the mingw32 tools. 我正在使用mingw32工具从linux到windows的交叉编译。 I need to generate pdb files for debugging on windows. 我需要生成pdb文件以便在Windows上进行调试。 Is there a way to do this? 有没有办法做到这一点?

this project gives you the ability to generate the pdb, it works in most cases for debuging : 这个项目让你能够生成pdb,它在大多数情况下适用于debuging:

https://github.com/rainers/cv2pdb https://github.com/rainers/cv2pdb

more details can help in this post about post mortem debugging 关于事后调试的更多细节可以帮助

http://blog.morlad.at/blah/mingw_postmortem http://blog.morlad.at/blah/mingw_postmortem

GCC/MinGW produces debug info in its own format used by GNU GDB Debugger, there is no support for Microsoft PDB format. GCC / MinGW以GNU GDB Debugger使用的格式生成调试信息,不支持Microsoft PDB格式。 So you can: 所以你可以:

  1. build application on Windows with MSVC 使用MSVC在Windows上构建应用程序

  2. use Windows version of GNU GDB 使用Windows版GNU GDB

  3. try to convert debug info to PDB and use Microsoft debuggers, but there is no mature solution 尝试将调试信息转换为PDB并使用Microsoft调试器,但没有成熟的解决方案

Another option is to cross-compile using llvm/clang instead of mingw, since llvm can now produce .pdb files. 另一种选择是使用llvm / clang而不是mingw进行交叉编译,因为llvm现在可以生成.pdb文件。 http://blog.llvm.org/2017/08/llvm-on-windows-now-supports-pdb-debug.html http://blog.llvm.org/2017/08/llvm-on-windows-now-supports-pdb-debug.html

That said, I just use cv2pdb. 也就是说,我只使用cv2pdb。 It doesn't translate everything correctly, but it's good enough. 它没有正确翻译所有内容,但它足够好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM