bombela / backward-cpp

A beautiful stack trace pretty printer for C++
MIT License
3.81k stars 479 forks source link

Libunwind on ARM Mac can't compile #308

Open adamnovak opened 1 year ago

adamnovak commented 1 year ago

With BACKWARD_HAS_LIBUNWIND=1 on an Arm MAC, backward.hpp has compiler errors. The first seems to be a missing semicolon at:

https://github.com/bombela/backward-cpp/blob/65a769ffe77cf9d759d801bc792ac56af8e911a3/backward.hpp#L1023

My error log is:

/Users/anovak/workspace/vg/include/backward.hpp:1013:27: error: expected ';' after expression
      unw_getcontext(&ctx)
                          ^
/Users/anovak/workspace/vg/include/backward.hpp:1016:19: error: no member named 'uc_mcontext' in 'unw_context_t'
          if (ctx.uc_mcontext->__ss.__eip ==
              ~~~ ^
/Users/anovak/workspace/vg/include/backward.hpp:1017:32: error: unknown type name 'greg_t'
              reinterpret_cast<greg_t>(error_addr())) {
                               ^
/Users/anovak/workspace/vg/include/backward.hpp:1018:13: error: no member named 'uc_mcontext' in 'unw_context_t'
        ctx.uc_mcontext->__ss.__eip = ctx.uc_mcontext->__ss.__esp;
        ~~~ ^
/Users/anovak/workspace/vg/include/backward.hpp:1018:43: error: no member named 'uc_mcontext' in 'unw_context_t'
        ctx.uc_mcontext->__ss.__eip = ctx.uc_mcontext->__ss.__esp;
                                      ~~~ ^
/Users/anovak/workspace/vg/include/backward.hpp:1021:40: error: no member named 'uc_mcontext' in 'unw_context_t'
          reinterpret_cast<void *>(ctx.uc_mcontext->__ss.__eip);
                                   ~~~ ^
6 errors generated.