diff options
author | SiyangXie@gmail.com <SiyangXie@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-10-07 20:31:36 +0000 |
---|---|---|
committer | SiyangXie@gmail.com <SiyangXie@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-10-07 20:31:36 +0000 |
commit | 5b117cf53af46f357d28761ced3a1d94aeb5df91 (patch) | |
tree | 2d6a68637909ef385a5fef6e21962f749d6ef9eb /src/google_breakpad/processor/basic_source_line_resolver.h | |
parent | Make dump_syms output an INFO CODE_ID line that includes the code file and co... (diff) | |
download | breakpad-5b117cf53af46f357d28761ced3a1d94aeb5df91.tar.xz |
Refactor source line resolver, add interface in supplier and resolver.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@711 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/google_breakpad/processor/basic_source_line_resolver.h')
-rw-r--r-- | src/google_breakpad/processor/basic_source_line_resolver.h | 63 |
1 files changed, 30 insertions, 33 deletions
diff --git a/src/google_breakpad/processor/basic_source_line_resolver.h b/src/google_breakpad/processor/basic_source_line_resolver.h index fe93f4d2..e6c13532 100644 --- a/src/google_breakpad/processor/basic_source_line_resolver.h +++ b/src/google_breakpad/processor/basic_source_line_resolver.h @@ -27,59 +27,56 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// BasicSourceLineResolver implements SourceLineResolverInterface, using -// address map files produced by a compatible writer, e.g. PDBSourceLineWriter. +// basic_source_line_resolver.h: BasicSourceLineResolver is derived from +// SourceLineResolverBase, and is a concrete implementation of +// SourceLineResolverInterface, using address map files produced by a +// compatible writer, e.g. PDBSourceLineWriter. +// +// see "processor/source_line_resolver_base.h" +// and "source_line_resolver_interface.h" for more documentation. #ifndef GOOGLE_BREAKPAD_PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_H__ #define GOOGLE_BREAKPAD_PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_H__ #include <map> -#include "google_breakpad/processor/source_line_resolver_interface.h" +#include "google_breakpad/processor/source_line_resolver_base.h" namespace google_breakpad { using std::string; using std::map; -class BasicSourceLineResolver : public SourceLineResolverInterface { +class BasicSourceLineResolver : public SourceLineResolverBase { public: BasicSourceLineResolver(); - virtual ~BasicSourceLineResolver(); - - // SourceLineResolverInterface methods, see source_line_resolver_interface.h - // for more details. - - // Adds a module to this resolver, returning true on success. - // The given map_file is read into memory, and its symbols will be - // retained until the BasicSourceLineResolver is destroyed. - virtual bool LoadModule(const CodeModule *module, const string &map_file); + virtual ~BasicSourceLineResolver() { } - // Exactly the same as above, except the given map_buffer is used - // for symbols. - virtual bool LoadModuleUsingMapBuffer(const CodeModule *module, - const string &map_buffer); - - void UnloadModule(const CodeModule *module); - virtual bool HasModule(const CodeModule *module); - virtual void FillSourceLineInfo(StackFrame *frame); - virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame); - virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame); + using SourceLineResolverBase::LoadModule; + using SourceLineResolverBase::LoadModuleUsingMapBuffer; + using SourceLineResolverBase::LoadModuleUsingMemoryBuffer; + using SourceLineResolverBase::UnloadModule; + using SourceLineResolverBase::HasModule; + using SourceLineResolverBase::FillSourceLineInfo; + using SourceLineResolverBase::FindWindowsFrameInfo; + using SourceLineResolverBase::FindCFIFrameInfo; private: - template<class T> class MemAddrMap; - struct Line; + // friend declarations: + friend class BasicModuleFactory; + + // Function derives from SourceLineResolverBase::Function. struct Function; - struct PublicSymbol; - struct File; - struct CompareString { - bool operator()(const string &s1, const string &s2) const; - }; + // Module implements SourceLineResolverBase::Module interface. class Module; - // All of the modules we've loaded - typedef map<string, Module*, CompareString> ModuleMap; - ModuleMap *modules_; + // Helper method. + virtual void DeleteDataAfterLoad(char *symbol_data); + // No-op helper methods. + virtual void DeleteDataUnload(const CodeModule *module) { } + virtual void ClearLocalMemory() { } + virtual void StoreDataBeforeLoad(const CodeModule *module, + char *symbol_data) { } // Disallow unwanted copy ctor and assignment operator BasicSourceLineResolver(const BasicSourceLineResolver&); |