jeremy-rifkin / cpptrace

Simple, portable, and self-contained stacktrace library for C++11 and newer
MIT License
621 stars 64 forks source link

compile Release: Cpptrace internal error: Libbacktrace error:no debug info in ELF executable, code: -1 #114

Closed Eternity1987 closed 4 months ago

Eternity1987 commented 4 months ago

Cpptrace internal error: Libbacktrace error:no debug info in ELF executable, code: -1

jeremy-rifkin commented 4 months ago

Hi, this might be a simple issue of silently continuing on this error but a little additional information would be helpful. Did you compile with debug symbols?

I’ll also mention that the libbacktrace back-end is not recommended unless you have a good reason for using libbacktrace :)

jeremy-rifkin commented 4 months ago

I haven't been able to reproduce locally in debug however I have fixed this on the dev branch.

Eternity1987 commented 4 months ago

I compiled the release version and not with optimization flags , and I want to obtain at least the address function name and the corresponding binary in the release version, without the need for specific file names and line numbers, but it throw exception and return null_frame, will show 0x00

Eternity1987 commented 4 months ago

Ubuntu22.04 ok image UUbuntu20.04 throw exception image

jeremy-rifkin commented 4 months ago

Thanks. I think the patch should work for your use case, though it likely won't include function names without debug symbols.

Eternity1987 commented 4 months ago

I compiled libstacktrace.a from https://github.com/ianlancetaylor/libbacktrace on Ubuntu 20.04, and everything is fine.