Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Unified Diff: courgette/disassembler_elf_32_x86.h

Issue 2462993003: [Courgette] Refactor: Add and use Instruction*Receptor classes; call ParseFile() in 2 passes. (Closed)
Patch Set: Fix comments. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « courgette/disassembler_elf_32_arm.cc ('k') | courgette/disassembler_elf_32_x86.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/disassembler_elf_32_x86.h
diff --git a/courgette/disassembler_elf_32_x86.h b/courgette/disassembler_elf_32_x86.h
index bea7d78033c8430ec06bd0ba5373e2d2992aaa7a..ee05588a3f935b872ba0feaef20300f91c126d54 100644
--- a/courgette/disassembler_elf_32_x86.h
+++ b/courgette/disassembler_elf_32_x86.h
@@ -17,6 +17,7 @@
namespace courgette {
class AssemblyProgram;
+class InstructionReceptor;
class DisassemblerElf32X86 : public DisassemblerElf32 {
public:
@@ -32,8 +33,8 @@ class DisassemblerElf32X86 : public DisassemblerElf32 {
// TypedRVA interfaces.
CheckBool ComputeRelativeTarget(const uint8_t* op_pointer) override;
- CheckBool EmitInstruction(AssemblyProgram* program,
- Label* label) override;
+ CheckBool EmitInstruction(Label* label,
+ InstructionReceptor* receptor) override;
uint16_t op_size() const override;
};
@@ -50,8 +51,8 @@ class DisassemblerElf32X86 : public DisassemblerElf32 {
CheckBool RelToRVA(Elf32_Rel rel,
RVA* result) const override WARN_UNUSED_RESULT;
CheckBool ParseRelocationSection(const Elf32_Shdr* section_header,
- AssemblyProgram* program)
- override WARN_UNUSED_RESULT;
+ InstructionReceptor* receptor) const override
+ WARN_UNUSED_RESULT;
CheckBool ParseRel32RelocsFromSection(const Elf32_Shdr* section)
override WARN_UNUSED_RESULT;
@@ -59,6 +60,7 @@ class DisassemblerElf32X86 : public DisassemblerElf32 {
std::map<RVA, int> rel32_target_rvas_;
#endif
+ private:
DISALLOW_COPY_AND_ASSIGN(DisassemblerElf32X86);
};
« no previous file with comments | « courgette/disassembler_elf_32_arm.cc ('k') | courgette/disassembler_elf_32_x86.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698