On Fri, Jul 23, 2010 at 3:50 PM, Earnie <earnie@...> wrote:
> Bostjan Mihoric wrote:
>> I posted several questions on debugging here, and only ever got one
>> reply: about DrMingw, of course. Seems nobody cares about solid
>> debugging mechanisms anymore, and MinGW provides no solution for core
>> dumps, the mechanism used everywhere else.
> Have you considered using the binutils objdump program? Your questions
> were related to using the MS API for debugging, I don't know how many do
> that here.
Hmm, I don't remember anything about MS API ;) My questions were a)
how to postmortem debug MinGW programs (preferably with GDB), b) what
others are using to postmortem debug MinGW programs, and c) I asked
for help regarding GDB not working JIT on Windows XP. I was
experimenting with objdump though, and it is indeed still the best
solution I have found.
>> DrMingw has a certain DLL you can link with, and it should produce a
>> stack trace. Note that this is still not the ideal solution, since
>> just the stack trace will not be able to tell you some stuff that a
>> debugger with a stack dump can. Like the exact state of multiple
>> threads. You also need to distribute with the debug info included,
>> which I see as something that should not be necessary.
> With objdump you can get the stack trace from the client and be able to
> get to the source where the issue occurred.
True, I look at the minidump and can figure out point of crash and
even some backtrace and parameter values. It's still obscure, though,
and I would prefer simply loading the dump with the debugger.
Especially since GDB refuses to work JIT for me and I have to use the
objdump method all the time :(
>> GDB is ported, but cannot read Windows-produced stack dumps. Based on
>> my research, this is still your (and my) best bet, though, for serious
>> debugging. There exists a project:
>> that includes a tool called md2core, or minidump-2-core. You can find
>> its source by following source -> browse -> svn -> trunk -> src ->
>> tools -> linux -> md2core.
> Gdb is a good place to start but I don't know how much porting
> development has been done for MinGW much less Windows. Yes, debugging
> efforts have been slim to none with MinGW with DrMingw being the most I
> know about.
>> I'm trying to make this Linux tool compile on Windows, hoping to be
>> able to convert minidump files to dumps that GDB could read. I made a
>> quick port, but it doesn't work. Probably did not include the right
>> Windows and Linux header values. Will continue trying.
> Great, news. If you get it to work correctly, please consider allowing
> it to be distributed by MinGW with you as the package maintainer.
I'll see what I can do. I am barely finding the time, though, working
on a couple of other projects as well.