-
Notifications
You must be signed in to change notification settings - Fork 743
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
Update BPF lexer #1346
Update BPF lexer #1346
Conversation
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.
Some comments:
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
3141501
to
e6079bd
Compare
@pchaigno Thanks for adding this support and I'm sorry I didn't get it into master before cutting the v3.12.0 release :( We're about to move to a monthly release schedule for new versions of Rouge so I'm afraid there'll be a bit of a wait. The next version is scheduled to be released on 12 November. Thanks again for contributing to Rouge! |
No problem. It takes many months to update the dependencies in GitHub Pages gem anyway. |
This pull request updates the BPF lexer to support several constructs from the two main disassemblers, bpftool and objdump:
w4
syntax for registers used in 32bit ALU instructions.map[id:671]
to refer to pointer to the map with id 671.call bpf_skb_load_bytes#7684912
to refer to a call to helper bpf_skb_load_bytes.(bf)
and61 12 04 00 00 00 00 00
for the hexadecimal encoding of the opcode and instruction respectively.I'm adding basic support for the hexadecimal output (
Generic
group) so that it doesn't break highlighting. By supporting this, we make it easier for users to directly highlight the output of bpftool and objdump. I've updated the sample file with raw outputs from both bpftool and objdump.