如果是ARM平台arm-linux-gcc交叉编译,需要带如下编译参数 -rdynamic -funwind-tables -ffunction-sections 否则可能backtrace返回值为0,得不到需要的信息。