-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Parse C++ class and inheritance from Debug Info #3094
Conversation
651b120
to
c5fc189
Compare
ed523b6
to
a6d232f
Compare
d61b5dd
to
4580a6d
Compare
6316e7f
to
c45e5b1
Compare
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 was able to cause an abort with this script when it's triggered:
uprobe:./tests/testprogs/uprobe_test_cxx:cpp:uprobeFunction1 { print(args.foo) }
This change could do with some semantic analyser unit tests as well, to confirm the AST transformation occurs as expected.
Btw, I like how much simpler your method is for generating a DWARF data source - maybe we could switch the C data source across to that way in the future? |
7c69caa
to
7ee32d7
Compare
0af0130
to
5321c6c
Compare
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 only have one suggestion on functionality: it'd seem better to me to store the fields of structs in order of their offsets, even when they're inherited fields from parents.
e.g. for these types:
struct Base {
int baseMember;
};
struct Child : public Base {
int childMember;
};
Printing a Child
type would currently display:
{ .childMember = 123, .baseMember = 456 }
But should probably display this instead:
{ .baseMember = 456, .childMember = 123 }
I'm imagining that this'll be an easy fix, but feel free to open up an issue and deal with it at a later date if not.
cb95b1e
to
4821ff7
Compare
4821ff7
to
bc3cdf8
Compare
bc3cdf8
to
f9ae933
Compare
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.
Nice!
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.
LGTM, great work!
Co-authored-by: Viktor Malík <[email protected]>
Extend the Dwarf parser to make class members and parents' members accessible.
This patch handles any shape of inheritance hierarchy, but doesn't provide access to parents' shadowed members:
Multiple inheritance suffer from a similar problem: when a parent shadows the member of another parent.
Checklist
man/adoc/bpftrace.adoc
CHANGELOG.md