Closed treeswift closed 1 year ago
A recent DrMingw has https://github.com/armdevvel/drmingw#catchsegv
However, ARM32 CONTEXT layout needs to be supported. Forking.
It kinda works:
Running catchsegv dirinfo on Admin@Greylorn (assuming correct PATH):
dirinfo.exe caused an Access Violation at location 010215AF in module dirinfo.exe Writing to location 00000001.
Flags=0020000f (CONTEXT_ARM|CONTROL|INTEGER|FLOATING_POINT|DEBUG_REGISTERS)
r0=00000011 r1=00000001 r2=00000144 r3=00F4F7A0
r4=00000003 r5=00000030 r6=00F4F7E0 r7=75BAB6D5
r8=75BA3DF9 r9=00000001 r10=01092988 fp=00F4F800
r12=00000000 sp=00F4F7C0 lr=6067344F pc=010215AF
AddrPC Params
010215AF 00000011 00000001 00000144 dirinfo.exe!main+0x173 [/home/lxe/Code/mxe-shared/tmp-libfatctl-armv7-w64-mingw32/local.build_/../../../libfatctl/samples/dirinfo.cpp @ 49]
6067344F 00000011 00000001 00000144 ucrtbase.DLL!_open_osfhandle+0x14f
Assuming valid frame pointer in release code produces funny results, but at least the register dump and code line resolution work. (Build client code with -g -gdwarf-aranges -fno-omit-frame-pointer
.)
Once ARM32 support is proven to be mature, it will probably be worth upstreaming.
When a console app is being used in a remote / non-GUI session and crashes, and DrMingw is registered as the default debugger, the stack dump window is displayed in the graphic session. The application has to be forcibly terminated with
TASKKILL /F /IM <progname.exe>
orTASKKILL /F /PID <pid>
.Nice to have: for a console app, redirect the dump to the session the application is running in.