Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extract debugging information from a msys/mingw gcc built dll using rebase.exe?

I'm trying to analyze a mini crash dump and need symbol files in order to get more details about the crash. Im currently just seeing: "034eff74 0086eee9 00000000 0089d58d 034eff94 app_integrator!ZNK14ACE_Data_Block4baseEv+0x6"

Is it possible to extract debugging information from a msys/mingw gcc built dll into a windbg readable format? If not, is there any other way of getting more detailed information, like loading a MAP file in some way?

The dll and all it's contained .o files are built with the -g flag.

like image 865
Kristofer Avatar asked Oct 20 '09 08:10

Kristofer


1 Answers

Windbg can't cope with the debugging information that will be generated by -g on a mingw installation. However, it can allegedly cope with COFF symbols.

If the source files for your DLL are small enough, you can probably get COFF debug information to build (-gcoff rather than -g).

So, Windbg can (allegedly) handle COFF symbols and GCC can generate them. So it should be easy from there, right? I was trying to do exactly this with a Win32 executable generated by Visual Studio 2008 that was loading a gcc-compiled DLL. Unfortunately for me, compiling with -gcoff didn't work. Mingw's gcc won't generate COFF symbols for projects with more than 64k lines of code. The DLL I was using was distincly larger then 64K code lines. Sadly I have to admit, I gave up and fell back on the trusty OutputDebugString. Otherwise I'd be able to give more complete instructions. I didn't fancy investigating the option of making gcc do COFF symbols for larger source files, or the alternative option of writing a debugging extension to parse DWARF or STABS data into windbg's internal symbol tables.

I fixed the issue, by the way!

Further suggestions can be found in this forum post at windbg.info.

like image 51
Pete Avatar answered Oct 13 '22 17:10

Pete