Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Commit 37336fb

Browse files
committed
feat: add erlang:debug/1 helper for printf debugging
1 parent 7c5486c commit 37336fb

File tree

1 file changed

+7
-0
lines changed
  • runtimes/tiny/src/erlang

1 file changed

+7
-0
lines changed

runtimes/tiny/src/erlang/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,13 @@ pub extern "C-unwind" fn display(term: OpaqueTerm) -> ErlangResult {
349349
ErlangResult::Ok(true.into())
350350
}
351351

352+
#[export_name = "erlang:debug/1"]
353+
pub extern "C-unwind" fn debug(term: OpaqueTerm) -> ErlangResult {
354+
let term: Term = term.into();
355+
println!("{:?}", &term);
356+
ErlangResult::Ok(true.into())
357+
}
358+
352359
#[allow(improper_ctypes_definitions)]
353360
#[export_name = "erlang:display_nl/0"]
354361
pub extern "C-unwind" fn display_nl() -> ErlangResult {

0 commit comments

Comments
 (0)