Skip to content

Using stacktrace with MinGW (with msys2) #14

@ustrobot

Description

@ustrobot

We used the stacktrace in our cross platform development (Win,Linux, Mac). On Linux/Mac it works as expected but on Windows there are some issues:

For windows we build our code using cmake+MinGW in msys2 environment as header only lib.

  • In default mode it does not work - always returns zero stack size. It appears that _Unwind_Backtrace always return zero stack.
  • In BOOST_STACKTRACE_USE_WINDBG mode it does not work as is. It requires to define
__CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8);
__CRT_UUID_DECL(IDebugControl,0x5182e668,0x105e,0x416e,0xad,0x92,0x24,0xef,0x80,0x04,0x24,0xba);
__CRT_UUID_DECL(IDebugSymbols,0x8c31e98c,0x983a,0x48a5,0x90,0x16,0x6f,0xe5,0xd6,0x67,0xa9,0x50);

Also it appears that symbols are not demangled. Thus we patched it by adding boost::core::demangle appending additional underscore before symbol.

Look at the patch with changes that we have made to make it working for us.
In the patch.diff.txt there are additional hacking to make it work with boost 1.60

Many Thanks!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions