diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-02 01:26:05 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-02 01:26:05 +0000 |
commit | 9dfdbe6c0ce0b3ddc475f940eaafe2fb1c33b349 (patch) | |
tree | c38fc2240b1a97b56dd5600b641ecc17249f52bf /breakpad | |
parent | 605213f7c3431e9c9d787df949237d2eeaf06dd9 (diff) | |
download | chromium_src-9dfdbe6c0ce0b3ddc475f940eaafe2fb1c33b349.zip chromium_src-9dfdbe6c0ce0b3ddc475f940eaafe2fb1c33b349.tar.gz chromium_src-9dfdbe6c0ce0b3ddc475f940eaafe2fb1c33b349.tar.bz2 |
Roll DEPS for Breakpad r1104:1139.
Review URL: https://chromiumcodereview.appspot.com/13323008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'breakpad')
-rw-r--r-- | breakpad/pending/src/common/dwarf_cu_to_module.cc | 6 | ||||
-rw-r--r-- | breakpad/pending/src/common/dwarf_cu_to_module.h | 22 | ||||
-rw-r--r-- | breakpad/pending/src/common/module.cc | 86 |
3 files changed, 61 insertions, 53 deletions
diff --git a/breakpad/pending/src/common/dwarf_cu_to_module.cc b/breakpad/pending/src/common/dwarf_cu_to_module.cc index 0d59007..54f27bd 100644 --- a/breakpad/pending/src/common/dwarf_cu_to_module.cc +++ b/breakpad/pending/src/common/dwarf_cu_to_module.cc @@ -608,7 +608,7 @@ void DwarfCUToModule::WarningReporter::UnnamedFunction(uint64 offset) { } DwarfCUToModule::DwarfCUToModule(FileContext *file_context, - LineToModuleFunctor *line_reader, + LineToModuleHandler *line_reader, WarningReporter *reporter) : line_reader_(line_reader), has_source_line_info_(false) { cu_context_ = new CUContext(file_context, reporter); @@ -729,8 +729,8 @@ void DwarfCUToModule::ReadSourceLines(uint64 offset) { cu_context_->reporter->BadLineInfoOffset(offset); return; } - (*line_reader_)(section_start + offset, section_length - offset, - cu_context_->file_context->module, &lines_); + line_reader_->ReadProgram(section_start + offset, section_length - offset, + cu_context_->file_context->module, &lines_); } namespace { diff --git a/breakpad/pending/src/common/dwarf_cu_to_module.h b/breakpad/pending/src/common/dwarf_cu_to_module.h index cfb26f1..f5ca555 100644 --- a/breakpad/pending/src/common/dwarf_cu_to_module.h +++ b/breakpad/pending/src/common/dwarf_cu_to_module.h @@ -90,21 +90,27 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler { FilePrivate *file_private; }; - // An abstract base class for functors that handle DWARF line data + // An abstract base class for handlers that handle DWARF line data // for DwarfCUToModule. DwarfCUToModule could certainly just use // dwarf2reader::LineInfo itself directly, but decoupling things // this way makes unit testing a little easier. - class LineToModuleFunctor { + class LineToModuleHandler { public: - LineToModuleFunctor() { } - virtual ~LineToModuleFunctor() { } + LineToModuleHandler() { } + virtual ~LineToModuleHandler() { } + + // Called at the beginning of a new compilation unit, prior to calling + // ReadProgram(). compilation_dir will indicate the path that the + // current compilation unit was compiled in, consistent with the + // DW_AT_comp_dir DIE. + virtual void StartCompilationUnit(const string& compilation_dir) = 0; // Populate MODULE and LINES with source file names and code/line // mappings, given a pointer to some DWARF line number data // PROGRAM, and an overestimate of its size. Add no zero-length // lines to LINES. - virtual void operator()(const char *program, uint64 length, - Module *module, vector<Module::Line> *lines) = 0; + virtual void ReadProgram(const char *program, uint64 length, + Module *module, vector<Module::Line> *lines) = 0; }; // The interface DwarfCUToModule uses to report warnings. The member @@ -184,7 +190,7 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler { // unit's line number data. Use REPORTER to report problems with the // data we find. DwarfCUToModule(FileContext *file_context, - LineToModuleFunctor *line_reader, + LineToModuleHandler *line_reader, WarningReporter *reporter); ~DwarfCUToModule(); @@ -247,7 +253,7 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler { // destructor deletes them. // The functor to use to handle line number data. - LineToModuleFunctor *line_reader_; + LineToModuleHandler *line_reader_; // This compilation unit's context. CUContext *cu_context_; diff --git a/breakpad/pending/src/common/module.cc b/breakpad/pending/src/common/module.cc index cd92770..cb4847c 100644 --- a/breakpad/pending/src/common/module.cc +++ b/breakpad/pending/src/common/module.cc @@ -201,63 +201,65 @@ bool Module::WriteRuleMap(const RuleMap &rule_map, std::ostream &stream) { return stream.good(); } -bool Module::Write(std::ostream &stream, bool cfi) { +bool Module::Write(std::ostream &stream, SymbolData symbol_data) { stream << "MODULE " << os_ << " " << architecture_ << " " << id_ << " " << name_ << endl; if (!stream.good()) return ReportError(); - AssignSourceIds(); + if (symbol_data != ONLY_CFI) { + AssignSourceIds(); + + // Write out files. + for (FileByNameMap::iterator file_it = files_.begin(); + file_it != files_.end(); ++file_it) { + File *file = file_it->second; + if (file->source_id >= 0) { + stream << "FILE " << file->source_id << " " << file->name << endl; + if (!stream.good()) + return ReportError(); + } + } + + // Write out functions and their lines. + for (FunctionSet::const_iterator func_it = functions_.begin(); + func_it != functions_.end(); ++func_it) { + Function *func = *func_it; + assert(!func->name.empty()); + stream << "FUNC " << hex + << (func->address - load_address_) << " " + << func->size << " " + << func->parameter_size << " " + << func->name << dec << endl; - // Write out files. - for (FileByNameMap::iterator file_it = files_.begin(); - file_it != files_.end(); ++file_it) { - File *file = file_it->second; - if (file->source_id >= 0) { - stream << "FILE " << file->source_id << " " << file->name << endl; if (!stream.good()) return ReportError(); + for (vector<Line>::iterator line_it = func->lines.begin(); + line_it != func->lines.end(); ++line_it) { + stream << hex + << (line_it->address - load_address_) << " " + << line_it->size << " " + << dec + << line_it->number << " " + << line_it->file->source_id << endl; + if (!stream.good()) + return ReportError(); + } } - } - // Write out functions and their lines. - for (FunctionSet::const_iterator func_it = functions_.begin(); - func_it != functions_.end(); ++func_it) { - Function *func = *func_it; - assert(!func->name.empty()); - stream << "FUNC " << hex - << (func->address - load_address_) << " " - << func->size << " " - << func->parameter_size << " " - << func->name << dec << endl; - - if (!stream.good()) - return ReportError(); - for (vector<Line>::iterator line_it = func->lines.begin(); - line_it != func->lines.end(); ++line_it) { - stream << hex - << (line_it->address - load_address_) << " " - << line_it->size << " " - << dec - << line_it->number << " " - << line_it->file->source_id << endl; + // Write out 'PUBLIC' records. + for (ExternSet::const_iterator extern_it = externs_.begin(); + extern_it != externs_.end(); ++extern_it) { + Extern *ext = *extern_it; + stream << "PUBLIC " << hex + << (ext->address - load_address_) << " 0 " + << ext->name << dec << endl; if (!stream.good()) return ReportError(); } } - // Write out 'PUBLIC' records. - for (ExternSet::const_iterator extern_it = externs_.begin(); - extern_it != externs_.end(); ++extern_it) { - Extern *ext = *extern_it; - stream << "PUBLIC " << hex - << (ext->address - load_address_) << " 0 " - << ext->name << dec << endl; - if (!stream.good()) - return ReportError(); - } - - if (cfi) { + if (symbol_data != NO_CFI) { // Write out 'STACK CFI INIT' and 'STACK CFI' records. vector<StackFrameEntry *>::const_iterator frame_it; for (frame_it = stack_frame_entries_.begin(); |