summaryrefslogtreecommitdiff
path: root/src/binary-reader-objdump.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Pass function body size in BinaryReader callback (#975)Ben Smith2018-12-121-3/+10
| | | This is useful for finding large functions with wasm-objdump.
* Add needed_dynlibs to dylink section (#974)Sam Clegg2018-12-121-0/+14
| | | | | This field was recently added: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
* wasm-objdump: Cleanup hanlding of global names from #960 (#963)Sam Clegg2018-11-291-12/+4
| | | This is way I should have implement it the first time around
* wasm-objdump: Print name of global when disassembly get/set_global (#960)Sam Clegg2018-11-291-1/+16
|
* Fix wasm-objdump binary opcode output (#958)Ben Smith2018-11-191-60/+70
| | | | | | | | | | | | | | | | | | | | Some instructions have very long encodings (longer than 9 bytes). For those instructions, it is nice to write out all the bytes for that instruction and their immediates. This used to be truncated, and misaligned: ``` 0002f1: fd 02 01 00 00 00 02 00 00 00 03 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004 ``` Now it is wrapped: ``` 0002f0: fd 02 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004 0002f9: 00 03 00 00 00 04 00 00 00 | ``` The instruction offset was also incorrect before for instructions with a prefix, and is now fixed.
* Support for SIMD instructions in wasm-objdump (#957)Thomas Lively2018-11-191-0/+8
| | | Tests shamelessly borrowed with light editing from test/interp.
* Add support for dylink section (#955)Sam Clegg2018-11-141-0/+16
| | | | | See: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
* Add bulk memory opcode definitions (#927)Alex Crichton2018-10-121-4/+4
| | | | | | | | | | | | This commit starts to add support in wabt's various tools for the upcoming [bulk memory proposal][1]. This is based off the current proposal's overview, although these may get tweaked over time! This is also the first time I've significantly contributed to wabt, and what I thought would be a relatively simple addition ended up being much larger than I imagined! I didn't add many negative tests yet but if more tests are desired please let me know! [1]: https://github.com/webassembly/bulk-memory-operations
* Replace ErrorHandler with Errors and FormatErrors*Ben Smith2018-09-041-3/+2
| | | | | | | | | | | | | `ErrorHandler` complicated all error handling in wabt, since it was callback-based. Callbacks would be useful if we ever wanted to change behavior when an error occurred, but instead all that the handler ever did was write the errors to stdout/stderr or to a buffer. This change adds a new class `Error`, which contains an `ErrorLevel`, a `Location` and an error message. It also replaces ErrorHandler with `Errors` (a typedef for `std::vector<Error>`), and adds a couple of functions that can format a list of `Errors` for output: `FormatErrorsTo{String,File}`.
* [objdump] Display element count in section details (#899)Sam Clegg2018-08-271-3/+9
|
* Pass Option structs by const reference (#888)Ben Smith2018-08-071-3/+3
|
* Add support for multi-value proposal (#861)Ben Smith2018-06-141-13/+22
| | | | | | | | | | | | | | | Use the `--enable-multi-value` flag to enable. A lot of code already "worked" with multi-value, and just needed to remove the restrictions. Most of the other changes are modifying the callback APIs to be more general, e.g. taking more than 1 result type. * Types are now stored as the negative values; this works nicely with the encoding of inline function types (used for block signatures), which are always positive values. * Remove `BlockSignature` and use `BlockDeclaration` instead, which is just a typedef to `FuncSignature`. This allows for explicit or implicit type specifications on the block signatures. * Allow for >1 "keep" values in the DropKeep interpreter instruction
* [objdump] Include elem segment offset when printing table elements (#851)Sam Clegg2018-06-041-52/+60
|
* Add support for new relocation types used in DWARF sections (#846)Sam Clegg2018-05-291-3/+49
|
* Remove old sub-sections types from linking section (#840)Sam Clegg2018-05-171-12/+0
|
* Print "warning" for ignored custom section errors (#843)Ben Smith2018-05-161-2/+3
| | | | | | | The previous message said "error", which makes it look like the output is not created, so change the message to "warning" instead. The error handling code is pretty ugly and can use a refactor, but that would be a much larger change.
* wasm-objdump: Clearly distinguish undefined symbols in symbol table (#839)Sam Clegg2018-05-141-8/+7
|
* Display module name in wasm-objdump (#834)Ben Smith2018-05-081-3/+19
| | | | Also Put `<>` around other names (functions, locals).
* Add flag to ignore errors in custom sections (#833)Ben Smith2018-05-071-1/+2
| | | | | | | | | | | | | If a wasm engine fails to parse a custom section, it must not be an error. In wabt we often won't want to continue if a custom section can't be parsed, but it still may be useful to be able to continue. This change adds a new flag `--ignore-custom-section-errors` to `wasm2wat` and `wasm-validate`, which will partially parse a custom section with errors. This could lead to some strange behavior (partially completed data structures), but generally should be safe to do. See issue #378 and the discussion on pull #830 for more info.
* Refer to target section by index in relocation section (#830)Sam Clegg2018-05-031-15/+11
| | | | Also add parsing of linking metadata version.
* Run clang-format over all the files (#814)Ben Smith2018-03-161-6/+5
| | | | I also fixed some for/if to use braces if I noticed it. This is a non-functional change.
* objdump: Report elem count for each elem segment (#812)Sam Clegg2018-03-161-2/+11
|
* Print locals in objdump disassembly (#808)Ben Smith2018-03-151-0/+39
| | | | Fixes issue #807.
* Improve output for object of symbol table (#800)Sam Clegg2018-03-081-7/+12
|
* Generate symbol table when creating relocations in binary-writer.cc (#794)Sam Clegg2018-03-061-18/+75
|
* objdump: Use the export name for a function if one exists (#796)Sam Clegg2018-03-061-1/+11
|
* Add support for new symbol table format (#769)Sam Clegg2018-03-051-19/+124
|
* WIP on support for level1 exception spec (#773)Ben Smith2018-03-021-1/+17
| | | | | | | | | | | | Implemented: * Parsing `try`, `if_except`, `throw`, `rethrow` * Validation * Binary and text output Still missing: * `except_ref` for locals * Interpreter implementation
* Use GetTypeName in binary-reader-objdump.cc (#775)Ben Smith2018-02-271-28/+5
|
* Print symbol names when dumping table relocations (#731)Sam Clegg2018-01-231-0/+2
| | | | These relocations point to function index space so we can print the name of the function here.
* Add support for init function in linking metadata (#699)Sam Clegg2018-01-021-6/+14
| | | | | | Also remove support for DataAlignment which was removed from the "spec" (Linking.md) and only output DataSize if its non-zero.
* Wabt simd v128.const instruction PR (Part 2): (#702)lizhengxing2017-12-191-1/+19
| | | | | This is a sequential PR of Wabt simd v128.const instruction initial PR (096f7ab84749b5725a5780671111434c34cc17ea) The PR implement wasm interp, objdump and validate functions for v128.const.
* Wabt simd v128.const instruction initial PR: (#677)lizhengxing2017-12-151-0/+7
| | | | | | | | | | | | | This is an initial PR for Wabt simd support. This PR only implement the v128.const instruction. It will construct a simd 128-bits const. The expected wat format is: v128.const i32 0x00000000 0x11111111 0x22222222 0x33333333 For simplify, this PR only implement the wat2wasm and wasm2wat functions. The following PRs will implement the full functions in Wabt. such as: Interp, objdump, logging, etc....
* [cleanup] Always use braces with if (#691)Ben Smith2017-12-091-26/+48
|
* wat2wasm: Always write output to a file (#682)Sam Clegg2017-12-021-14/+4
| | | | | | | This involves deriving the output filename from the input filename when none is otherwise specified. Also split out filename handling utilities and add unittests for them.
* [wasm-objdump] Improve support for displaying imports (#666)Sam Clegg2017-11-031-8/+14
|
* wasm-objdump: Add support for data segment info (#656)Sam Clegg2017-10-171-0/+19
|
* [wasm-objdump] Continue reading sections on error (#636)Ben Smith2017-09-261-1/+13
| | | | | | | | | | | | | | | wasm-objdump wants to always try to read as much of the binary as possible. This change adds a new BinaryReader option called stop_on_first_error which can be set to false to enable this behavior. Currently this will bail on any error in a section, but will try to read the next section. We may expand the error-handling behavior to try and recover inside of a section as well, but it's probably best to keep it simple for now. Because wasm-objdump does multiple passes over the binary, the errors would normally be displayed multiple times. We also add a OnError override which will suppress the error message for all passes other than the first.
* Enable all reader features in objdump (#628)Sam Clegg2017-09-141-4/+3
| | | | | Objdump should really make a best effort to display anything its given. There are other tools that are better suited for validation.
* Append trailing underscore on private member names (#615)Ben Smith2017-09-071-76/+75
| | | | Most classes already did this, but there were some that needed to be fixed.
* Add support data-size and alignment linking metadata (#555)Sam Clegg2017-09-011-0/+12
|
* Add more support for symbol types in linking section (#604)Sam Clegg2017-09-011-2/+16
|
* Update relocation names to match tool convention doc (#603)Ben Smith2017-08-311-3/+3
| | | See https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md#relocation-sections
* Always include quoted headers like "src/foo.h" (#601)Ben Smith2017-08-301-3/+3
| | | This way the names won't conflict with other headers with the same name.
* Add saturating float truncation operators (#573)Ben Smith2017-08-161-6/+9
| | | | | | | | | | | | Add saturating truncation operators as described here: https://github.com/webassembly/nontrapping-float-to-int-conversions. This change also codifies the mechanism for enabling new WebAssembly features by passing the `Features` object. Opcode now has a `IsEnabled(const Features&)` member function to query if the opcode is enabled. This means that the `--future-exceptions` flag has been renamed to `--enable-exceptions` for consistency. Checking whether the feature is enabled always happens at input; either WastParser or BinaryReader.
* Rename snake_case to MixedCase. (#579)Ben Smith2017-07-191-22/+21
| | | | There are no functional changes.
* Use string_view for all BinaryReader callbacks (#561)Ben Smith2017-07-101-67/+66
| | | | Pass string_view by value.
* Adds the concept of exceptions to wasm-objdump (#547)KarlSchimpf2017-07-031-2/+56
| | | | | | | | * Allow wasm-objdump to handle exceptions. * Fix writing exception section. * Make wasm-objdump handle exceptions, and add tests.
* Remove WABT_ZERO_MEMORY WABT_FAILED and WABT_SUCCEEDED macros. (#540)KarlSchimpf2017-06-281-1/+1
| | | | | | | | * Remove WABT_ZERO_MEMORY WABT_FAILED and WABT_SUCCEEDED macros. * Add source generated files. * Add pod check.
* Improve display of data segments (#520)Sam Clegg2017-06-231-42/+183
| | | | | | | Use the virtual address (init offset) when display the data rather that the file offset. Show the segment size in the header.