0

Fix for bug where 64-bit executables were processed as 32-bit executables.

Added some more logging.

TBR=sra

Review URL: http://codereview.chromium.org/988002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41598 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
laforge@chromium.org
2010-03-15 17:33:46 +00:00
parent 910d7302e8
commit 7e6b9261d9
4 changed files with 24 additions and 7 deletions

@ -18,6 +18,7 @@
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/string_util.h"
#include "base/time.h"
#include "courgette/assembly_program.h"
#include "courgette/courgette.h"
@ -1293,8 +1294,11 @@ class Adjuster : public AdjustmentMethod {
}
void Solve(const Trace& model, size_t model_end) {
base::Time start_time = base::Time::Now();
AssignmentProblem a(model, model_end);
a.Solve();
LOG(INFO) << " Adjuster::Solve "
<< (base::Time::Now() - start_time).InSecondsF();
}
void ReferenceLabel(Trace* trace, Label* label, bool is_model) {

@ -63,12 +63,15 @@ Status Ensemble::FindEmbeddedElements() {
Region region(start + position, info->length());
if (info->has_text_section()) {
Element* element = new ElementWinPE(Element::WIN32_X86_WITH_CODE,
this, region, info);
owned_elements_.push_back(element);
elements_.push_back(element);
position += region.length();
continue;
if (info->is_32bit()) {
Element* element = new ElementWinPE(Element::WIN32_X86_WITH_CODE,
this, region, info);
owned_elements_.push_back(element);
elements_.push_back(element);
position += region.length();
continue;
}
// TODO(sra): Extend to 64-bit executables.
}
// If we had a clever transformation for resource-only executables we

@ -186,6 +186,9 @@ void FreeGenerators(std::vector<TransformationPatchGenerator*>* generators) {
Status GenerateEnsemblePatch(SourceStream* base,
SourceStream* update,
SinkStream* final_patch) {
LOG(INFO) << "start GenerateEnsemblePatch";
base::Time start_time = base::Time::Now();
Region old_region(base->Buffer(), base->Remaining());
Region new_region(update->Buffer(), update->Remaining());
Ensemble old_ensemble(old_region, "old");
@ -376,6 +379,9 @@ Status GenerateEnsemblePatch(SourceStream* base,
if (!patch_streams.CopyTo(final_patch))
return C_STREAM_ERROR;
LOG(INFO) << "done GenerateEnsemblePatch "
<< (base::Time::Now() - start_time).InSecondsF() << "s";
return C_OK;
}

@ -7,6 +7,7 @@
#ifndef COURGETTE_WIN32_X86_GENERATOR_H_
#define COURGETTE_WIN32_X86_GENERATOR_H_
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "courgette/ensemble.h"
@ -60,8 +61,10 @@ class CourgetteWin32X86PatchGenerator : public TransformationPatchGenerator {
ParseWin32X86PE(old_element_->region().start(),
old_element_->region().length(),
&old_program);
if (old_parse_status != C_OK)
if (old_parse_status != C_OK) {
LOG(ERROR) << "Cannot parse as Win32X86PE " << old_element_->Name();
return old_parse_status;
}
AssemblyProgram* new_program = NULL;
Status new_parse_status =
@ -70,6 +73,7 @@ class CourgetteWin32X86PatchGenerator : public TransformationPatchGenerator {
&new_program);
if (new_parse_status != C_OK) {
DeleteAssemblyProgram(old_program);
LOG(ERROR) << "Cannot parse as Win32X86PE " << new_element_->Name();
return new_parse_status;
}