From d732add382b95d1460b281f191f0f0e4397eaf51 Mon Sep 17 00:00:00 2001 From: "ted.mielczarek" Date: Fri, 19 Oct 2007 18:44:51 +0000 Subject: Issue 222 - processor fails if an entry in the ModuleList is bad. r=mento git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@225 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/processor/minidump.cc | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'src/processor') diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index f4817044..19dbaeb0 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -1296,6 +1296,7 @@ MinidumpModule::MinidumpModule(Minidump* minidump) module_valid_(false), module_(), name_(NULL), + has_debug_info_(false), cv_record_(NULL), cv_record_signature_(MD_CVINFOUNKNOWN_SIGNATURE), misc_record_(NULL) { @@ -1320,6 +1321,7 @@ bool MinidumpModule::Read() { misc_record_ = NULL; module_valid_ = false; + has_debug_info_ = false; valid_ = false; if (!minidump_->ReadBytes(&module_, MD_MODULE_SIZE)) { @@ -1380,6 +1382,9 @@ bool MinidumpModule::ReadAuxiliaryData() { return false; } + // At this point, we have enough info for the module to be valid. + valid_ = true; + // CodeView and miscellaneous debug records are only required if the // module indicates that they exist. if (module_.cv_record.data_size && !GetCVRecord(NULL)) { @@ -1394,7 +1399,7 @@ bool MinidumpModule::ReadAuxiliaryData() { return false; } - valid_ = true; + has_debug_info_ = true; return true; } @@ -1415,6 +1420,9 @@ string MinidumpModule::code_identifier() const { return ""; } + if (!has_debug_info_) + return ""; + MinidumpSystemInfo *minidump_system_info = minidump_->GetSystemInfo(); if (!minidump_system_info) { BPLOG(ERROR) << "MinidumpModule code_identifier requires " @@ -1471,6 +1479,9 @@ string MinidumpModule::debug_file() const { return ""; } + if (!has_debug_info_) + return ""; + string file; // Prefer the CodeView record if present. if (cv_record_) { @@ -1547,6 +1558,9 @@ string MinidumpModule::debug_identifier() const { return ""; } + if (!has_debug_info_) + return ""; + string identifier; // Use the CodeView record if present. @@ -2090,10 +2104,10 @@ bool MinidumpModuleList::Read(u_int32_t expected_size) { MinidumpModule* module = &(*modules)[module_index]; if (!module->ReadAuxiliaryData()) { - BPLOG(ERROR) << "MinidumpModuleList could not read module auxiliary " - "data for module " << - module_index << "/" << module_count; - return false; + BPLOG(INFO) << "MinidumpModuleList could not read module auxiliary " + "data for module " << + module_index << "/" << module_count; + continue; } // It is safe to use module->code_file() after successfully calling -- cgit v1.2.1