diff options
author | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com> | 2014-11-03 18:25:43 +0000 |
---|---|---|
committer | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com> | 2014-11-03 18:25:43 +0000 |
commit | 8127f56dffb94defc5c5dbf93caf211195ba8aec (patch) | |
tree | cdfbe730169d51ac4cbae84e0536e0a8cbec6936 /src/common/module.cc | |
parent | Fix Windows client compilation on mingw. (diff) | |
download | breakpad-8127f56dffb94defc5c5dbf93caf211195ba8aec.tar.xz |
Read dynamic symbols table even if binary contains debug info
A=Wander Lairson Costa <wcosta@mozilla.com>. R=ted at https://breakpad.appspot.com/9684002/
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1400 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/module.cc')
-rw-r--r-- | src/common/module.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/common/module.cc b/src/common/module.cc index 244fc988..9a8e64cf 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -98,10 +98,21 @@ void Module::AddStackFrameEntry(StackFrameEntry *stack_frame_entry) { } void Module::AddExtern(Extern *ext) { - std::pair<ExternSet::iterator,bool> ret = externs_.insert(ext); - if (!ret.second) { - // Free the duplicate that was not inserted because this Module - // now owns it. + Function func; + func.name = ext->name; + func.address = ext->address; + + // Since parsing debug section and public info are not necessarily + // mutually exclusive, check if the symbol has already been read + // as a function to avoid duplicates. + if (functions_.find(&func) == functions_.end()) { + std::pair<ExternSet::iterator,bool> ret = externs_.insert(ext); + if (!ret.second) { + // Free the duplicate that was not inserted because this Module + // now owns it. + delete ext; + } + } else { delete ext; } } |