views:

199

answers:

3

I've written a shared library which is partly used by a Windows application written in Visual Studio 6 (pure C).

The library works flawlessly under Linux, but under Windows something's broken somewhere (it uses some #ifdef WIN32 which might enclose something errornous).

But adding the library DLL as "additional DLLs" to the project in VS6 and running the application in debug mode, it says the DLL files does not contain debugging information.

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

i586-mingw32msvc-nm -a file.dll does show symbols, and when stripping the DLL its size cuts to half and i586-mingw32msvc-nm -a file.dll won't show anything anymore.

But Visual Studio 6 still complains about missing debugging information. And using the "Dependeny Walker" tool it says "Debug = No" on the library.

To be able to solve the problems when running under Windows, the debugging information is critical. But how is it possible to either include them in the DLL (in a VS6 compatible way) or else extract them to a dbg/pdb file?

A: 

The problem is that GCC doesn't really know about PDB. Ideally, if you can I'd try to build the DLL using VC6 (well, ideally I wouldn't, I would use a better compiler on Windows as VC6 is well outdated). The other option might be to build the whole application using MingW and then use gdb with an appropriate front end on it.

However, this email might help - I haven't tried this myself and it seems you'll only get very limited debug info.

Timo Geusch
A: 

Maybe if you export your functions like this, they will be visible to the debugger in Visual Studio?

Also, as Timo suggested, try to compile the DLL with VC6 or some other Windows compiler.

Amigable Clark Kant
A: 

GCC and VC++ don't use the same debug information format, so you have had it as far as that goes. Using a debugger is never essential however - it's a good idea not to come to depend on one too much.

anon