admin管理员组文章数量:1357682
I wrote a cross-platform application that people use on multiple OSes. To make the build as universal as possible, i chose to compile it with MinGW (or to be more exact: gcc within a Msys2/UCRT environment).
Now this application crashes for one of my users on Windows, but that crash is not reproducible on my machine. So i sent the user a debug version of my application with integrated debug symbols and asked him to send me one of the crash dumps Windows generate, and i got one.
So what i have is
- an executable built with MinGW in debug mode, with debug symbols inside
- a Windows crash dump (it's actually a full dump, not just a minidump)
The problem is that while the crash dump is in a format that MS tools understand (WinDbg, Visual Studio, ...), the debug symbols are in a format that GNU tools understand (gdb, ...). So WinDbg opens the dump but cannot translate the stack addresses into source code locations, while gdb won't even open the dump because it's not a coredump.
I know there are already several similar questions, but neither of them have satisfying answers. Here is what i've already tried:
- I've tried the vaguely described addr2line method in this question. I printed the stack trace in WinDbg using
!analyze -v
, i copied the addresses into a text file and i passed that file together with the executable file intoaddr2line
, but it only printed??
everywhere. Note: I've triedaddr2line
from Msys2/UCRT and also WSL2 just to be sure. - I've tried dwarfstack. After fixing few compilation errors (because people never have their repositories compilable by default for some reason), i've build the library and the provided example a2l.c and gave it my stack addresses and executable, but it printed absolutely nothing.
- I've tried converting my debug executable into MS
pdb
file using cv2pdb, but it outputed a lot of errors and the pdb was corrupted and couldn't be loaded into Visual Studio.
NOTE: I'll repeat this again, because i see that in the previous questions people didn't get it. The crash doesn't happen on my computer, it only happens to a certain customer, therefore i'm unable to install additional tools (port-mortem debuggers, ...) on that computer. Generating the dump was probably the maximum i could ask from that user.
Please don't tell me i'm the only person on this planet who develops applications for Windows using non-Microsoft build tools and needs to debug them. MinGW has been there for 20+ years, it can't be that there is still no solution to this problem.
本文标签: cHow to debug a crashed program compiled with MinGW from a Windows crash dumpStack Overflow
版权声明:本文标题:c++ - How to debug a crashed program compiled with MinGW from a Windows crash dump - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743991536a2572231.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论