提交 8d709263 编写于 作者: M Matias Romeo

Add printhex api function

上级 c56e69e0
......@@ -76,5 +76,9 @@ extern "C" {
* @endcode
*/
void printn( uint64_t name );
/**
*/
void printhex( void* data, uint32_t datalen );
/// @}
}
......@@ -481,6 +481,15 @@ DEFINE_INTRINSIC_FUNCTION1(env,prints,prints,none,i32,charptr) {
std::cerr << std::string( str, strnlen(str, wasm.current_state->mem_end-charptr) );
}
DEFINE_INTRINSIC_FUNCTION2(env,printhex,printhex,none,i32,data,i32,datalen) {
auto& wasm = wasm_interface::get();
auto mem = wasm.current_memory;
char* buff = memoryArrayPtr<char>(mem, data, datalen);
std::cerr << fc::to_hex(buff, datalen) << std::endl;
}
DEFINE_INTRINSIC_FUNCTION1(env,free,free,none,i32,ptr) {
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册