about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorRoy Frostig <rfrostig@mozilla.com>2010-09-06 23:24:01 -0700
committerRoy Frostig <rfrostig@mozilla.com>2010-09-06 23:24:01 -0700
commitcf62b54028ef949298fc38a815f5f0a3e1666261 (patch)
tree70eb2b82b0395e6bbebb8c83ff4c2f988c1a7d4b /src/rt/rust_builtin.cpp
parent974092c5265ac6ed500bdf277412461f092fda96 (diff)
downloadrust-cf62b54028ef949298fc38a815f5f0a3e1666261.tar.gz
rust-cf62b54028ef949298fc38a815f5f0a3e1666261.zip
Add a little pointer-cast helper to dbg.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index e8bc9fc7e76..8654e0507a8 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -340,6 +340,19 @@ debug_fn(rust_task *task, type_desc *t, rust_fn *fn)
     task->log(rust_log::STDLIB, "  closure at 0x%" PRIxPTR, fn->closure);
 }
 
+extern "C" CDECL void *
+debug_ptrcast(rust_task *task,
+              type_desc *from_ty,
+              type_desc *to_ty,
+              void *ptr)
+{
+    task->log(rust_log::STDLIB, "debug_ptrcast from");
+    debug_tydesc_helper(task, from_ty);
+    task->log(rust_log::STDLIB, "to");
+    debug_tydesc_helper(task, to_ty);
+    return ptr;
+}
+
 
 //
 // Local Variables: