From 2ad976ef0ba44f36842b9b7a11848f6b40fd25d5 Mon Sep 17 00:00:00 2001 From: nealsid Date: Fri, 27 Feb 2009 23:59:40 +0000 Subject: Fix for issues 296, 297. Various symbol supplier classes need to be updated with new overload('make check' was failing, as well as crash_report), and remove logging that was flooding output git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@318 4c0a9323-5329-0410-9bdc-e9ce6186880e --- .../mac/crash_report/on_demand_symbol_supplier.h | 9 +++++++-- .../mac/crash_report/on_demand_symbol_supplier.mm | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) (limited to 'src/tools/mac/crash_report') diff --git a/src/tools/mac/crash_report/on_demand_symbol_supplier.h b/src/tools/mac/crash_report/on_demand_symbol_supplier.h index 0c3ebff9..9c0e8b78 100644 --- a/src/tools/mac/crash_report/on_demand_symbol_supplier.h +++ b/src/tools/mac/crash_report/on_demand_symbol_supplier.h @@ -47,7 +47,7 @@ class OnDemandSymbolSupplier : public SymbolSupplier { public: // |search_dir| is the directory to search for alternative symbols with // the same name as the module in the minidump - OnDemandSymbolSupplier(const string &search_dir, + OnDemandSymbolSupplier(const string &search_dir, const string &symbol_search_dir); virtual ~OnDemandSymbolSupplier() {} @@ -56,11 +56,16 @@ class OnDemandSymbolSupplier : public SymbolSupplier { const SystemInfo *system_info, string *symbol_file); + // Returns the path to the symbol file for the given module. + virtual SymbolResult GetSymbolFile(const CodeModule *module, + const SystemInfo *system_info, + string *symbol_file, + string *symbol_data); protected: // Search directory string search_dir_; string symbol_search_dir_; - + // When we create a symbol file for a module, save the name of the module // and the path to that module's symbol file. map module_file_map_; diff --git a/src/tools/mac/crash_report/on_demand_symbol_supplier.mm b/src/tools/mac/crash_report/on_demand_symbol_supplier.mm index b8501955..4123a27c 100644 --- a/src/tools/mac/crash_report/on_demand_symbol_supplier.mm +++ b/src/tools/mac/crash_report/on_demand_symbol_supplier.mm @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include "google_breakpad/processor/basic_source_line_resolver.h" #include "google_breakpad/processor/minidump.h" @@ -136,6 +138,26 @@ OnDemandSymbolSupplier::GetSymbolFile(const CodeModule *module, return FOUND; } +SymbolSupplier::SymbolResult +OnDemandSymbolSupplier::GetSymbolFile(const CodeModule *module, + const SystemInfo *system_info, + string *symbol_file, + string *symbol_data) { + SymbolSupplier::SymbolResult s = GetSymbolFile(module, + system_info, + symbol_file); + + + if (s == FOUND) { + ifstream in(symbol_file->c_str()); + getline(in, *symbol_data, std::string::traits_type::to_char_type( + std::string::traits_type::eof())); + in.close(); + } + + return s; +} + string OnDemandSymbolSupplier::GetLocalModulePath(const CodeModule *module) { NSFileManager *mgr = [NSFileManager defaultManager]; const char *moduleStr = module->code_file().c_str(); -- cgit v1.2.1