Improved debug! in all emscripten calls

This commit is contained in:
Syrus Akbary 2018-11-28 22:02:25 -08:00
parent 1db0306b8b
commit adee7d42db
4 changed files with 11 additions and 2 deletions

View File

@ -2,7 +2,11 @@ use crate::webassembly::Instance;
use libc::c_int; use libc::c_int;
// NOTE: Not implemented by Emscripten // NOTE: Not implemented by Emscripten
pub extern "C" fn ___lock(_which: c_int, _varargs: c_int, _instance: &mut Instance) {} pub extern "C" fn ___lock(_which: c_int, _varargs: c_int, _instance: &mut Instance) {
debug!("emscripten::___lock");
}
// NOTE: Not implemented by Emscripten // NOTE: Not implemented by Emscripten
pub extern "C" fn ___unlock(_which: c_int, _varargs: c_int, _instance: &mut Instance) {} pub extern "C" fn ___unlock(_which: c_int, _varargs: c_int, _instance: &mut Instance) {
debug!("emscripten::___unlock");
}

View File

@ -16,6 +16,7 @@ pub extern "C" fn _sigaction(_signum: u32, _act: u32, _oldact: u32, _instance: &
} }
pub extern "C" fn _sigaddset(set: u32, signum: u32, instance: &mut Instance) -> i32 { pub extern "C" fn _sigaddset(set: u32, signum: u32, instance: &mut Instance) -> i32 {
debug!("emscripten::_sigaddset");
let set_addr = instance.memory_offset_addr(0, set as _) as *mut u32; let set_addr = instance.memory_offset_addr(0, set as _) as *mut u32;
unsafe { unsafe {
*set_addr |= 1 << (signum - 1); *set_addr |= 1 << (signum - 1);
@ -24,5 +25,6 @@ pub extern "C" fn _sigaddset(set: u32, signum: u32, instance: &mut Instance) ->
} }
pub extern "C" fn _sigprocmask() -> i32 { pub extern "C" fn _sigprocmask() -> i32 {
debug!("emscripten::_sigprocmask");
0 0
} }

View File

@ -626,6 +626,7 @@ pub extern "C" fn ___syscall221(
mut varargs: VarArgs, mut varargs: VarArgs,
instance: &mut Instance, instance: &mut Instance,
) -> c_int { ) -> c_int {
debug!("emscripten::___syscall221 (fcntl64)");
// fcntl64 // fcntl64
let _fd: i32 = varargs.get(instance); let _fd: i32 = varargs.get(instance);
let cmd: u32 = varargs.get(instance); let cmd: u32 = varargs.get(instance);

View File

@ -16,6 +16,7 @@ use crate::webassembly::Instance;
/// emscripten: _gettimeofday /// emscripten: _gettimeofday
pub extern "C" fn _gettimeofday(tp: c_int, tz: c_int, instance: &mut Instance) -> c_int { pub extern "C" fn _gettimeofday(tp: c_int, tz: c_int, instance: &mut Instance) -> c_int {
debug!("emscripten::_gettimeofday {} {}", tp, tz);
#[repr(C)] #[repr(C)]
struct GuestTimeVal { struct GuestTimeVal {
tv_sec: i32, tv_sec: i32,
@ -39,6 +40,7 @@ pub extern "C" fn _gettimeofday(tp: c_int, tz: c_int, instance: &mut Instance) -
/// emscripten: _clock_gettime /// emscripten: _clock_gettime
pub extern "C" fn _clock_gettime(clk_id: c_int, tp: c_int, instance: &mut Instance) -> c_int { pub extern "C" fn _clock_gettime(clk_id: c_int, tp: c_int, instance: &mut Instance) -> c_int {
debug!("emscripten::_clock_gettime {} {}", clk_id, tp);
#[repr(C)] #[repr(C)]
struct GuestTimeSpec { struct GuestTimeSpec {
tv_sec: i32, tv_sec: i32,