aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-07-02 08:15:27 -0700
committerGraydon Hoare <[email protected]>2010-07-02 08:15:27 -0700
commit99be02a28d9d810d101d85f6ed552fc2754e1fd8 (patch)
treecb776bfb144b39be4637f3451f4630e36e415cf8 /src
parentWrap long lines. (diff)
downloadrust-99be02a28d9d810d101d85f6ed552fc2754e1fd8.tar.xz
rust-99be02a28d9d810d101d85f6ed552fc2754e1fd8.zip
Indent/outdent when logging dwarf at runtime.
Diffstat (limited to 'src')
-rw-r--r--src/rt/rust_crate_reader.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/rt/rust_crate_reader.cpp b/src/rt/rust_crate_reader.cpp
index 3c36729f..ece0281c 100644
--- a/src/rt/rust_crate_reader.cpp
+++ b/src/rt/rust_crate_reader.cpp
@@ -255,6 +255,7 @@ rust_crate_reader::die::die(die_reader *rdr, uintptr_t off)
if (!ab_idx) {
ab = NULL;
dom->log(rust_log::DWARF, "DIE <0x%" PRIxPTR "> (null)", off);
+ dom->get_log().outdent();
} else {
ab = rdr->abbrevs.get_abbrev(ab_idx);
dom->log(rust_log::DWARF, "DIE <0x%" PRIxPTR "> abbrev 0x%"
@@ -451,19 +452,21 @@ rust_crate_reader::die::next() const
{
rdr_sess use(rdr);
if (start_attrs()) {
- attr a;
- while (step_attr(a)) {
- I(dom, !(a.is_numeric() && a.is_string()));
- if (a.is_numeric())
- dom->log(rust_log::DWARF, " attr num: 0x%"
- PRIxPTR, a.get_num(dom));
- else if (a.is_string())
- dom->log(rust_log::DWARF, " attr str: %s",
- a.get_str(dom));
- else
- dom->log(rust_log::DWARF, " attr ??:");
- }
+ attr a;
+ while (step_attr(a)) {
+ I(dom, !(a.is_numeric() && a.is_string()));
+ if (a.is_numeric())
+ dom->log(rust_log::DWARF, " attr num: 0x%"
+ PRIxPTR, a.get_num(dom));
+ else if (a.is_string())
+ dom->log(rust_log::DWARF, " attr str: %s",
+ a.get_str(dom));
+ else
+ dom->log(rust_log::DWARF, " attr ??:");
+ }
}
+ if (has_children())
+ dom->get_log().indent();
}
return die(rdr, rdr->tell_off());
}