Filter out duplicates from the image list when creating a minidump. See issue 266 for more details.

Reviewer = mmentovai



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@277 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
nealsid 2008-06-04 22:57:09 +00:00
parent f6b3e16ef8
commit d55398a492
2 changed files with 13 additions and 0 deletions

View File

@ -385,6 +385,14 @@ void DynamicImages::ReadImageInfoForTask() {
// sorts based on loading address // sorts based on loading address
sort(image_list_.begin(), image_list_.end() ); sort(image_list_.begin(), image_list_.end() );
// remove duplicates - this happens in certain strange cases
// You can see it in DashboardClient when Google Gadgets plugin
// is installed. Apple's crash reporter log and gdb "info shared"
// both show the same library multiple times at the same address
vector<DynamicImageRef>::iterator it = unique(image_list_.begin(),
image_list_.end() );
image_list_.erase(it, image_list_.end());
} }
} }
} }

View File

@ -230,6 +230,11 @@ class DynamicImageRef {
< (*const_cast<DynamicImageRef&>(inRef).p); < (*const_cast<DynamicImageRef&>(inRef).p);
} }
bool operator==(const DynamicImageRef &inInfo) const {
return (*const_cast<DynamicImageRef*>(this)->p).GetLoadAddress() ==
(*const_cast<DynamicImageRef&>(inInfo)).GetLoadAddress();
}
// Be just like DynamicImage* // Be just like DynamicImage*
DynamicImage *operator->() {return p;} DynamicImage *operator->() {return p;}
operator DynamicImage*() {return p;} operator DynamicImage*() {return p;}