diff options
author | Sam Clegg <sbc@chromium.org> | 2018-03-16 12:31:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-16 12:31:09 -0700 |
commit | 142553c3be3d0c5161060ef784d0573c53af63c1 (patch) | |
tree | 246b5fee9ef16c456d95df70bcb968ec1c0f5156 /src | |
parent | 130e929db7d2b786ab9925bc09448e470c566139 (diff) | |
download | wabt-142553c3be3d0c5161060ef784d0573c53af63c1.tar.gz wabt-142553c3be3d0c5161060ef784d0573c53af63c1.tar.bz2 wabt-142553c3be3d0c5161060ef784d0573c53af63c1.zip |
objdump: Report elem count for each elem segment (#812)
Diffstat (limited to 'src')
-rw-r--r-- | src/binary-reader-objdump.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc index a320b93d..44ffd4cb 100644 --- a/src/binary-reader-objdump.cc +++ b/src/binary-reader-objdump.cc @@ -647,6 +647,7 @@ class BinaryReaderObjdump : public BinaryReaderObjdumpBase { Result OnElemSegmentCount(Index count) override; Result BeginElemSegment(Index index, Index table_index) override; + Result OnElemSegmentFunctionIndexCount(Index index, Index count) override; Result OnElemSegmentFunctionIndex(Index segment_index, Index func_index) override; @@ -722,6 +723,7 @@ class BinaryReaderObjdump : public BinaryReaderObjdumpBase { std::unique_ptr<FileStream> out_stream_; Index elem_index_ = 0; + Index table_index_ = 0; Index next_data_reloc_ = 0; bool in_data_section_ = false; InitExpr data_init_expr_; @@ -1033,12 +1035,19 @@ Result BinaryReaderObjdump::OnElemSegmentCount(Index count) { } Result BinaryReaderObjdump::BeginElemSegment(Index index, Index table_index) { - PrintDetails(" - segment[%" PRIindex "] table=%" PRIindex "\n", index, - table_index); + table_index_ = table_index; elem_index_ = 0; return Result::Ok; } +Result BinaryReaderObjdump::OnElemSegmentFunctionIndexCount(Index index, + Index count) { + PrintDetails(" - segment[%" PRIindex "] table=%" PRIindex " count=%" PRIindex + "\n", + index, table_index_, count); + return Result::Ok; +} + Result BinaryReaderObjdump::OnGlobalCount(Index count) { return OnCount(count); } |