From dbc00ced3a09a7a8c32d69a89b9e073252cca39d Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 24 Sep 2012 20:24:32 -0700 Subject: [PATCH] rt: Add a logging function for strings (only). This will be the shape-free replacement for upcall_log_type. --- src/rt/rust_builtin.cpp | 7 +++++++ src/rt/rustrt.def.in | 1 + 2 files changed, 8 insertions(+) diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 8829089822c..02bc86f88b6 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -950,6 +950,13 @@ rust_call_tydesc_glue(void *root, size_t *tydesc, size_t glue_index) { glue_fn(0, 0, 0, root); } +// Don't run on the Rust stack! +extern "C" void +rust_log_str(uint32_t level, const char *str) { + rust_task *task = rust_get_current_task(); + task->sched_loop->get_log().log(task, level, "%s", str); +} + // // Local Variables: // mode: C++ diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 14116394b3d..43f24f4dd4f 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -60,6 +60,7 @@ rust_get_task rust_get_stack_segment rust_task_weaken rust_task_unweaken +rust_log_str shape_log_str start_task vec_reserve_shared_actual