I am cross compiling from linux to windows using the mingw32 tools. I need to generate pdb files for debugging on windows. Is there a way to do this?
Asked
Active
Viewed 1.5k times
21
-
2Hmm, did you ask this question in [2008](http://mingw.5.n7.nabble.com/Generate-PDB-files-td17383.html)? – Jesse Good Oct 09 '13 at 11:02
-
I am using visual studio 2008. – Manoj Hanamshet Oct 10 '13 at 09:59
-
5@JesseGood it's good to check in every 5 years or so and see if there's any progress on the matter. – cod3monk3y Aug 17 '14 at 06:10
-
http://mingw-w64.org/doku.php/contribute#handling_of_pdb_in_gdb has a few links to some PDB projects, FWIW. – rogerdpack Aug 21 '15 at 21:59
3 Answers
18
this project gives you the ability to generate the pdb, it works in most cases for debuging :
https://github.com/rainers/cv2pdb
more details can help in this post about post mortem debugging

Pierrot
- 567
- 7
- 16
6
GCC/MinGW produces debug info in its own format used by GNU GDB Debugger, there is no support for Microsoft PDB format. So you can:
build application on Windows with MSVC
use Windows version of GNU GDB
- try to convert debug info to PDB and use Microsoft debuggers, but there is no mature solution

vitalyster
- 4,980
- 3
- 19
- 27
4
Another option is to cross-compile using llvm/clang instead of mingw, since llvm can now produce .pdb files. http://blog.llvm.org/2017/08/llvm-on-windows-now-supports-pdb-debug.html
That said, I just use cv2pdb. It doesn't translate everything correctly, but it's good enough.

Ralph Versteegen
- 774
- 7
- 9