4

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?

speakman
  • 936
  • 9
  • 11

3 Answers3

0

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
  • 24,095
  • 5
  • 52
  • 70
0

You could always use gdb as your debugger instead of windbg. It would understand the symbols from gcc/g++/mingw toolchain. Might not integrate completely into your toolkit, but it would get you the symbols. A windows version of gdb is availble in the mingw binary installer.

RobotHumans
  • 807
  • 10
  • 25
-3

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.

  • 3
    > Using a debugger is never essential however You are kidding right ?! A debugger is *vital* for development ! No wonder even the micro-processors have debugging capabilities. –  Feb 10 '11 at 16:15
  • 3
    @Master: Not true. If you're using Test-Driven Development methods and debug statements you may never need to use a debugger. – Robert Harvey Feb 10 '11 at 16:15