From 1f87c4a732fa5175218549b4d7053112dbd57894 Mon Sep 17 00:00:00 2001 From: "ted.mielczarek@gmail.com" Date: Wed, 23 Jan 2013 18:01:28 +0000 Subject: Include the compilation directory for FILE entries, making them absolute instead of relative A=Ryan Sleevi R=mark,ted at https://breakpad.appspot.com/385001/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1106 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/dwarf_cu_to_module.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/common/dwarf_cu_to_module.h') diff --git a/src/common/dwarf_cu_to_module.h b/src/common/dwarf_cu_to_module.h index c7072b0f..85453316 100644 --- a/src/common/dwarf_cu_to_module.h +++ b/src/common/dwarf_cu_to_module.h @@ -92,21 +92,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 *lines) = 0; + virtual void ReadProgram(const char *program, uint64 length, + Module *module, vector *lines) = 0; }; // The interface DwarfCUToModule uses to report warnings. The member @@ -186,7 +192,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,8 +253,8 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler { // owned by this DwarfCUToModule: the constructor sets them, and the // destructor deletes them. - // The functor to use to handle line number data. - LineToModuleFunctor *line_reader_; + // The handler to use to handle line number data. + LineToModuleHandler *line_reader_; // This compilation unit's context. CUContext *cu_context_; -- cgit v1.2.1