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
This commit is contained in:
ted.mielczarek 2007-10-19 18:44:51 +00:00
parent f4021f0c68
commit d732add382
2 changed files with 24 additions and 5 deletions

View file

@ -451,6 +451,11 @@ class MinidumpModule : public MinidumpObject,
// be read.
bool module_valid_;
// True if debug info was read from the module. Certain modules
// may contain debug records in formats we don't support,
// so we can just set this to false to ignore them.
bool has_debug_info_;
MDRawModule module_;
// Cached module name.

View file

@ -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