From 11b88d35f89bcc679b09562b566478271137d649 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Wed, 8 Aug 2018 16:17:03 +0430 Subject: faultreiber is a submodule now. it generates binary file format parsers in C. the memory management side of faultreiber is not implemented yet since im on the fence on how to do it. faultreiber along with tablegen will completely automate the process of adding new file formats to bruiser. --- bruiser/defaults.lua | 6 +- bruiser/faultreiber | 1 + bruiser/faultreibergen.sh | 5 ++ bruiser/wasmread/wasm.xml | 168 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 177 insertions(+), 3 deletions(-) create mode 160000 bruiser/faultreiber create mode 100755 bruiser/faultreibergen.sh create mode 100644 bruiser/wasmread/wasm.xml (limited to 'bruiser') diff --git a/bruiser/defaults.lua b/bruiser/defaults.lua index 8f1692b..70ecefb 100644 --- a/bruiser/defaults.lua +++ b/bruiser/defaults.lua @@ -1,7 +1,7 @@ -- bruiser default script. -- This is run everytime bruiser is called. --- By default bruiser will look for a file named defaults.lua in the same --- directory as its executable. you can change the file using the --luadefault +-- By default bruiser will look for a file named defaults.lua in the same +-- directory as its executable. you can change the file using the --luadefault -- option. -- adds luarocks' path and cpath to bruiser @@ -12,7 +12,7 @@ function default_luarocks_modules() for line in luarocks_handle:lines() do local path = string.match(line, "LUA_PATH%s*=%s*('.+')") local cpath = string.match(line, "LUA_CPATH%s*=%s*('.+')") - if path ~= nil then + if path ~= nil then package.path = package.path..";"..string.sub(path, 2, -2) end if cpath ~= nil then diff --git a/bruiser/faultreiber b/bruiser/faultreiber new file mode 160000 index 0000000..dfe00e9 --- /dev/null +++ b/bruiser/faultreiber @@ -0,0 +1 @@ +Subproject commit dfe00e935a95e48590e0e2f7525f4a23e70f3ed2 diff --git a/bruiser/faultreibergen.sh b/bruiser/faultreibergen.sh new file mode 100755 index 0000000..d95979d --- /dev/null +++ b/bruiser/faultreibergen.sh @@ -0,0 +1,5 @@ +#!/bin/sh +cd $(dirname $0) +"./faultreiber.py" --targetname autowasm --outdir ./test/ --structs ./test/struct.json --datetime --structsinclude ./resources/structsinclude.h --xml ./resources/wasm.xml +"clang-format" -i ./test/read.c ./test/structs.h ./test/aggregate.c ./test/aggregate.h ./test/read.h +#"less" ./test/structs.h diff --git a/bruiser/wasmread/wasm.xml b/bruiser/wasmread/wasm.xml new file mode 100644 index 0000000..6a9dfe9 --- /dev/null +++ b/bruiser/wasmread/wasm.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + 0 + 1 + 2 + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3