-
Notifications
You must be signed in to change notification settings - Fork 246
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
analyze: emit inline annotations for debugging #1071
Merged
Merged
Conversation
This file contains 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
ahomescu
reviewed
Apr 2, 2024
fw-immunant
approved these changes
Apr 3, 2024
c2rust-analyze/src/rewrite/apply.rs
Outdated
Comment on lines
234
to
236
fn emit_orig_str(&mut self, s: &str, line: usize) -> Result<(), S::Error> { | ||
self.sink.emit_orig_str(s, line) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this fn was added then removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it at some point during development, but it wound up being unused in the end.
spernsteiner
force-pushed
the
analyze-inline-annotations
branch
from
April 3, 2024 21:35
7cb46d7
to
bac8baf
Compare
ahomescu
reviewed
Apr 3, 2024
ahomescu
approved these changes
Apr 5, 2024
Co-authored-by: Andrei Homescu <[email protected]>
spernsteiner
force-pushed
the
analyze-inline-annotations
branch
from
April 11, 2024 22:45
223cb94
to
d400925
Compare
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.
This branch adds a new
annotate
module that allows providing annotations to be attached to specific lines during rewriting, and uses it to show pointer permissions/flags inline in the rewritten code. For example:This is helpful for debugging, since it means we no longer need to cross-reference line numbers in the debug output with the source code. It's also easy to add more annotations in the future if it would be useful.