diff options
Diffstat (limited to 'src/binary-reader-objdump.cc')
-rw-r--r-- | src/binary-reader-objdump.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc index 0377ec50..cec37772 100644 --- a/src/binary-reader-objdump.cc +++ b/src/binary-reader-objdump.cc @@ -831,9 +831,13 @@ Result BinaryReaderObjdump::BeginSection(BinarySection section_code, name, state->offset, state->offset + size, size); break; case ObjdumpMode::Details: - if (section_match) { - if (section_code != BinarySection::Code) { - printf("%s:\n", name); + if (section_match && section_code != BinarySection::Code) { + printf("%s", name); + // All known section types except the start section have a count + // in which case this line gets completed in OnCount(). + if (section_code == BinarySection::Start || + section_code == BinarySection::Custom) { + printf(":\n"); } print_details_ = true; } else { @@ -875,6 +879,8 @@ void WABT_PRINTF_FORMAT(2, 3) BinaryReaderObjdump::PrintDetails(const char* fmt, Result BinaryReaderObjdump::OnCount(Index count) { if (options_->mode == ObjdumpMode::Headers) { printf("count: %" PRIindex "\n", count); + } else if (options_->mode == ObjdumpMode::Details && print_details_) { + printf("[%" PRIindex "]:\n", count); } return Result::Ok; } |