diff options
author | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-02-27 23:59:40 +0000 |
---|---|---|
committer | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-02-27 23:59:40 +0000 |
commit | 2ad976ef0ba44f36842b9b7a11848f6b40fd25d5 (patch) | |
tree | f5c7d26102e035346f35db90e2128a183149779c /src/processor | |
parent | Fix for issue 242, plus a redo of how old exception handlers are tracked, and... (diff) | |
download | breakpad-2ad976ef0ba44f36842b9b7a11848f6b40fd25d5.tar.xz |
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
Diffstat (limited to 'src/processor')
-rw-r--r-- | src/processor/contained_range_map-inl.h | 13 | ||||
-rw-r--r-- | src/processor/minidump_processor_unittest.cc | 24 | ||||
-rw-r--r-- | src/processor/simple_symbol_supplier.cc | 21 | ||||
-rw-r--r-- | src/processor/simple_symbol_supplier.h | 6 |
4 files changed, 57 insertions, 7 deletions
diff --git a/src/processor/contained_range_map-inl.h b/src/processor/contained_range_map-inl.h index cf5ff235..5cc498df 100644 --- a/src/processor/contained_range_map-inl.h +++ b/src/processor/contained_range_map-inl.h @@ -60,8 +60,12 @@ bool ContainedRangeMap<AddressType, EntryType>::StoreRange( // Check for undersize or overflow. if (size <= 0 || high < base) { - BPLOG(INFO) << "StoreRange failed, " << HexString(base) << "+" << - HexString(size) << ", " << HexString(high); + //TODO(nealsid) We are commenting this out in order to prevent + // excessive logging. We plan to move to better logging as this + // failure happens quite often and is expected(see comment in + // basic_source_line_resolver.cc:671). + // BPLOG(INFO) << "StoreRange failed, " << HexString(base) << "+" + // << HexString(size) << ", " << HexString(high); return false; } @@ -81,8 +85,9 @@ bool ContainedRangeMap<AddressType, EntryType>::StoreRange( // it must fail. iterator_base->first contains the key, which was the // containing child's high address. if (iterator_base->second->base_ == base && iterator_base->first == high) { - BPLOG(INFO) << "StoreRange failed, identical range is already " - "present: " << HexString(base) << "+" << HexString(size); + // TODO(nealsid): See the TODO above on why this is commented out. +// BPLOG(INFO) << "StoreRange failed, identical range is already " +// "present: " << HexString(base) << "+" << HexString(size); return false; } diff --git a/src/processor/minidump_processor_unittest.cc b/src/processor/minidump_processor_unittest.cc index 06fa5408..bf8a8989 100644 --- a/src/processor/minidump_processor_unittest.cc +++ b/src/processor/minidump_processor_unittest.cc @@ -32,6 +32,8 @@ #include <cstdlib> #include <string> +#include <iostream> +#include <fstream> #include "google_breakpad/processor/basic_source_line_resolver.h" #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/code_module.h" @@ -89,6 +91,11 @@ class TestSymbolSupplier : public SymbolSupplier { const SystemInfo *system_info, string *symbol_file); + virtual SymbolResult GetSymbolFile(const CodeModule *module, + const SystemInfo *system_info, + string *symbol_file, + string *symbol_data); + // When set to true, causes the SymbolSupplier to return INTERRUPT void set_interrupt(bool interrupt) { interrupt_ = interrupt; } @@ -123,6 +130,23 @@ SymbolSupplier::SymbolResult TestSymbolSupplier::GetSymbolFile( return NOT_FOUND; } +SymbolSupplier::SymbolResult TestSymbolSupplier::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) { + std::ifstream in(symbol_file->c_str()); + std::getline(in, *symbol_data, std::string::traits_type::to_char_type( + std::string::traits_type::eof())); + in.close(); + } + + return s; +} + static bool RunTests() { TestSymbolSupplier supplier; BasicSourceLineResolver resolver; diff --git a/src/processor/simple_symbol_supplier.cc b/src/processor/simple_symbol_supplier.cc index 9c1aac4e..c593e955 100644 --- a/src/processor/simple_symbol_supplier.cc +++ b/src/processor/simple_symbol_supplier.cc @@ -38,6 +38,8 @@ #include <algorithm> #include <cassert> +#include <iostream> +#include <fstream> #include "processor/simple_symbol_supplier.h" #include "google_breakpad/processor/code_module.h" @@ -71,6 +73,25 @@ SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFile( return NOT_FOUND; } +SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFile( + const CodeModule *module, + const SystemInfo *system_info, + string *symbol_file, + string *symbol_data) { + assert(symbol_data); + symbol_data->clear(); + + SymbolSupplier::SymbolResult s = GetSymbolFile(module, system_info, symbol_file); + + if (s == FOUND) { + std::ifstream in(symbol_file->c_str()); + std::getline(in, *symbol_data, std::string::traits_type::to_char_type( + std::string::traits_type::eof())); + in.close(); + } + return s; +} + SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFileAtPathFromRoot( const CodeModule *module, const SystemInfo *system_info, const string &root_path, string *symbol_file) { diff --git a/src/processor/simple_symbol_supplier.h b/src/processor/simple_symbol_supplier.h index 9343e448..dff6a512 100644 --- a/src/processor/simple_symbol_supplier.h +++ b/src/processor/simple_symbol_supplier.h @@ -107,9 +107,9 @@ class SimpleSymbolSupplier : public SymbolSupplier { string *symbol_file); virtual SymbolResult GetSymbolFile(const CodeModule *module, - const SystemInfo *system_info, - string *symbol_file, - string *symbol_data) { assert(0); } + const SystemInfo *system_info, + string *symbol_file, + string *symbol_data); protected: SymbolResult GetSymbolFileAtPathFromRoot(const CodeModule *module, const SystemInfo *system_info, |