Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
3381c792
Commit
3381c792
authored
9 years ago
by
4ast
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #123 from iovisor/bblanco_dev
Fix recursive loop in parsing pointer to self struct
parents
0d7245dc
dfcdf0a0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
src/cc/frontends/clang/b_frontend_action.cc
src/cc/frontends/clang/b_frontend_action.cc
+4
-1
tests/cc/test_clang.py
tests/cc/test_clang.py
+21
-0
No files found.
src/cc/frontends/clang/b_frontend_action.cc
View file @
3381c792
...
...
@@ -64,6 +64,9 @@ bool BMapDeclVisitor::VisitRecordDecl(RecordDecl *D) {
result_
+=
"
\"
, ["
;
for
(
auto
F
:
D
->
getDefinition
()
->
fields
())
{
result_
+=
"["
;
if
(
F
->
getType
()
->
isPointerType
())
result_
+=
"
\"
unsigned long long
\"
"
;
else
TraverseDecl
(
F
);
if
(
F
->
isBitField
())
result_
+=
", "
+
to_string
(
F
->
getBitWidthValue
(
C
));
...
...
This diff is collapsed.
Click to expand it.
tests/cc/test_clang.py
View file @
3381c792
...
...
@@ -65,5 +65,26 @@ int foo(void *ctx) {
self
.
assertEqual
(
l
.
s
.
a
,
5
)
self
.
assertEqual
(
l
.
s
.
b
,
6
)
def
test_iosnoop
(
self
):
text
=
"""
#include <linux/blkdev.h>
#include <uapi/linux/ptrace.h>
struct key_t {
struct request *req;
};
BPF_TABLE("hash", struct key_t, u64, start, 1024);
int do_request(struct pt_regs *ctx, struct request *req) {
struct key_t key = {};
bpf_trace_printk("traced start %d
\
\
n", req->__data_len);
return 0;
}
"""
b
=
BPF
(
text
=
text
,
debug
=
0
)
fn
=
b
.
load_func
(
"do_request"
,
BPF
.
KPROBE
)
if
__name__
==
"__main__"
:
main
()
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment