Commit d014a293 authored by 4ast's avatar 4ast

Merge pull request #197 from iovisor/bblanco_dev

Fix breakage in bpf_probe_read from #196
parents 78823a8e 0ac26e8b
......@@ -277,7 +277,7 @@ bool BTypeVisitor::VisitMemberExpr(MemberExpr *E) {
string base_type = Ref->getType()->getPointeeType().getAsString();
string pre, post;
pre = "({ " + E->getType().getAsString() + " _val; memset(&_val, 0, sizeof(_val));";
pre += " bpf_probe_read(&_val, sizeof(_val), ";
pre += " bpf_probe_read(&_val, sizeof(_val), (u64)";
post = " + offsetof(" + base_type + ", " + F->getName().str() + ")";
post += "); _val; })";
rewriter_.InsertText(E->getLocStart(), pre);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment