diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-07-15 18:37:57 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2011-07-15 18:37:57 -0700 |
| commit | 88574c3cea87bc8f789883bcd518b8a91fb1a776 (patch) | |
| tree | f2dcff20295f232fa00932383d9bfd3d3e83911d /src/rt | |
| parent | f6f7f6190809d698f39f5f3dde9a10cb28661795 (diff) | |
| download | rust-88574c3cea87bc8f789883bcd518b8a91fb1a776.tar.gz rust-88574c3cea87bc8f789883bcd518b8a91fb1a776.zip | |
rustc: Implement interior string logging in DPS
Diffstat (limited to 'src/rt')
| -rw-r--r-- | src/rt/rust_upcall.cpp | 10 | ||||
| -rw-r--r-- | src/rt/rustrt.def.in | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index b6b8fb28668..d734625fa30 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -76,6 +76,16 @@ upcall_log_str(rust_task *task, uint32_t level, rust_str *str) { } extern "C" CDECL void +upcall_log_istr(rust_task *task, uint32_t level, rust_ivec *str) { + LOG_UPCALL_ENTRY(task); + if (task->sched->log_lvl < level) + return; + const char *buf = (const char *) + (str->fill ? str->payload.data : str->payload.ptr->data); + task->sched->log(task, level, "rust: %s", buf); +} + +extern "C" CDECL void upcall_trace_word(rust_task *task, uintptr_t i) { LOG_UPCALL_ENTRY(task); task->sched->log(task, 2, "trace: 0x%" PRIxPTR "", i, i, (char) i); diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index dc94c73d813..f762f4a9be3 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -68,6 +68,7 @@ upcall_kill upcall_log_double upcall_log_float upcall_log_int +upcall_log_istr upcall_log_str upcall_malloc upcall_mark |
