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

Fix nested dereference rewrites #1835

Merged
merged 2 commits into from
Jun 17, 2018

Conversation

pchaigno
Copy link
Contributor

When the rewriter meets a dereference of a member dereference it fails to properly rewrite them into calls to bpf_probe_read. The reason is that Clang is unable to track the position of rewritten text, but we can accommodate this by inserting text around the dereference instead of completely rewriting it. We are already doing that for member dereference, but not for simple dereference.

pchaigno added 2 commits June 17, 2018 10:57
When the rewriter meets a dereference of a member dereference it
fails to properly rewrite them into calls to bpf_probe_read.  The
reason is that Clang is unable to track the position of rewritten
text, but we can accommodate this by inserting text around the
dereference instead of completely rewriting it.  We are already
doing that for member dereference, but not for simple dereference.
@pchaigno pchaigno force-pushed the nested-deref-rewrites branch from 6b1f290 to 0b4126c Compare June 17, 2018 08:57
@yonghong-song
Copy link
Collaborator

LGTM. Thanks!

@yonghong-song yonghong-song merged commit fa7508d into iovisor:master Jun 17, 2018
@pchaigno pchaigno deleted the nested-deref-rewrites branch June 17, 2018 16:34
banh-gao pushed a commit to banh-gao/bcc that referenced this pull request Jun 21, 2018
* Fix nested rewrites dereferences

When the rewriter meets a dereference of a member dereference it
fails to properly rewrite them into calls to bpf_probe_read.  The
reason is that Clang is unable to track the position of rewritten
text, but we can accommodate this by inserting text around the
dereference instead of completely rewriting it.  We are already
doing that for member dereference, but not for simple dereference.

* Test for the rewrite of nested dereferences
CrackerCat pushed a commit to CrackerCat/bcc that referenced this pull request Jul 31, 2024
* Fix nested rewrites dereferences

When the rewriter meets a dereference of a member dereference it
fails to properly rewrite them into calls to bpf_probe_read.  The
reason is that Clang is unable to track the position of rewritten
text, but we can accommodate this by inserting text around the
dereference instead of completely rewriting it.  We are already
doing that for member dereference, but not for simple dereference.

* Test for the rewrite of nested dereferences
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