fix: keep semicolons inside xctrace symbols - #464
Open
tomatotomata wants to merge 1 commit into
Open
Conversation
djc
reviewed
Aug 6, 2026
| } | ||
|
|
||
| #[cfg(target_os = "macos")] | ||
| fn normalize_demangled_symbol(symbol: String) -> String { |
| } | ||
|
|
||
| #[cfg(all(test, target_os = "macos"))] | ||
| mod tests { |
Contributor
There was a problem hiding this comment.
Any tests modules should be at the bottom of the file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
xctrace folded stacks use semicolons to separate frames. Rust demangling can introduce semicolons inside array types such as
[u8; 2], so those symbols were being split into multiple frames.I was thinking of applying the same normalization already used by inferno's DTrace collapser: replace semicolons inside the demangled symbol with colons before the XML reaches the xctrace collapser. The change is limited to the macOS demangling path and includes a regression test for an array type.
Validation
cargo fmt -- --checkcargo test --all-targetsgit diff --checkThe test suite passed on Windows. I could not run the macOS-only test locally because the Apple target is not installed here.
This follows the maintainer's invitation in #462. Let me know what you think.