diff options
| author | Roy Frostig <[email protected]> | 2010-08-24 19:49:39 -0700 |
|---|---|---|
| committer | Roy Frostig <[email protected]> | 2010-08-24 19:49:39 -0700 |
| commit | 7ccdb883748a66122b88663139920db4f15a6920 (patch) | |
| tree | 8f9047cd531e21629df652f81592da32170a2182 /src/rt/rust_builtin.cpp | |
| parent | Add std.dbg module for inspecting rust values in memory. (diff) | |
| download | rust-7ccdb883748a66122b88663139920db4f15a6920.tar.xz rust-7ccdb883748a66122b88663139920db4f15a6920.zip | |
Add support in dbg.debug_obj for printing the obj body.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 8dd3f1a4..e8bc9fc7 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -308,7 +308,8 @@ struct rust_obj { }; extern "C" CDECL void -debug_obj(rust_task *task, type_desc *t, rust_obj *obj, size_t nmethods) +debug_obj(rust_task *task, type_desc *t, rust_obj *obj, + size_t nmethods, size_t nbytes) { task->log(rust_log::STDLIB, "debug_obj with %" PRIdPTR " methods", nmethods); @@ -318,6 +319,11 @@ debug_obj(rust_task *task, type_desc *t, rust_obj *obj, size_t nmethods) for (uintptr_t *p = obj->vtbl; p < obj->vtbl + nmethods; ++p) task->log(rust_log::STDLIB, " vtbl word: 0x%" PRIxPTR, *p); + + for (uintptr_t i = 0; i < nbytes; ++i) + task->log(rust_log::STDLIB, + " body byte %" PRIdPTR ": 0x%" PRIxPTR, + i, obj->body->data[i]); } struct rust_fn { |