summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2021-05-25 15:32:39 -0700
committerGitHub <noreply@github.com>2021-05-25 15:32:39 -0700
commit7f31823120ba25075d783df863f6be536543f805 (patch)
tree715631368260ecda006f65c9c07433294aed26d1 /src/wasm-binary.h
parent994757a6747793effc8e4bdda13c47ab7337afb8 (diff)
downloadbinaryen-7f31823120ba25075d783df863f6be536543f805.tar.gz
binaryen-7f31823120ba25075d783df863f6be536543f805.tar.bz2
binaryen-7f31823120ba25075d783df863f6be536543f805.zip
[wasm-split] Add an option to emit only the module names (#3901)
Even when other names are stripped, it can be useful for wasm-split to preserve the module name so that the split modules can be differentiated in stack traces. Adding this option to wasm-split requires adding similar options to ModuleWriter and WasmBinaryWriter.
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r--src/wasm-binary.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index b2f681b6e..6852c42ab 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -1170,7 +1170,11 @@ public:
std::vector<Entry> functionBodies;
} tableOfContents;
- void setNamesSection(bool set) { debugInfo = set; }
+ void setNamesSection(bool set) {
+ debugInfo = set;
+ emitModuleName = set;
+ }
+ void setEmitModuleName(bool set) { emitModuleName = set; }
void setSourceMap(std::ostream* set, std::string url) {
sourceMap = set;
sourceMapUrl = url;
@@ -1265,6 +1269,13 @@ private:
std::vector<HeapType> types;
bool debugInfo = true;
+
+ // TODO: Remove `emitModuleName` in the future once there are better ways to
+ // ensure modules have meaningful names in stack traces.For example, using
+ // ObjectURLs works in FireFox, but not Chrome. See
+ // https://bugs.chromium.org/p/v8/issues/detail?id=11808.
+ bool emitModuleName = true;
+
std::ostream* sourceMap = nullptr;
std::string sourceMapUrl;
std::string symbolMap;