Skip to content

Commit 1ea5e52

Browse files
committed
parse linux system calls definitions
fixes #222
1 parent 00f52df commit 1ea5e52

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

script.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ parse_defs_C()
171171

172172
# Parse function macros, e.g., in .S files
173173
perl -ne '/^\s*ENTRY\((\w+)\)/ and print "$1 function $.\n"' "$full_path"
174+
perl -ne '/^SYSCALL_DEFINE[0-9]\(\s*(\w+)\W/ and print "sys_$1 function $.\n"' "$full_path"
174175

175176
rm "$full_path"
176177
rmdir $tmp

t/100-basic.t

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ run_produces_ok('ident query (ENTRY that should not be detected, #150)',
122122
],
123123
MUST_SUCCEED);
124124

125+
run_produces_ok('ident query (existent, #228)',
126+
[$query_py, qw(v5.4 ident sys_init_module C)],
127+
[qr{^Symbol Definitions:}, qr{^Symbol References:},
128+
{ def => qr{syscall_define\.c.+\b1\b.+\bfunction\b} }
129+
],
130+
MUST_SUCCEED);
131+
125132
# Spot-check some files
126133

127134
run_produces_ok('file query (nonexistent)',

t/tree/syscall_define.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SYSCALL_DEFINE3(init_module)
2+
{
3+
}

0 commit comments

Comments
 (0)