-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update wasm-tools crates to latest versions. #6394
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -832,18 +832,33 @@ fn generate_coredump(err: &anyhow::Error, source_name: &str, coredump_path: &str | |
.ok_or_else(|| anyhow!("no wasm backtrace found to generate coredump with"))?; | ||
|
||
let coredump = wasm_encoder::CoreDumpSection::new(source_name); | ||
let mut coremodules = wasm_encoder::CoreDumpModulesSection::new(); | ||
let mut stacksection = wasm_encoder::CoreDumpStackSection::new("main"); | ||
let mut modulenames = std::collections::HashSet::new(); | ||
for f in bt.frames() { | ||
modulenames.insert(f.module_name().unwrap_or("<unknown>")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I debated leaving that out, since it's essentially the same deal as instances. I'll remove it. |
||
|
||
// We don't have the information at this point to map frames to | ||
// individual instances of a module, so we won't be able to create the | ||
// "frame ∈ instance ∈ module" hierarchy described in the core dump spec | ||
// until we move core dump generation into the runtime. So for now | ||
// instanceidx will be 0 for all frames | ||
let instanceidx = 0; | ||
stacksection.frame( | ||
instanceidx, | ||
f.func_index(), | ||
u32::try_from(f.func_offset().unwrap_or(0)).unwrap(), | ||
// We don't currently have access to locals/stack values | ||
[], | ||
[], | ||
); | ||
} | ||
for name in modulenames { | ||
coremodules.module(name); | ||
} | ||
let mut module = wasm_encoder::Module::new(); | ||
module.section(&coredump); | ||
module.section(&coremodules); | ||
module.section(&stacksection); | ||
|
||
let mut f = File::create(coredump_path) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind binding this as
gc
and asserting it's false down below (likememory_control
)? We'll want to turn this on eventually and we won't want to forget to add handling here.