| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
| |
This is useful for finding large functions with wasm-objdump.
|
|
|
|
|
| |
This field was recently added:
https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
|
|
|
| |
This is way I should have implement it the first time around
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
Tests shamelessly borrowed with light editing from test/interp.
|
|
|
|
|
| |
See: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`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}`.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Also Put `<>` around other names (functions, locals).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Also add parsing of linking metadata version.
|
|
|
|
| |
I also fixed some for/if to use braces if I noticed it. This is a
non-functional change.
|
| |
|
|
|
|
| |
Fixes issue #807.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implemented:
* Parsing `try`, `if_except`, `throw`, `rethrow`
* Validation
* Binary and text output
Still missing:
* `except_ref` for locals
* Interpreter implementation
|
| |
|
|
|
|
| |
These relocations point to function index space so we
can print the name of the function here.
|
|
|
|
|
|
| |
Also remove support for DataAlignment which was removed
from the "spec" (Linking.md) and only output DataSize
if its non-zero.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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....
|
| |
|
|
|
|
|
|
|
| |
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 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.
|
|
|
|
|
| |
Objdump should really make a best effort to display
anything its given. There are other tools that are
better suited for validation.
|
|
|
|
| |
Most classes already did this, but there were some that needed to be
fixed.
|
| |
|
| |
|
|
|
| |
See https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md#relocation-sections
|
|
|
| |
This way the names won't conflict with other headers with the same name.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
There are no functional changes.
|
|
|
|
| |
Pass string_view by value.
|
|
|
|
|
|
|
|
| |
* 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.
* Add source generated files.
* Add pod check.
|
|
|
|
|
|
|
| |
Use the virtual address (init offset) when display
the data rather that the file offset.
Show the segment size in the header.
|