-
Notifications
You must be signed in to change notification settings - Fork 119
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
Integrate stack walking on Windows #57
Comments
Interesting. What would be the difference of StackWalker vs using StackWalkEx function from Windows, https://docs.microsoft.com/en-us/windows/win32/api/dbghelp/nf-dbghelp-stackwalkex?redirectedfrom=MSDN Some additional notes
|
I completely agree with your reasoning, that's what I like about TinyInst the most, its tininess :)
No, the need was to get the precise crash location. We could definitely use that information (if unwinding enabled) in the stack walker to have original return addresses without having the full map enabled.
Honestly I didn't spent much time on it. I tried once to enable it on a complex target and was getting many exception that I didn't investigate. |
Oh, I see, I thought StackWalker re-implemented the StackWalk64 behavior instead of using it. If we are integrating StackWalker, would it be possible to add it as is as a third_party library, but have a special cmake flag to actually compile it in? (the benefit of this would be to be able to integrate StackWalker patches easier in the future, if needed). Or does the StackWalker code need to be modified in order to be usable from TinyInst? |
string GetCallstack(...);
// or
list<string> GetCallstack(...); Eventually we could also extend Not sure if its better to submit a PR directly to |
I see. I think, to comment further, it would probably be good to have an idea how the code would look like (both on StackWalker and TinyInst side). If you have an in-progress patch, or something that you could share I'd be happy to take a look. You can share the in-progress diffs with me via email |
Howdy,
I managed to add stack walking for Windows using the library https://github.com/JochenKalmbach/StackWalker
Now I was thinking on doing a pull request and add that as API to TinyInst.
Something simple like a
string GetCallstack()
that one can call directly from the exception handler (e.g.OnCrashed()
) and even combine with the translate address we discussed in #56 to have proper addresses.Would make sense to have it upstreamed?
The text was updated successfully, but these errors were encountered: