How to get debugging symbols in a DLL or extract them to a dbg file using Mingw?

I wrote a shared library that is partially used by a Windows application written in Visual Studio 6 (pure C).

The library works flawlessly on Linux, but on Windows, something broke somewhere (it uses some #ifdef WIN32, which may contain something wrong).

But adding the library DLL as “additional DLLs” to the project in VS6 and running the application in debug mode, he says that the DLL files do not contain debug information.

The library is built on gcc without optimization (-O0) and with debugging symbols (-g).

i586-mingw32msvc-nm -a file.dll shows characters, and when the DLL is deleted, its size is reduced to half, and i586-mingw32msvc-nm -a file.dll will not display anything else.

But Visual Studio 6 still complains about the lack of debugging information. And using the Dependeny Walker tool, he says "Debug = No" in the library.

To solve problems when working under Windows, important debugging information. But how can you include them in a DLL (image compatible with VS6) or extract them into a dbg / pdb file?

+4
source share
3 answers

The problem is that GCC really does not know about PDB. Ideally, if you can try to create a DLL using VC6 (well, ideally I wouldn’t do this, I would use the best compiler on Windows since VC6 is deprecated). Another option would be to create an entire application using MingW, and then use gdb with the appropriate interface on it.

However, this email may help - I have not tried this myself, and it seems that you will get very limited debugging information.

0
source

You can always use gdb as your debugger instead of windbg. He will understand the characters from gcc / g ++ / mingw toolchain. It may not fully integrate into your toolkit, but you will get characters. The gdb version for Windows is available in the mingw binary installer.

0
source

GCC and VC ++ do not use the same debugging information format, so you did it anyway. Using a debugger is never essential, but it is a good idea not to depend on one too much.

-2
source

Source: https://habr.com/ru/post/1301005/


All Articles