add details when calling unimplemented!

This commit is contained in:
Patrick Ventuzelo
2019-10-03 11:26:54 +02:00
parent c8e9530805
commit 4b3880c88b
14 changed files with 54 additions and 51 deletions

View File

@ -279,7 +279,7 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
ir::types::I64 => pos.ins().call(i64_print, &[vmctx, param]),
ir::types::F32 => pos.ins().call(f32_print, &[vmctx, param]),
ir::types::F64 => pos.ins().call(f64_print, &[vmctx, param]),
_ => unimplemented!(),
_ => unimplemented!("unimplemented type {}", param),
};
}

View File

@ -105,7 +105,7 @@ impl binemit::RelocSink for RelocSink {
_ebb_offset: binemit::CodeOffset,
) {
// This should use the `offsets` field of `ir::Function`.
unimplemented!();
unimplemented!("RelocSink::reloc_ebb");
}
fn reloc_external(
&mut self,
@ -146,7 +146,7 @@ impl binemit::RelocSink for RelocSink {
DYNAMIC_MEM_GROW => VmCallKind::DynamicMemoryGrow,
DYNAMIC_MEM_SIZE => VmCallKind::DynamicMemorySize,
_ => unimplemented!(),
_ => unimplemented!("reloc_external VmCall::Local {}", index),
})),
IMPORT_NAMESPACE => RelocationType::VmCall(VmCall::Import(match index {
STATIC_MEM_GROW => VmCallKind::StaticMemoryGrow,
@ -157,10 +157,10 @@ impl binemit::RelocSink for RelocSink {
DYNAMIC_MEM_GROW => VmCallKind::DynamicMemoryGrow,
DYNAMIC_MEM_SIZE => VmCallKind::DynamicMemorySize,
_ => unimplemented!(),
_ => unimplemented!("reloc_external VmCall::Import {}", index),
})),
SIG_NAMESPACE => RelocationType::Signature(SigIndex::new(index as usize)),
_ => unimplemented!(),
_ => unimplemented!("reloc_external SigIndex {}", index),
};
self.external_relocs.push(ExternalRelocation {
reloc,
@ -204,7 +204,7 @@ impl binemit::RelocSink for RelocSink {
}
fn reloc_constant(&mut self, _: u32, _: cranelift_codegen::binemit::Reloc, _: u32) {
unimplemented!()
unimplemented!("RelocSink::reloc_constant")
}
fn reloc_jt(
@ -213,7 +213,7 @@ impl binemit::RelocSink for RelocSink {
_reloc: binemit::Reloc,
_jt: ir::JumpTable,
) {
unimplemented!();
unimplemented!("RelocSink::reloc_jt");
}
}

View File

@ -98,7 +98,10 @@ pub fn call_protected<T>(
},
Ok(SIGSEGV) | Ok(SIGBUS) => WasmTrapInfo::MemoryOutOfBounds,
Ok(SIGFPE) => WasmTrapInfo::IllegalArithmetic,
_ => unimplemented!(),
_ => unimplemented!(
"WasmTrapInfo::Unknown signal:{}",
Signal::from_c_int(signum)
),
}))
} else {
let signal = match Signal::from_c_int(signum) {

View File

@ -110,5 +110,5 @@ pub fn call_protected(
pub unsafe fn trigger_trap() -> ! {
// TODO
unimplemented!();
unimplemented!("windows::trigger_trap");
}

View File

@ -22,7 +22,7 @@ impl RelocSink for NullRelocSink {
fn reloc_external(&mut self, _: u32, _: Reloc, _: &ir::ExternalName, _: i64) {}
fn reloc_constant(&mut self, _: u32, _: Reloc, _: u32) {
unimplemented!()
unimplemented!("RelocSink::reloc_constant")
}
fn reloc_jt(&mut self, _: u32, _: Reloc, _: ir::JumpTable) {}

View File

@ -10,22 +10,22 @@ pub fn ___cxa_allocate_exception(ctx: &mut Ctx, size: u32) -> u32 {
pub fn ___cxa_current_primary_exception(_ctx: &mut Ctx) -> u32 {
debug!("emscripten::___cxa_current_primary_exception");
unimplemented!()
unimplemented!("emscripten::___cxa_current_primary_exception")
}
pub fn ___cxa_decrement_exception_refcount(_ctx: &mut Ctx, _a: u32) {
debug!("emscripten::___cxa_decrement_exception_refcount({})", _a);
unimplemented!()
unimplemented!("emscripten::___cxa_decrement_exception_refcount({})", _a)
}
pub fn ___cxa_increment_exception_refcount(_ctx: &mut Ctx, _a: u32) {
debug!("emscripten::___cxa_increment_exception_refcount({})", _a);
unimplemented!()
unimplemented!("emscripten::___cxa_increment_exception_refcount({})", _a)
}
pub fn ___cxa_rethrow_primary_exception(_ctx: &mut Ctx, _a: u32) {
debug!("emscripten::___cxa_rethrow_primary_exception({})", _a);
unimplemented!()
unimplemented!("emscripten::___cxa_rethrow_primary_exception({})", _a)
}
/// emscripten: ___cxa_throw

View File

@ -15,13 +15,13 @@ use wasmer_runtime_core::vm::Ctx;
/// getprotobyname
pub fn getprotobyname(_ctx: &mut Ctx, _name_ptr: i32) -> i32 {
debug!("emscripten::getprotobyname");
unimplemented!()
unimplemented!("emscripten::getprotobyname")
}
/// getprotobynumber
pub fn getprotobynumber(_ctx: &mut Ctx, _one: i32) -> i32 {
debug!("emscripten::getprotobynumber");
unimplemented!()
unimplemented!("emscripten::getprotobynumber")
}
/// sigdelset
@ -53,11 +53,11 @@ pub fn sigfillset(ctx: &mut Ctx, set: i32) -> i32 {
/// tzset
pub fn tzset(_ctx: &mut Ctx) {
debug!("emscripten::tzset - stub");
//unimplemented!()
//unimplemented!("emscripten::tzset - stub")
}
/// strptime
pub fn strptime(_ctx: &mut Ctx, _one: i32, _two: i32, _three: i32) -> i32 {
debug!("emscripten::strptime");
unimplemented!()
unimplemented!("emscripten::strptime")
}

View File

@ -36,11 +36,11 @@ pub fn printf(_ctx: &mut Ctx, memory_offset: i32, extra: i32) -> i32 {
/// chroot
pub fn chroot(_ctx: &mut Ctx, _name_ptr: i32) -> i32 {
debug!("emscripten::chroot");
unimplemented!()
unimplemented!("emscripten::chroot")
}
/// getpwuid
pub fn getpwuid(_ctx: &mut Ctx, _uid: i32) -> i32 {
debug!("emscripten::getpwuid");
unimplemented!()
unimplemented!("emscripten::getpwuid")
}

View File

@ -259,7 +259,7 @@ pub fn ___syscall194(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
ftruncate64(_fd, _length)
}
#[cfg(target_os = "macos")]
unimplemented!()
unimplemented!("emscripten::___syscall194 (ftruncate64) {}", _which)
}
/// lchown
@ -1111,6 +1111,6 @@ pub fn ___syscall324(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
}
#[cfg(target_os = "macos")]
{
unimplemented!()
unimplemented!("emscripten::___syscall324 (fallocate) {}", _which)
}
}

View File

@ -66,13 +66,13 @@ pub fn ___syscall5(ctx: &mut Ctx, which: c_int, mut varargs: VarArgs) -> c_int {
/// link
pub fn ___syscall9(_ctx: &mut Ctx, _which: c_int, mut _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall9 (link) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall9 (link) {}", _which);
}
/// ftruncate64
pub fn ___syscall194(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
debug!("emscripten::___syscall194 - stub");
unimplemented!()
unimplemented!("emscripten::___syscall194 - stub")
}
// chown
@ -86,13 +86,13 @@ pub fn ___syscall212(_ctx: &mut Ctx, which: c_int, mut _varargs: VarArgs) -> c_i
/// access
pub fn ___syscall33(_ctx: &mut Ctx, _which: c_int, mut _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall33 (access) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall33 (access) {}", _which);
}
/// nice
pub fn ___syscall34(_ctx: &mut Ctx, _which: c_int, mut _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall34 (nice) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall34 (nice) {}", _which);
}
// mkdir
@ -113,19 +113,19 @@ pub fn ___syscall39(ctx: &mut Ctx, which: c_int, mut varargs: VarArgs) -> c_int
/// dup
pub fn ___syscall41(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall41 (dup) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall41 (dup) {}", _which);
}
/// getrusage
pub fn ___syscall77(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall77 (getrusage) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall77 (getrusage) {}", _which);
}
/// symlink
pub fn ___syscall83(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall83 (symlink) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall83 (symlink) {}", _which);
}
/// readlink
@ -143,38 +143,38 @@ pub fn ___syscall132(_ctx: &mut Ctx, _which: c_int, mut _varargs: VarArgs) -> c_
/// lchown
pub fn ___syscall198(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall198 (lchown) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall198 (lchown) {}", _which);
}
/// getgid32
pub fn ___syscall200(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
debug!("emscripten::___syscall200 (getgid32)");
unimplemented!();
unimplemented!("emscripten::___syscall200 (getgid32)");
}
// geteuid32
pub fn ___syscall201(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
debug!("emscripten::___syscall201 (geteuid32)");
unimplemented!();
unimplemented!("emscripten::___syscall201 (geteuid32)");
}
// getegid32
pub fn ___syscall202(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
// gid_t
debug!("emscripten::___syscall202 (getegid32)");
unimplemented!();
unimplemented!("emscripten::___syscall202 (getegid32)");
}
/// getgroups
pub fn ___syscall205(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall205 (getgroups) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall205 (getgroups) {}", _which);
}
/// madvise
pub fn ___syscall219(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall212 (chown) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall212 (chown) {}", _which);
}
/// dup3
@ -194,7 +194,7 @@ pub fn ___syscall54(_ctx: &mut Ctx, which: c_int, mut _varargs: VarArgs) -> c_in
/// fchmod
pub fn ___syscall94(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall118 (fchmod) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall118 (fchmod) {}", _which);
}
// socketcall
@ -209,7 +209,7 @@ pub fn ___syscall102(_ctx: &mut Ctx, which: c_int, mut _varargs: VarArgs) -> c_i
/// fsync
pub fn ___syscall118(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall118 (fsync) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall118 (fsync) {}", _which);
}
// pread
@ -247,7 +247,7 @@ pub fn ___syscall142(_ctx: &mut Ctx, which: c_int, mut _varargs: VarArgs) -> c_i
/// fdatasync
pub fn ___syscall148(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall148 (fdatasync) {}", _which);
unimplemented!();
unimplemented!("emscripten::___syscall148 (fdatasync) {}", _which);
}
// setpgid
@ -300,11 +300,11 @@ pub fn ___syscall221(_ctx: &mut Ctx, _which: c_int, mut _varargs: VarArgs) -> c_
/// fchown
pub fn ___syscall207(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall207 (fchown) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall207 (fchown) {}", _which)
}
/// fallocate
pub fn ___syscall324(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall324 (fallocate) {}", _which);
unimplemented!()
unimplemented!("emscripten::___syscall324 (fallocate) {}", _which)
}

View File

@ -22,11 +22,11 @@ pub trait Instance {
type Error: Debug;
fn call(&mut self, id: usize, args: &[Value]) -> Result<u128, Self::Error>;
fn read_memory(&mut self, _offset: u32, _len: u32) -> Result<Vec<u8>, Self::Error> {
unimplemented!()
unimplemented!("Instance::read_memory")
}
fn write_memory(&mut self, _offset: u32, _len: u32, _buf: &[u8]) -> Result<(), Self::Error> {
unimplemented!()
unimplemented!("Instance::write_memory")
}
}
@ -122,15 +122,15 @@ unsafe impl Sync for CodeMemory {}
#[cfg(not(unix))]
impl CodeMemory {
pub fn new(_size: usize) -> CodeMemory {
unimplemented!();
unimplemented!("CodeMemory::new");
}
pub fn make_executable(&self) {
unimplemented!();
unimplemented!("CodeMemory::make_executable");
}
pub fn make_writable(&self) {
unimplemented!();
unimplemented!("CodeMemory::make_writable");
}
}

View File

@ -916,15 +916,15 @@ mod vm_ctx_tests {
}
fn get_trampoline(&self, _module: &ModuleInfo, _sig_index: SigIndex) -> Option<Wasm> {
unimplemented!()
unimplemented!("generate_module::get_trampoline")
}
unsafe fn do_early_trap(&self, _: Box<dyn Any>) -> ! {
unimplemented!()
unimplemented!("generate_module::do_early_trap")
}
}
impl CacheGen for Placeholder {
fn generate_cache(&self) -> Result<(Box<[u8]>, Memory), CacheError> {
unimplemented!()
unimplemented!("generate_module::generate_cache")
}
}

View File

@ -150,11 +150,11 @@ pub unsafe extern "C" fn local_table_grow(
let _ = table_index;
let _ = delta;
let _ = ctx;
unimplemented!()
unimplemented!("vmcalls::local_table_grow")
}
pub unsafe extern "C" fn local_table_size(ctx: &vm::Ctx, table_index: LocalTableIndex) -> u32 {
let _ = table_index;
let _ = ctx;
unimplemented!()
unimplemented!("vmcalls::local_table_size")
}

View File

@ -793,7 +793,7 @@ impl WasiFs {
}
// TODO: verify this behavior
Kind::Dir { .. } => return Err(__WASI_EISDIR),
Kind::Symlink { .. } => unimplemented!(),
Kind::Symlink { .. } => unimplemented!("WasiFs::flush Kind::Symlink"),
Kind::Buffer { .. } => (),
_ => return Err(__WASI_EIO),
}