diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/wasm-dis.cpp | 7 | ||||
-rw-r--r-- | src/tools/wasm-opt.cpp | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/tools/wasm-dis.cpp b/src/tools/wasm-dis.cpp index e8ca71528..f9f303359 100644 --- a/src/tools/wasm-dis.cpp +++ b/src/tools/wasm-dis.cpp @@ -70,7 +70,12 @@ int main(int argc, const char* argv[]) { } catch (ParseException& p) { p.dump(std::cerr); std::cerr << '\n'; - Fatal() << "error in parsing wasm binary"; + if (options.debug) { + Fatal() << "error parsing wasm. here is what we read up to the error:\n" + << wasm; + } else { + Fatal() << "error parsing wasm (try --debug for more info)"; + } } catch (MapParseException& p) { p.dump(std::cerr); std::cerr << '\n'; diff --git a/src/tools/wasm-opt.cpp b/src/tools/wasm-opt.cpp index effd085bc..8f958f164 100644 --- a/src/tools/wasm-opt.cpp +++ b/src/tools/wasm-opt.cpp @@ -279,7 +279,12 @@ int main(int argc, const char* argv[]) { } catch (ParseException& p) { p.dump(std::cerr); std::cerr << '\n'; - Fatal() << "error parsing wasm"; + if (options.debug) { + Fatal() << "error parsing wasm. here is what we read up to the error:\n" + << wasm; + } else { + Fatal() << "error parsing wasm (try --debug for more info)"; + } } catch (MapParseException& p) { p.dump(std::cerr); std::cerr << '\n'; |