From e845355d2d98a87ee0e4945b92c893b4f01986ec Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Fri, 9 Jul 2021 13:59:41 -0500 Subject: [PATCH] added code printing --- src/test_console.onyx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/test_console.onyx b/src/test_console.onyx index 3b0a60b..a3d6681 100644 --- a/src/test_console.onyx +++ b/src/test_console.onyx @@ -17,9 +17,18 @@ main :: (args: [] cstr) { wasm_sections := wasm.parse_sections(^wasm_binary, context.allocator); defer wasm.free_sections(^wasm_sections); - printf("Types:\n{p}\n", wasm_sections.type_section); - printf("Imports:\n{p}\n", wasm_sections.import_section); - printf("Exports:\n{p}\n", wasm_sections.export_section); + + i := 0; + for ^code: wasm_sections.code_section { + i += 1; + printf("Function {}\n", i); + for instr: wasm.instruction_iterator(^wasm_binary, code) { + printf("{}\n", instr); + } + print("\n"); + } + + // printf("Code:\n{}\n", wasm_sections.code_section); // type_section := wasm.parse_type_section(^wasm_binary); -- 2.25.1