Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bpftrace
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
bpftrace
Commits
75103640
Commit
75103640
authored
Sep 11, 2018
by
Brendan Gregg
Committed by
GitHub
Sep 11, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #80 from iovisor/bug
fix 64-bit integer constants
parents
217d6017
6d87525d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
src/ast/ast.h
src/ast/ast.h
+2
-2
src/parser.yy
src/parser.yy
+1
-1
tests/parser.cpp
tests/parser.cpp
+16
-0
No files found.
src/ast/ast.h
View file @
75103640
...
...
@@ -31,8 +31,8 @@ using ExpressionList = std::vector<Expression *>;
class
Integer
:
public
Expression
{
public:
explicit
Integer
(
int
n
)
:
n
(
n
)
{
is_literal
=
true
;
}
int
n
;
explicit
Integer
(
long
n
)
:
n
(
n
)
{
is_literal
=
true
;
}
long
n
;
void
accept
(
Visitor
&
v
)
override
;
};
...
...
src/parser.yy
View file @
75103640
...
...
@@ -78,7 +78,7 @@ void yyerror(bpftrace::Driver &driver, const char *s);
%token <std::string> STRING "string"
%token <std::string> MAP "map"
%token <std::string> VAR "variable"
%token <
int
> INT "integer"
%token <
long
> INT "integer"
%type <std::string> c_definitions
%type <ast::ProbeList *> probes
...
...
tests/parser.cpp
View file @
75103640
...
...
@@ -126,6 +126,22 @@ TEST(Parser, variable_assign)
" int: 1
\n
"
);
}
TEST
(
Parser
,
integer_sizes
)
{
test
(
"kprobe:do_nanosleep { $x = 0x12345678; }"
,
"Program
\n
"
" kprobe:do_nanosleep
\n
"
" =
\n
"
" variable: $x
\n
"
" int: 305419896
\n
"
);
test
(
"kprobe:do_nanosleep { $x = 0x4444444412345678; }"
,
"Program
\n
"
" kprobe:do_nanosleep
\n
"
" =
\n
"
" variable: $x
\n
"
" int: 4919131752149309048
\n
"
);
}
TEST
(
Parser
,
map_key
)
{
test
(
"kprobe:sys_open { @x[0] = 1; @x[0,1,2] = 1; }"
,
...
...
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