Skip to content

Commit

Permalink
luajit: add to probe group
Browse files Browse the repository at this point in the history
  • Loading branch information
dlatchx committed Jun 20, 2023
1 parent a83576a commit 93c9696
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions format/luajit/luajit.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ import (
//go:embed luajit.md
var LuaJITFS embed.FS

var probeGroup decode.Group

func init() {
interp.RegisterFormat(
format.LuaJIT,
&decode.Format{
Description: "LuaJIT 2.0 bytecode",
Groups: []*decode.Group{format.Probe},
DecodeFn: LuaJITDecode,
Dependencies: []decode.Dependency{
{Groups: []*decode.Group{format.Probe}, Out: &probeGroup},
},
})
interp.RegisterFS(LuaJITFS)
}
Expand Down
2 changes: 1 addition & 1 deletion format/luajit/testdata/simple.fqtest
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# luajit -b -g example.lua simple.luac
$ fq dv -d luajit simple.luac
$ fq dv simple.luac
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: simple.luac (luajit) 0x0-0x14e.7 (335)
| | | header{}: 0x0-0x17.7 (24)
0x000|1b 4c 4a |.LJ | magic: raw bits (valid) 0x0-0x2.7 (3)
Expand Down
2 changes: 1 addition & 1 deletion format/luajit/testdata/simple_stripped.fqtest
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# luajit -b -s example.lua simple_stripped.luac
$ fq dv -d luajit simple_stripped.luac
$ fq dv simple_stripped.luac
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: simple_stripped.luac (luajit) 0x0-0xf9.7 (250)
| | | header{}: 0x0-0x4.7 (5)
0x00|1b 4c 4a |.LJ | magic: raw bits (valid) 0x0-0x2.7 (3)
Expand Down

0 comments on commit 93c9696

Please sign in to comment.