I'm building with mingw-w64 on Windows and using libbacktrace as implementation. When getting function names using name() on a frame, the wrong result as register_frame_ctor was returned.
Here is an example:
#define BOOST_STACKTRACE_USE_BACKTRACE
#include <backtrace.h>
#include <boost/stacktrace.hpp>
#include <iostream>
int main()
{
boost::stacktrace::stacktrace trace;
for (unsigned i = 0; i < trace.size(); ++i) {
std::cout << i << "# " << trace[i].name() << '\n';
}
return 0;
}
Result:
PS C:\demo> g++ main.cpp -o main.exe -lbacktrace -std=c++20 -g
PS C:\demo> ./main
0# register_frame_ctor
1# register_frame_ctor
2# register_frame_ctor
3# register_frame_ctor
4# register_frame_ctor
5# register_frame_ctor
Environment
- OS: Windows 11 24H2
- Compiler: MinGW-w64 GCC 14.2.0 x86_64 posix-seh-msvcrt
I have opened a pr #224 that fixes this issue.
I'm building with mingw-w64 on Windows and using libbacktrace as implementation. When getting function names using
name()on a frame, the wrong result asregister_frame_ctorwas returned.Here is an example:
Result:
Environment
I have opened a pr #224 that fixes this issue.