DFHack / dfhack

Memory hacking library for Dwarf Fortress and a set of tools that use it
Other
1.87k stars 475 forks source link

Enable minidumps #895

Open warmist opened 8 years ago

warmist commented 8 years ago

This would help both df and dfhack debugging. Also quite easy for windows not sure about other os'es: E.g. from this stackoverflow answer

lethosor commented 8 years ago

(Links in markdown are [title](url), not [url](title) - fixed)

lethosor commented 8 years ago

Would this be easy to integrate? I've been using libSegFault on Linux and something like it on OS X - the one disadvantage is that they only produce backtraces for a single thread (not always the one that caused the crash), but it would be easy enough to integrate too.

warmist commented 8 years ago

i think it produces all thread traces. But not sure.

warmist commented 8 years ago

Here is the code i'm using It's a bit stupid that it dynamically loads the libs as you can link them, but this way you don't need to change linking settings :P

lethosor commented 8 years ago

Regarding google-breakpad, I found this, which is a pretty simple example (and evidently doesn't require networking/server setup at all). I still haven't investigated how to integrate it, though.

warmist commented 8 years ago

But it seems that it makes the dump in it's own format: i.e you need to format symbols in special way and you need a special tool to walk through stack. Native way lets you make dumps that MSVC opens and lets you debug. Also this has 0 dependencies - windows already have all the libraries.

lethosor commented 8 years ago

I was under the impression that the format was pretty similar to Windows minidumps, but I don't know if they'd be usable with MSVC. Anyway, the advantage is that would produce consistent reports on every platform, and you could read them on every platform as well, as long as you have the necessary symbol files. I really haven't found something else that's comparable yet, although I guess distributing the symbol files would be a little inconvenient, so we can keep looking.