qnxbacktraceqnx-neutrinoblackberry-qnx

Why can't I call bt_get_backtrace() in QNX?


I wanted to backtrace the funtions in stack in my QNX program, so I consulted the API in the official documentation of QNX. I followed the example code in the official document to call bt_get_backtrace() in libbacktrace.so, but it returns -1 and the program reported an error stating "Not Spportted". enter image description here

However, I can load and print memmap successfully by calling bt_load_memmap and bt_sprn_memmap.

How can I solve this problem? Is there any other way to do backtrace? I have try exeinfo.h and libunwind but both of them doesn't work.


Solution

  • libbacktrace on QNX does not support backtraces on aarch64. You're better off using libunwind [0].

    [0] https://github.com/libunwind/libunwind