-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure to compile with clang++ (undeclared identifier '_Unwind_GetIPInfo') #2
Comments
Changing to _Unwind_GetIP(ctx) makes it work, but I guess that can make for less accurate traces. |
Yep, exactly. Basically the tricks is that a trace address is where the code should come back after a call. So what you do, is decrementing one byte from the address so it somewhat falls into the boundaries of the previous instruction, which is usually the initial call that created the new stack frame. In the case of a signal, the trace address is in fact the address of the bad instruction (for example a segfault), thus you dont want to decrement this one. _Unwind_GetIPInfo gives you just that, this extra information. I think if you declare _Unwind_GetIPInfo it will work. The function exists but is not declared in the unwind headers. Note that it is possible to use libdw to do what unwind does, but unwind already does the job, and it is somewhat a little bit more portable (it abstracts away the format of the debug info). |
I noticed this comment on HN (https://news.ycombinator.com/item?id=5381414) and did not see an Issue filed. I'm experiencing a similar issue when compiling my project (FCEUX) with clang++ and backward-cpp. I'm using "libdw" and passing "-DBACKWARD_HAS_DW=1" to the compiler. I receive the following error when compiling with clang++:
When compiling with "-DBACKWARD_HAS_BACKTRACE=1" in addition to "-DBACKWARD_HAS_DW=1", as suggested in your reply to the HN comment, everything works as per usual. In addition, when compiling with g++, the "-DBACKWARD_HAS_BACKTRACE=1" is not required and everything works as suspected.
I'm testing with Arch Linux (64 bit fwiw). If you need any additional information, feel free to let me know. Thanks again for this really great/useful open source contribution!
The text was updated successfully, but these errors were encountered: