mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 06:15:33 +00:00
Improved fault debugging with emscripten
This commit is contained in:
parent
f2d9d22e94
commit
a4170d4495
@ -646,6 +646,9 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject
|
||||
"_emscripten_get_heap_size" => func!(crate::memory::_emscripten_get_heap_size),
|
||||
"_emscripten_resize_heap" => func!(crate::memory::_emscripten_resize_heap),
|
||||
"enlargeMemory" => func!(crate::memory::enlarge_memory),
|
||||
"segfault" => func!(crate::memory::segfault),
|
||||
"alignfault" => func!(crate::memory::alignfault),
|
||||
"ftfault" => func!(crate::memory::ftfault),
|
||||
"getTotalMemory" => func!(crate::memory::get_total_memory),
|
||||
"___map_file" => func!(crate::memory::___map_file),
|
||||
|
||||
|
@ -95,6 +95,24 @@ pub fn abort_on_cannot_grow_memory_old(ctx: &mut Ctx) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
/// emscripten: segfault
|
||||
pub fn segfault(ctx: &mut Ctx) {
|
||||
debug!("emscripten::segfault");
|
||||
abort_with_message(ctx, "segmentation fault");
|
||||
}
|
||||
|
||||
/// emscripten: alignfault
|
||||
pub fn alignfault(ctx: &mut Ctx) {
|
||||
debug!("emscripten::alignfault");
|
||||
abort_with_message(ctx, "alignment fault");
|
||||
}
|
||||
|
||||
/// emscripten: ftfault
|
||||
pub fn ftfault(ctx: &mut Ctx) {
|
||||
debug!("emscripten::ftfault");
|
||||
abort_with_message(ctx, "Function table mask error");
|
||||
}
|
||||
|
||||
/// emscripten: ___map_file
|
||||
pub fn ___map_file(_ctx: &mut Ctx, _one: u32, _two: u32) -> c_int {
|
||||
debug!("emscripten::___map_file");
|
||||
|
Loading…
Reference in New Issue
Block a user