summaryrefslogtreecommitdiff
path: root/src/binary-reader-objdump.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/binary-reader-objdump.cc')
-rw-r--r--src/binary-reader-objdump.cc231
1 files changed, 116 insertions, 115 deletions
diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc
index b79bafb7..3d4ee01a 100644
--- a/src/binary-reader-objdump.cc
+++ b/src/binary-reader-objdump.cc
@@ -36,12 +36,13 @@ class BinaryReaderObjdumpBase : public BinaryReaderNop {
size_t size,
ObjdumpOptions* options);
- virtual Result BeginModule(uint32_t version);
- virtual Result BeginSection(BinarySection section_type, Offset size);
+ Result BeginModule(uint32_t version) override;
+ Result BeginSection(BinarySection section_type, Offset size) override;
+
+ Result OnRelocCount(Index count,
+ BinarySection section_code,
+ StringSlice section_name) override;
- virtual Result OnRelocCount(Index count,
- BinarySection section_code,
- StringSlice section_name);
protected:
const char* GetFunctionName(Index index);
@@ -128,12 +129,12 @@ class BinaryReaderObjdumpPrepass : public BinaryReaderObjdumpBase {
size_t size,
ObjdumpOptions* options);
- virtual Result OnFunctionName(Index function_index,
- StringSlice function_name);
- virtual Result OnReloc(RelocType type,
- Offset offset,
- Index index,
- uint32_t addend);
+ Result OnFunctionName(Index function_index,
+ StringSlice function_name) override;
+ Result OnReloc(RelocType type,
+ Offset offset,
+ Index index,
+ uint32_t addend) override;
};
BinaryReaderObjdumpPrepass::BinaryReaderObjdumpPrepass(const uint8_t* data,
@@ -165,23 +166,23 @@ class BinaryReaderObjdumpDisassemble : public BinaryReaderObjdumpBase {
size_t size,
ObjdumpOptions* options);
- virtual Result BeginFunctionBody(Index index);
+ Result BeginFunctionBody(Index index) override;
- virtual Result OnOpcode(Opcode Opcode);
- virtual Result OnOpcodeBare();
- virtual Result OnOpcodeIndex(Index value);
- virtual Result OnOpcodeUint32(uint32_t value);
- virtual Result OnOpcodeUint32Uint32(uint32_t value, uint32_t value2);
- virtual Result OnOpcodeUint64(uint64_t value);
- virtual Result OnOpcodeF32(uint32_t value);
- virtual Result OnOpcodeF64(uint64_t value);
- virtual Result OnOpcodeBlockSig(Index num_types, Type* sig_types);
+ Result OnOpcode(Opcode Opcode) override;
+ Result OnOpcodeBare() override;
+ Result OnOpcodeIndex(Index value) override;
+ Result OnOpcodeUint32(uint32_t value) override;
+ Result OnOpcodeUint32Uint32(uint32_t value, uint32_t value2) override;
+ Result OnOpcodeUint64(uint64_t value) override;
+ Result OnOpcodeF32(uint32_t value) override;
+ Result OnOpcodeF64(uint64_t value) override;
+ Result OnOpcodeBlockSig(Index num_types, Type* sig_types) override;
- virtual Result OnBrTableExpr(Index num_targets,
- Index* target_depths,
- Index default_target_depth);
- virtual Result OnEndExpr();
- virtual Result OnEndFunc();
+ Result OnBrTableExpr(Index num_targets,
+ Index* target_depths,
+ Index default_target_depth) override;
+ Result OnEndExpr() override;
+ Result OnEndFunc() override;
private:
void LogOpcode(const uint8_t* data, size_t data_size, const char* fmt, ...);
@@ -411,95 +412,95 @@ class BinaryReaderObjdump : public BinaryReaderObjdumpBase {
size_t size,
ObjdumpOptions* options);
- virtual Result EndModule();
- virtual Result BeginSection(BinarySection section_type, Offset size);
- virtual Result BeginCustomSection(Offset size, StringSlice section_name);
-
- virtual Result OnTypeCount(Index count);
- virtual Result OnType(Index index,
- Index param_count,
- Type* param_types,
- Index result_count,
- Type* result_types);
-
- virtual Result OnImportCount(Index count);
- virtual Result OnImportFunc(Index import_index,
- StringSlice module_name,
- StringSlice field_name,
- Index func_index,
- Index sig_index);
- virtual Result OnImportTable(Index import_index,
- StringSlice module_name,
- StringSlice field_name,
- Index table_index,
- Type elem_type,
- const Limits* elem_limits);
- virtual Result OnImportMemory(Index import_index,
- StringSlice module_name,
- StringSlice field_name,
- Index memory_index,
- const Limits* page_limits);
- virtual Result OnImportGlobal(Index import_index,
- StringSlice module_name,
- StringSlice field_name,
- Index global_index,
- Type type,
- bool mutable_);
-
- virtual Result OnFunctionCount(Index count);
- virtual Result OnFunction(Index index, Index sig_index);
-
- virtual Result OnTableCount(Index count);
- virtual Result OnTable(Index index,
- Type elem_type,
- const Limits* elem_limits);
-
- virtual Result OnMemoryCount(Index count);
- virtual Result OnMemory(Index index, const Limits* limits);
-
- virtual Result OnGlobalCount(Index count);
- virtual Result BeginGlobal(Index index, Type type, bool mutable_);
-
- virtual Result OnExportCount(Index count);
- virtual Result OnExport(Index index,
- ExternalKind kind,
- Index item_index,
- StringSlice name);
-
- virtual Result OnStartFunction(Index func_index);
-
- virtual Result OnFunctionBodyCount(Index count);
-
- virtual Result OnElemSegmentCount(Index count);
- virtual Result BeginElemSegment(Index index, Index table_index);
- virtual Result OnElemSegmentFunctionIndex(Index index,
- Index func_index);
-
- virtual Result OnDataSegmentCount(Index count);
- virtual Result BeginDataSegment(Index index, Index memory_index);
- virtual Result OnDataSegmentData(Index index,
- const void* data,
- Address size);
-
- virtual Result OnFunctionName(Index function_index,
- StringSlice function_name);
- virtual Result OnLocalName(Index function_index,
- Index local_index,
- StringSlice local_name);
-
- virtual Result OnInitExprF32ConstExpr(Index index, uint32_t value);
- virtual Result OnInitExprF64ConstExpr(Index index, uint64_t value);
- virtual Result OnInitExprGetGlobalExpr(Index index, Index global_index);
- virtual Result OnInitExprI32ConstExpr(Index index, uint32_t value);
- virtual Result OnInitExprI64ConstExpr(Index index, uint64_t value);
-
- virtual Result OnRelocCount(Index count,
- BinarySection section_code,
- StringSlice section_name);
- virtual Result OnReloc(RelocType type,
- Offset offset,
- Index index,
- uint32_t addend);
+ Result EndModule() override;
+ Result BeginSection(BinarySection section_type, Offset size) override;
+ Result BeginCustomSection(Offset size, StringSlice section_name) override;
+
+ Result OnTypeCount(Index count) override;
+ Result OnType(Index index,
+ Index param_count,
+ Type* param_types,
+ Index result_count,
+ Type* result_types) override;
+
+ Result OnImportCount(Index count) override;
+ Result OnImportFunc(Index import_index,
+ StringSlice module_name,
+ StringSlice field_name,
+ Index func_index,
+ Index sig_index) override;
+ Result OnImportTable(Index import_index,
+ StringSlice module_name,
+ StringSlice field_name,
+ Index table_index,
+ Type elem_type,
+ const Limits* elem_limits) override;
+ Result OnImportMemory(Index import_index,
+ StringSlice module_name,
+ StringSlice field_name,
+ Index memory_index,
+ const Limits* page_limits) override;
+ Result OnImportGlobal(Index import_index,
+ StringSlice module_name,
+ StringSlice field_name,
+ Index global_index,
+ Type type,
+ bool mutable_) override;
+
+ Result OnFunctionCount(Index count) override;
+ Result OnFunction(Index index, Index sig_index) override;
+
+ Result OnTableCount(Index count) override;
+ Result OnTable(Index index,
+ Type elem_type,
+ const Limits* elem_limits) override;
+
+ Result OnMemoryCount(Index count) override;
+ Result OnMemory(Index index, const Limits* limits) override;
+
+ Result OnGlobalCount(Index count) override;
+ Result BeginGlobal(Index index, Type type, bool mutable_) override;
+
+ Result OnExportCount(Index count) override;
+ Result OnExport(Index index,
+ ExternalKind kind,
+ Index item_index,
+ StringSlice name) override;
+
+ Result OnStartFunction(Index func_index) override;
+
+ Result OnFunctionBodyCount(Index count) override;
+
+ Result OnElemSegmentCount(Index count) override;
+ Result BeginElemSegment(Index index, Index table_index) override;
+ Result OnElemSegmentFunctionIndex(Index index,
+ Index func_index) override;
+
+ Result OnDataSegmentCount(Index count) override;
+ Result BeginDataSegment(Index index, Index memory_index) override;
+ Result OnDataSegmentData(Index index,
+ const void* data,
+ Address size) override;
+
+ Result OnFunctionName(Index function_index,
+ StringSlice function_name) override;
+ Result OnLocalName(Index function_index,
+ Index local_index,
+ StringSlice local_name) override;
+
+ Result OnInitExprF32ConstExpr(Index index, uint32_t value) override;
+ Result OnInitExprF64ConstExpr(Index index, uint64_t value) override;
+ Result OnInitExprGetGlobalExpr(Index index, Index global_index) override;
+ Result OnInitExprI32ConstExpr(Index index, uint32_t value) override;
+ Result OnInitExprI64ConstExpr(Index index, uint64_t value) override;
+
+ Result OnRelocCount(Index count,
+ BinarySection section_code,
+ StringSlice section_name) override;
+ Result OnReloc(RelocType type,
+ Offset offset,
+ Index index,
+ uint32_t addend) override;
private:
bool ShouldPrintDetails();