Skip to content

Commit

Permalink
Try #371:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] committed Apr 20, 2019
2 parents 48a8391 + 2516a1e commit 4b74e14
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All PRs to the Wasmer repository must add to this file.
Blocks of changes will separated by version increments.

## **[Unreleased]**
- [#371](https://github.com/wasmerio/wasmer/pull/371) Add more Debug impl for WASI types
- [#368](https://github.com/wasmerio/wasmer/pull/368) Fix issue with write buffering
- [#343](https://github.com/wasmerio/wasmer/pull/343) Implement preopened files for WASI and fix aligment issue when accessing WASI memory
- [#367](https://github.com/wasmerio/wasmer/pull/367) Add caching support to the LLVM backend.
Expand Down
10 changes: 8 additions & 2 deletions lib/wasi/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ macro_rules! wasi_try {
($expr:expr) => {{
let res: Result<_, crate::syscalls::types::__wasi_errno_t> = $expr;
match res {
Ok(val) => val,
Err(err) => return err,
Ok(val) => {
debug!("wasi::wasi_try::val: {:?}", val);
val
}
Err(err) => {
debug!("wasi::wasi_try::err: {:?}", err);
return err;
}
}
}};
($expr:expr; $e:expr) => {{
Expand Down
2 changes: 2 additions & 0 deletions lib/wasi/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ pub struct Fd {
pub inode: Inode,
}

#[derive(Debug)]
pub struct WasiFs {
//pub repo: Repo,
pub name_map: HashMap<String, Inode>,
Expand Down Expand Up @@ -430,6 +431,7 @@ impl WasiFs {
}
}

#[derive(Debug)]
pub struct WasiState<'a> {
pub fs: WasiFs,
pub args: &'a [Vec<u8>],
Expand Down
9 changes: 8 additions & 1 deletion lib/wasi/src/syscalls/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use crate::ptr::{Array, WasmPtr};
use byteorder::{ReadBytesExt, WriteBytesExt, LE};
use std::fmt;
use std::mem;
use wasmer_runtime_core::types::ValueType;

Expand Down Expand Up @@ -212,9 +213,15 @@ pub union __wasi_prestat_u {
dir: __wasi_prestat_u_dir_t,
}

impl fmt::Debug for __wasi_prestat_u {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "__wasi_prestat_u")
}
}

unsafe impl ValueType for __wasi_prestat_u {}

#[derive(Copy, Clone)]
#[derive(Debug, Copy, Clone)]
#[repr(C)]
pub struct __wasi_prestat_t {
pub pr_type: __wasi_preopentype_t,
Expand Down

0 comments on commit 4b74e14

Please sign in to comment.