With the current code, I had no success to get the library running for x86-64 architecture compiled with mingw-w64. However I adapted the library a little bit and was able to get it running. A patch file is attached to this ticket.
What did I changed? First of all I had to compile the library with the option
force.cppflags = ['-mtune=generic', '-march=x86-64']
in my doozer configuration.
But then the assembler fails due to some x86 (32 bit) specific inline assembler directives. The solution is quite easy. With mingw-w64 and x86-64 architecture, we can simply use RtlCaptureContext to capture the context.
So I added another compile condition to the "MINGW32" test in windows/frames.cpp, that checks if we are not using 64 bit architecture. If we use 64 bit architecture the else-path with RtlCaptureContext is compiled instead.
However after this change the program counter addresses I got were invalid and I was not able to get any symbols out of it. By reading the error code (that is not printed out by default :/ ) I found out, that a SymInitialize seems to be missing before calling StackWalk64.
I added a call to this function directly before starting the stack-walk and this function is also called for 32 bit targets. I guess this is also necessary for 32 bit systems, however I did not check afterwards if it still runs on 32 bit.
The other changes in the patch-file are just some log-output adaptations. They are not necessary for 64 bit systems ;-) (the only relevant change is in "src/windows/frames.cpp")
I hope my patch-file helps you to fix the issue with mingw-w64 and x86-64 systems.
Thanks a lot for this library! I used it some time ago in a 32 bit project and I missed it a lot in my current 64 bit project. Now I can use it again. Yeah! ;-)
Best regards, André Netzeband