Skip to content

std::rt::backtrace: Fix symbol names on Windows #17425

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

Closed
wants to merge 1 commit into from

Conversation

klutzy
Copy link
Contributor

@klutzy klutzy commented Sep 21, 2014

Fixes #17372

@alexcrichton
Copy link
Member

Does the size of the struct need to be adjusted for 64 vs 32 bit? Would it be possible to base the size off mem::size_of?

@klutzy
Copy link
Contributor Author

klutzy commented Sep 21, 2014

ULONG is 32-bit on both win32 and win64, so struct size is always 88.

// the struct size in C. the value is different to
// `size_of::<SYMBOL_INFO>() - MAX_SYM_NAME + 1` (== 81)
// due to struct alignment.
info.SizeOfStruct = 88;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks future-proof ¯_(ツ)_/¯

let align = align_of_val(&info) - 1;
info.SizeOfStruct = (size_of_val(&info) - MAX_SYM_NAME + 1 + align) & !align;

bors added a commit that referenced this pull request Sep 22, 2014
@bors bors closed this Sep 22, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Jun 23, 2024
fix: use ItemInNs::Macros to convert ModuleItem to ItemInNs

fix rust-lang#17425.

When converting `PathResolution` to `ItemInNs`, we should convert `ModuleDef::Macro` to `ItemInNs::Macros` to ensure that it can be found in `DefMap`.
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.

backtrace doesn't show symbol names on Windows
4 participants