diff options
| author | bors <bors@rust-lang.org> | 2013-08-09 18:41:13 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-08-09 18:41:13 -0700 |
| commit | e81e81f234731a31fad9afdc2045bef3fbdf1109 (patch) | |
| tree | f15c93f7989462a768b7c333e6dec0445c62472d /src/rt/rust_debug.h | |
| parent | 6f6dce7bbcfb104a8a1e23b0b93d83cbb770f338 (diff) | |
| parent | b75915d0ca20c6d066a7368ad53491a55a5a57d2 (diff) | |
auto merge of #8387 : brson/rust/nooldrt, r=brson
Diffstat (limited to 'src/rt/rust_debug.h')
| -rw-r--r-- | src/rt/rust_debug.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/rt/rust_debug.h b/src/rt/rust_debug.h deleted file mode 100644 index 951d2c36cb8..00000000000 --- a/src/rt/rust_debug.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Routines useful when debugging the Rust runtime. - -#ifndef RUST_DEBUG_H -#define RUST_DEBUG_H - -#include <map> -#include <string> -#include <cstdlib> - -struct rust_task; - -namespace debug { - -class flag { -private: - const char *name; - bool valid; - bool value; - -public: - flag(const char *in_name) : name(in_name), valid(false) {} - - bool operator*() { - // FIXME (#2689): We ought to lock this. - if (!valid) { - char *ev = getenv(name); - value = ev && ev[0] != '\0' && ev[0] != '0'; - valid = true; - } - return value; - } -}; - -class task_debug_info { -public: - std::map<void *,std::string> origins; -}; - -std::string backtrace(); - -void maybe_track_origin(rust_task *task, void *ptr); -void maybe_untrack_origin(rust_task *task, void *ptr); - -// This function is intended to be called by the debugger. -void dump_origin(rust_task *task, void *ptr); - -} // end namespace debug - -#endif |
