diff options
author | thestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-07-13 18:14:27 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-07-13 18:14:27 +0000 |
commit | 0dd6c95b3fcf0bef0a473901e47eb4c23fb30f5b (patch) | |
tree | 17afa3fb7d89d3edfccbaf8beff9b282c98efb73 /src/common/stabs_to_module.cc | |
parent | Fix a couple of tiny things for GCC pedantry (diff) | |
download | breakpad-0dd6c95b3fcf0bef0a473901e47eb4c23fb30f5b.tar.xz |
Remove duplicate FUNC entries from dump_syms output.
Review URL: http://breakpad.appspot.com/128001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@623 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/stabs_to_module.cc')
-rw-r--r-- | src/common/stabs_to_module.cc | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/common/stabs_to_module.cc b/src/common/stabs_to_module.cc index fbe4c02f..62fcd39e 100644 --- a/src/common/stabs_to_module.cc +++ b/src/common/stabs_to_module.cc @@ -58,7 +58,7 @@ static string Demangle(const string &mangled) { StabsToModule::~StabsToModule() { // Free any functions we've accumulated but not added to the module. - for (vector<Module::Function *>::iterator func_it = functions_.begin(); + for (vector<Module::Function *>::const_iterator func_it = functions_.begin(); func_it != functions_.end(); func_it++) delete *func_it; // Free any function that we're currently within. @@ -104,16 +104,8 @@ bool StabsToModule::EndFunction(uint64_t address) { assert(current_function_); // Functions in this compilation unit should have address bigger // than the compilation unit's starting address. There may be a lot - // of duplicated entries for functions in the STABS data; only one - // entry can meet this requirement. - // - // (I don't really understand the above comment; just bringing it along - // from the previous code, and leaving the behavior unchanged. GCC marks - // the end of each function with an N_FUN entry with no name, whose value - // is the size of the function; perhaps this test was concerned with - // skipping those. Now StabsReader interprets them properly. If you know - // the whole story, please patch this comment. --jimb) - // + // of duplicated entries for functions in the STABS data. We will + // count on the Module to remove the duplicates. if (current_function_->address >= comp_unit_base_address_) functions_.push_back(current_function_); else @@ -153,12 +145,13 @@ void StabsToModule::Finalize() { // Sort all functions by address, just for neatness. sort(functions_.begin(), functions_.end(), Module::Function::CompareByAddress); - for (vector<Module::Function *>::iterator func_it = functions_.begin(); + + for (vector<Module::Function *>::const_iterator func_it = functions_.begin(); func_it != functions_.end(); func_it++) { Module::Function *f = *func_it; // Compute the function f's size. - vector<Module::Address>::iterator boundary + vector<Module::Address>::const_iterator boundary = std::upper_bound(boundaries_.begin(), boundaries_.end(), f->address); if (boundary != boundaries_.end()) f->size = *boundary - f->address; |