diff options
| author | Michael Bebenita <[email protected]> | 2010-08-09 07:52:07 -0700 |
|---|---|---|
| committer | Michael Bebenita <[email protected]> | 2010-08-09 07:52:07 -0700 |
| commit | 30734a9a7ba8e58bf4bd4196f8abd1fd40241732 (patch) | |
| tree | fa281c9ad53c9acfa9f51e0d0b0abab41121ab64 /src/rt/rust_port.cpp | |
| parent | Added class to abstract away platform specific thread primitives. (diff) | |
| download | rust-30734a9a7ba8e58bf4bd4196f8abd1fd40241732.tar.xz rust-30734a9a7ba8e58bf4bd4196f8abd1fd40241732.zip | |
Some pretty printing in the runtime.
Diffstat (limited to 'src/rt/rust_port.cpp')
| -rw-r--r-- | src/rt/rust_port.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rt/rust_port.cpp b/src/rt/rust_port.cpp index 0a5b7ee7..bd9af6f9 100644 --- a/src/rt/rust_port.cpp +++ b/src/rt/rust_port.cpp @@ -17,6 +17,8 @@ rust_port::~rust_port() { task->log(rust_log::COMM | rust_log::MEM, "~rust_port 0x%" PRIxPTR, (uintptr_t) this); + log_state(); + // Disassociate channels from this port. while (chans.is_empty() == false) { chans.pop()->disassociate(); @@ -27,6 +29,20 @@ rust_port::~rust_port() { delete remote_channel; } +void rust_port::log_state() { + task->log(rust_log::COMM, + "rust_port: 0x%" PRIxPTR ", associated channel(s): %d", + this, chans.length()); + for (uint32_t i = 0; i < chans.length(); i++) { + rust_chan *chan = chans[i]; + task->log(rust_log::COMM, + "\tchan: 0x%" PRIxPTR ", data pending: %s, remote: %s", + chan, + !chan->buffer.is_empty() ? "yes" : "no", + chan == remote_channel ? "yes" : "no"); + } +} + // // Local Variables: // mode: C++ |