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

Unified Diff: courgette/patch_generator_x86_32.h

Issue 2793153003: [Courgette] Refactor: Store Label Annotation in AssemblyProgram for patch generation. (Closed)
Patch Set: Rename *_label_annotation to *_label_annotations. Created 3 years, 8 months 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_x86_unittest.cc ('k') | courgette/program_detector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/patch_generator_x86_32.h
diff --git a/courgette/patch_generator_x86_32.h b/courgette/patch_generator_x86_32.h
index cc7c146b74bb11073c7138a03a41f1ea2667294a..0c2f9f032d5aa622fd7b86539e3db96b46885c36 100644
--- a/courgette/patch_generator_x86_32.h
+++ b/courgette/patch_generator_x86_32.h
@@ -5,8 +5,8 @@
// This is the transformation and adjustment for all executables.
// The executable type is determined by ParseDetectedExecutable function.
-#ifndef COURGETTE_WIN32_X86_GENERATOR_H_
-#define COURGETTE_WIN32_X86_GENERATOR_H_
+#ifndef COURGETTE_PATCH_GENERATOR_X86_32_H_
+#define COURGETTE_PATCH_GENERATOR_X86_32_H_
#include <memory>
@@ -65,10 +65,9 @@ class PatchGeneratorX86_32 : public TransformationPatchGenerator {
// Generate old version of program using |corrected_parameters|.
// TODO(sra): refactor to use same code from patcher_.
std::unique_ptr<AssemblyProgram> old_program;
- Status old_parse_status =
- ParseDetectedExecutable(old_element_->region().start(),
- old_element_->region().length(),
- &old_program);
+ Status old_parse_status = ParseDetectedExecutableWithAnnotation(
+ old_element_->region().start(), old_element_->region().length(),
+ &old_program);
if (old_parse_status != C_OK) {
LOG(ERROR) << "Cannot parse an executable " << old_element_->Name();
return old_parse_status;
@@ -77,10 +76,9 @@ class PatchGeneratorX86_32 : public TransformationPatchGenerator {
// TODO(huangs): Move the block below to right before |new_program| gets
// used, so we can reduce Courgette-gen peak memory.
std::unique_ptr<AssemblyProgram> new_program;
- Status new_parse_status =
- ParseDetectedExecutable(new_element_->region().start(),
- new_element_->region().length(),
- &new_program);
+ Status new_parse_status = ParseDetectedExecutableWithAnnotation(
+ new_element_->region().start(), new_element_->region().length(),
+ &new_program);
if (new_parse_status != C_OK) {
LOG(ERROR) << "Cannot parse an executable " << new_element_->Name();
return new_parse_status;
@@ -132,4 +130,4 @@ class PatchGeneratorX86_32 : public TransformationPatchGenerator {
} // namespace courgette
-#endif // COURGETTE_WIN32_X86_GENERATOR_H_
+#endif // COURGETTE_PATCH_GENERATOR_X86_32_H_
« no previous file with comments | « courgette/disassembler_elf_32_x86_unittest.cc ('k') | courgette/program_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698