From 0fd2f1ae2152782f2127c56fb5302002c95502d3 Mon Sep 17 00:00:00 2001 From: nealsid Date: Thu, 19 Feb 2009 21:26:20 +0000 Subject: Modify symbol supplier interface to support an overload that takes a symbol data buffer, to get around an extraneous read/write of symbol data R=doshimun git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@311 4c0a9323-5329-0410-9bdc-e9ce6186880e --- .../processor/basic_source_line_resolver.h | 6 ++++++ .../processor/source_line_resolver_interface.h | 3 +++ src/google_breakpad/processor/symbol_supplier.h | 16 +++++++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) (limited to 'src/google_breakpad/processor') diff --git a/src/google_breakpad/processor/basic_source_line_resolver.h b/src/google_breakpad/processor/basic_source_line_resolver.h index 814b01ae..38759579 100644 --- a/src/google_breakpad/processor/basic_source_line_resolver.h +++ b/src/google_breakpad/processor/basic_source_line_resolver.h @@ -69,6 +69,12 @@ class BasicSourceLineResolver : public SourceLineResolverInterface { // retained until the BasicSourceLineResolver is destroyed. virtual bool LoadModule(const string &module_name, const string &map_file); + // Exactly the same as above, except the given map_buffer is used + // for symbols. + virtual bool LoadModuleUsingMapBuffer(const string &module_name, + const string &map_buffer); + + virtual bool HasModule(const string &module_name) const; virtual StackFrameInfo* FillSourceLineInfo(StackFrame *frame) const; diff --git a/src/google_breakpad/processor/source_line_resolver_interface.h b/src/google_breakpad/processor/source_line_resolver_interface.h index 192177b2..93ef85d2 100644 --- a/src/google_breakpad/processor/source_line_resolver_interface.h +++ b/src/google_breakpad/processor/source_line_resolver_interface.h @@ -56,6 +56,9 @@ class SourceLineResolverInterface { // map_file should contain line/address mappings for this module. virtual bool LoadModule(const string &module_name, const string &map_file) = 0; + // Same as above, but takes the contents of a pre-read map buffer + virtual bool LoadModuleUsingMapBuffer(const string &module_name, + const string &map_buffer) = 0; // Returns true if a module with the given name has been loaded. virtual bool HasModule(const string &module_name) const = 0; diff --git a/src/google_breakpad/processor/symbol_supplier.h b/src/google_breakpad/processor/symbol_supplier.h index 0459c8aa..752bbbc3 100644 --- a/src/google_breakpad/processor/symbol_supplier.h +++ b/src/google_breakpad/processor/symbol_supplier.h @@ -59,12 +59,22 @@ class SymbolSupplier { // Retrieves the symbol file for the given CodeModule, placing the // path in symbol_file if successful. system_info contains strings - // identifying the operating system and CPU; SymbolSupplier may use to help - // locate the symbol file. system_info may be NULL or its fields may be - // empty if these values are unknown. + // identifying the operating system and CPU; SymbolSupplier may use + // to help locate the symbol file. system_info may be NULL or its + // fields may be empty if these values are unknown. symbol_file + // must be a pointer to a valid string virtual SymbolResult GetSymbolFile(const CodeModule *module, const SystemInfo *system_info, string *symbol_file) = 0; + // Same as above, except also places symbol data into symbol_data. + // If symbol_data is NULL, the data is not returned. + // TODO(nealsid) Once we have symbol data caching behavior implemented + // investigate making all symbol suppliers implement all methods, + // and make this pure virtual + virtual SymbolResult GetSymbolFile(const CodeModule *module, + const SystemInfo *system_info, + string *symbol_file, + string *symbol_data) { assert(0); } }; } // namespace google_breakpad -- cgit v1.2.1