Skip to content
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

Provide access to stack traces of arbitrary size in extended data items. #124

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

yjugl
Copy link
Contributor

@yjugl yjugl commented Mar 6, 2024

The current StackTrace32(_) and StackTrace64(_) definitions yield a value of the inner item type exposed by the windows crate. This type is autogenerated from the C definition, which uses an ANYSIZE_ARRAY (a constant defined as 1). As a side effect, a value of the autogenerated Rust type can only contain a single address from the captured call stack.

  • Define a custom type usable as StackTraceItem<u32> and StackTraceItem<u64> to represent captured call stacks of arbitrary size.

  • Make StackTrace32(_) and StackTrace64(_) yield values of this new custom type.

The current StackTrace32(_) and StackTrace64(_) definitions yield a value of the inner item type exposed by the windows crate. This type is autogenerated from the C definition, which uses an ANYSIZE_ARRAY (a constant defined as 1). As a side effect, a value of the autogenerated Rust type can only contain a single address from the captured call stack.

* Define a custom type usable as StackTraceItem<u32> and StackTraceItem<u64> to represent captured call stacks of arbitrary size.

* Make StackTrace32(_) and StackTrace64(_) yield values of this new custom type.
@yjugl
Copy link
Contributor Author

yjugl commented Mar 6, 2024

Example of using the new StackTraceItem<u64>: here

Copy link
Owner

@n4r1b n4r1b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Thanks @yjugl 🙂

@n4r1b n4r1b merged commit 8602d9c into n4r1b:master Mar 7, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants