windbg.info
Home Search
 You are here: arrow Home Forum

Search Our Site

www.windbg.info
Welcome, Guest
Please Login or Register.    Lost Password?
Debugging minGW/GCC built DLL in Visual Studio?
(1 viewing) 1 Guest
Go to bottom
TOPIC: Debugging minGW/GCC built DLL in Visual Studio?
#21
Edward (User)
Posts: 2
User Offline

Debugging minGW/GCC built DLL in Visual Studio? 05 Feb 2010 - 01:38
Is it possible to debug DLLs (made from C code) that had to be compiled with minGW GCC (because they are C99 and MS doesn't support C99) in Visual Studio?

All I see in VS is the disassembly and function names - no file debug info.
How about in winDBG?
It surprises me that VS can't absorb C code PE/COFF/STABS debug info and that there is no COFF to PDB conversion tool.
 
  Logged IP
  The administrator has disabled public write access.
#24
Robert Kuster (Visitor)
Moderator
Posts: 39
User Offline

Gender: Male www.rkuster.com Location: Slovenia, Europe Birthday: 31 Jan 1978
Re:Debugging minGW/GCC built DLL in Visual Studio? 17 Feb 2010 - 15:19
Edward, welcome.

The short answer is it depends. PDB is Microsoft's proprietary format and is not documented. While MS offers APIs to read and extract data from PDBs (see DIA SDK - Debug Interface Access SDK), there is no official API or documentation on how to generate or change PDB files. With this on mind it is very unlikely that you will find a tool to convert COFF/STABS into PDBs. Further it is unlikely that GNU tools them self would be able to emit PDBs any time soon.

On the other side it should be much easier to make a WinDbg extension which reads the GNU debug information and feeds it to WinDbg's internal symbols tables. In fact the SDbgExt extension does something similar; it reads MAP files generated by a MS linker and feeds that information to WinDbg. Obviously a MAP file doesn't contain as much debug information as a PDB file would, but it is still much better than looking at disassembly. Now, if only GNU MAP files would be the same as Microsoft's are. Unfortunately they are not...

To summarize it you seem to have the following options:
  1. Write a WinDbg extension which reads COFF/STABS and feeds this information to WinDbg.
  2. Convert GNU MAP files to the Microsoft MAP format and use the SDbgExt extension to read it into WinDbg.
  3. If you only have to do a limited amount of debugging with your DLL, you might turn to the handy OutputDebugString function. Through it your DLL could even send debugger commands to WinDbg from the code itself. See .ocommand (Expect Commands from Target) for more details.
You might also find the following links interesting:
Description of the .PDB files and of the .DBG files
How to identify where a failure is occurring in your code by using the address in the error message

I hope this helps,
Robert
 
Thinking debugging? Think www.windbg.info.
 
  Logged IP
  The administrator has disabled public write access.
#27
Edward (User)
Posts: 2
User Offline

Re:Debugging minGW/GCC built DLL in Visual Studio? 17 Feb 2010 - 19:01
thank for the pointers.
'looks like PDB absorbed in other IDE that already absorbs PECOFF/STABS and PECOFF/DWARF is a more realistic path. (GCC 4 is pushing out PECOFF/DWARF to complicate issues)....
 
  Logged IP
  The administrator has disabled public write access.
Go to top
  up top of page up  
 

Copyright © 2024 WinDbg.info. All Rights Reserved.
Page generated in 0.0004 seconds.