-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
How to fill in Stack trace when manually capturing an exception? (Just like what happens when auto captured) #503
Comments
@Swatinem Hi it seems that you are expert in this library (by looking at the "assignee" column of issues), so could you please provide some suggestions? Thanks! |
Hi! Sorry, this slipped my radar. We currently have sentry-native/include/sentry.h Lines 373 to 380 in 1198758
but that will add the stacktrace to a new "thread" object. You can extract it from there and reuse it. |
@Swatinem Thanks! However, it seems that it does not work :( Here is my code:
use it:
(the hack is because the Android sentry processor requires thread id. so I put a dummy one. that is not the core problem) result: only have |
The stacktrace is still in the "thread" protocol object, and not part of the "exception" protocol object. Other than that, when building for android, we should automatically resolve function names on the device at least. But serverside processing will run afterwards as well. |
@Swatinem But the output of the
On the other hand, when the app is aborted, the automatically captured exception will have very nice information (function name and line) |
@Swatinem Finally I made it! I solved this problem by looking at the private method
usage:
result: things like |
Indeed, I guess the problem with my old code is the format of
so int address will be thrown away... |
Ah yes. I think the the important thing here is:
You are attaching the stacktrace to the exception record. |
Description
Hi thanks for the lib! I wonder how can I fill in the stacktrace? Currently when I report an error manually, it only has exception messages. But as we know, stack traces are very important to debug!
In addition, I do see automatic stack traces when an unexpected exception happens. Thus I guess sentry should have an api like
get_the_current_stack_trace_as_sentry_data_structures()
;)I have tried to use the following:
but then error occurs:
Ok here is my hack:
but it still does not work. now no errors, but no stacktraces.
the output of
sentry_value_to_json(event)
:but the website:
Therefore, what I want: Can we fill in Stack trace when manually capturing an exception? (Just like what happens when auto captured)? Now there is only instruction addresses - no things like function names, etc!
When does the problem happen
Environment
Steps To Reproduce
Log output
N/A
The text was updated successfully, but these errors were encountered: