michael@0: changeset: 126589:636cfcab9682 michael@0: user: Julian Seward michael@0: date: Thu Mar 28 18:06:39 2013 +0100 michael@0: summary: Bug 853851 - Transition some breakpad logging to BPLOG. r=ted michael@0: michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/dwarf_cfi_to_module.cc michael@0: --- a/src/common/dwarf_cfi_to_module.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/common/dwarf_cfi_to_module.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -30,18 +30,20 @@ michael@0: // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: michael@0: // Original author: Jim Blandy michael@0: michael@0: // Implementation of google_breakpad::DwarfCFIToModule. michael@0: // See dwarf_cfi_to_module.h for details. michael@0: michael@0: #include michael@0: +#include michael@0: michael@0: #include "common/dwarf_cfi_to_module.h" michael@0: +#include "common/logging.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: using std::ostringstream; michael@0: michael@0: vector DwarfCFIToModule::RegisterNames::MakeVector( michael@0: const char* const* strings, michael@0: size_t size) { michael@0: @@ -226,36 +228,42 @@ bool DwarfCFIToModule::ValExpressionRule michael@0: michael@0: bool DwarfCFIToModule::End() { michael@0: module_->AddStackFrameEntry(entry_); michael@0: entry_ = NULL; michael@0: return true; michael@0: } michael@0: michael@0: void DwarfCFIToModule::Reporter::UnnamedRegister(size_t offset, int reg) { michael@0: - fprintf(stderr, "%s, section '%s': " michael@0: - "the call frame entry at offset 0x%zx refers to register %d," michael@0: - " whose name we don't know\n", michael@0: - file_.c_str(), section_.c_str(), offset, reg); michael@0: + BPLOG(INFO) << file_ << ", section '" << section_ michael@0: + << "': the call frame entry at offset 0x" michael@0: + << std::setbase(16) << offset << std::setbase(10) michael@0: + << " refers to register " << reg << ", whose name we don't know"; michael@0: } michael@0: michael@0: void DwarfCFIToModule::Reporter::UndefinedNotSupported( michael@0: size_t offset, michael@0: const UniqueString* reg) { michael@0: - fprintf(stderr, "%s, section '%s': " michael@0: - "the call frame entry at offset 0x%zx sets the rule for " michael@0: - "register '%s' to 'undefined', but the Breakpad symbol file format" michael@0: - " cannot express this\n", michael@0: - file_.c_str(), section_.c_str(), offset, FromUniqueString(reg)); michael@0: + BPLOG(INFO) << file_ << ", section '" << section_ michael@0: + << "': the call frame entry at offset 0x" michael@0: + << std::setbase(16) << offset << std::setbase(10) michael@0: + << " sets the rule for register '" << FromUniqueString(reg) michael@0: + << "' to 'undefined', but the Breakpad symbol file format cannot " michael@0: + << " express this"; michael@0: } michael@0: michael@0: void DwarfCFIToModule::Reporter::ExpressionsNotSupported( michael@0: size_t offset, michael@0: const UniqueString* reg) { michael@0: - fprintf(stderr, "%s, section '%s': " michael@0: - "the call frame entry at offset 0x%zx uses a DWARF expression to" michael@0: - " describe how to recover register '%s', " michael@0: - " but this translator cannot yet translate DWARF expressions to" michael@0: - " Breakpad postfix expressions\n", michael@0: - file_.c_str(), section_.c_str(), offset, FromUniqueString(reg)); michael@0: + static uint64_t n_complaints = 0; // This isn't threadsafe michael@0: + n_complaints++; michael@0: + if (!is_power_of_2(n_complaints)) michael@0: + return; michael@0: + BPLOG(INFO) << file_ << ", section '" << section_ michael@0: + << "': the call frame entry at offset 0x" michael@0: + << std::setbase(16) << offset << std::setbase(10) michael@0: + << " uses a DWARF expression to describe how to recover register '" michael@0: + << FromUniqueString(reg) << "', but this translator cannot yet " michael@0: + << "translate DWARF expressions to Breakpad postfix expressions (shown " michael@0: + << n_complaints << " times)"; michael@0: } michael@0: michael@0: } // namespace google_breakpad michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/dwarf_cu_to_module.cc michael@0: --- a/src/common/dwarf_cu_to_module.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/common/dwarf_cu_to_module.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -38,23 +38,24 @@ michael@0: michael@0: #include "common/dwarf_cu_to_module.h" michael@0: michael@0: #include michael@0: #if !defined(__ANDROID__) michael@0: #include michael@0: #endif michael@0: #include michael@0: -#include michael@0: michael@0: #include michael@0: #include michael@0: #include michael@0: +#include michael@0: michael@0: #include "common/dwarf_line_to_module.h" michael@0: +#include "common/logging.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: using std::map; michael@0: using std::pair; michael@0: using std::set; michael@0: using std::sort; michael@0: using std::vector; michael@0: @@ -553,84 +554,89 @@ dwarf2reader::DIEHandler *DwarfCUToModul michael@0: default: michael@0: return NULL; michael@0: } michael@0: } michael@0: michael@0: void DwarfCUToModule::WarningReporter::CUHeading() { michael@0: if (printed_cu_header_) michael@0: return; michael@0: - fprintf(stderr, "%s: in compilation unit '%s' (offset 0x%llx):\n", michael@0: - filename_.c_str(), cu_name_.c_str(), cu_offset_); michael@0: + BPLOG(INFO) michael@0: + << filename_ << ": in compilation unit '" << cu_name_ michael@0: + << "' (offset 0x" << std::setbase(16) << cu_offset_ << std::setbase(10) michael@0: + << "):"; michael@0: printed_cu_header_ = true; michael@0: } michael@0: michael@0: void DwarfCUToModule::WarningReporter::UnknownSpecification(uint64 offset, michael@0: uint64 target) { michael@0: CUHeading(); michael@0: - fprintf(stderr, "%s: the DIE at offset 0x%llx has a DW_AT_specification" michael@0: - " attribute referring to the die at offset 0x%llx, which either" michael@0: - " was not marked as a declaration, or comes later in the file\n", michael@0: - filename_.c_str(), offset, target); michael@0: + BPLOG(INFO) michael@0: + << filename_ << ": the DIE at offset 0x" michael@0: + << std::setbase(16) << offset << std::setbase(10) michael@0: + << " has a DW_AT_specification attribute referring to the die at offset 0x" michael@0: + << std::setbase(16) << target << std::setbase(10) michael@0: + << ", which either was not marked as a declaration, or comes " michael@0: + << "later in the file"; michael@0: } michael@0: michael@0: void DwarfCUToModule::WarningReporter::UnknownAbstractOrigin(uint64 offset, michael@0: uint64 target) { michael@0: CUHeading(); michael@0: - fprintf(stderr, "%s: the DIE at offset 0x%llx has a DW_AT_abstract_origin" michael@0: - " attribute referring to the die at offset 0x%llx, which either" michael@0: - " was not marked as an inline, or comes later in the file\n", michael@0: - filename_.c_str(), offset, target); michael@0: + BPLOG(INFO) michael@0: + << filename_ << ": the DIE at offset 0x" michael@0: + << std::setbase(16) << offset << std::setbase(10) michael@0: + << " has a DW_AT_abstract_origin attribute referring to the die at" michael@0: + << " offset 0x" << std::setbase(16) << target << std::setbase(10) michael@0: + << ", which either was not marked as an inline, or comes " michael@0: + << "later in the file"; michael@0: } michael@0: michael@0: void DwarfCUToModule::WarningReporter::MissingSection(const string &name) { michael@0: CUHeading(); michael@0: - fprintf(stderr, "%s: warning: couldn't find DWARF '%s' section\n", michael@0: - filename_.c_str(), name.c_str()); michael@0: + BPLOG(INFO) << filename_ << ": warning: couldn't find DWARF '" michael@0: + << name << "' section"; michael@0: } michael@0: michael@0: void DwarfCUToModule::WarningReporter::BadLineInfoOffset(uint64 offset) { michael@0: CUHeading(); michael@0: - fprintf(stderr, "%s: warning: line number data offset beyond end" michael@0: - " of '.debug_line' section\n", michael@0: - filename_.c_str()); michael@0: + BPLOG(INFO) << filename_ << ": warning: line number data offset beyond " michael@0: + << "end of '.debug_line' section"; michael@0: } michael@0: michael@0: void DwarfCUToModule::WarningReporter::UncoveredHeading() { michael@0: if (printed_unpaired_header_) michael@0: return; michael@0: CUHeading(); michael@0: - fprintf(stderr, "%s: warning: skipping unpaired lines/functions:\n", michael@0: - filename_.c_str()); michael@0: + BPLOG(INFO) << filename_ << ": warning: skipping unpaired lines/functions:"; michael@0: printed_unpaired_header_ = true; michael@0: } michael@0: michael@0: void DwarfCUToModule::WarningReporter::UncoveredFunction( michael@0: const Module::Function &function) { michael@0: if (!uncovered_warnings_enabled_) michael@0: return; michael@0: UncoveredHeading(); michael@0: - fprintf(stderr, " function%s: %s\n", michael@0: - function.size == 0 ? " (zero-length)" : "", michael@0: - function.name.c_str()); michael@0: + BPLOG(INFO) << " function" << (function.size == 0 ? " (zero-length)" : "") michael@0: + << ": " << function.name; michael@0: } michael@0: michael@0: void DwarfCUToModule::WarningReporter::UncoveredLine(const Module::Line &line) { michael@0: if (!uncovered_warnings_enabled_) michael@0: return; michael@0: UncoveredHeading(); michael@0: - fprintf(stderr, " line%s: %s:%d at 0x%" PRIx64 "\n", michael@0: - (line.size == 0 ? " (zero-length)" : ""), michael@0: - line.file->name.c_str(), line.number, line.address); michael@0: + BPLOG(INFO) << " line" << (line.size == 0 ? " (zero-length)" : "") michael@0: + << ": " << line.file->name << ":" << line.number michael@0: + << " at 0x" << std::setbase(16) << line.address << std::setbase(10); michael@0: } michael@0: michael@0: void DwarfCUToModule::WarningReporter::UnnamedFunction(uint64 offset) { michael@0: CUHeading(); michael@0: - fprintf(stderr, "%s: warning: function at offset 0x%llx has no name\n", michael@0: - filename_.c_str(), offset); michael@0: + BPLOG(INFO) << filename_ << ": warning: function at offset 0x" michael@0: + << std::setbase(16) << offset << std::setbase(10) << " has no name"; michael@0: } michael@0: michael@0: DwarfCUToModule::DwarfCUToModule(FileContext *file_context, michael@0: LineToModuleHandler *line_reader, michael@0: WarningReporter *reporter) michael@0: : line_reader_(line_reader), has_source_line_info_(false) { michael@0: cu_context_ = new CUContext(file_context, reporter); michael@0: child_context_ = new DIEContext(); michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/dwarf_line_to_module.cc michael@0: --- a/src/common/dwarf_line_to_module.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/common/dwarf_line_to_module.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -27,22 +27,21 @@ michael@0: // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE michael@0: // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: michael@0: // Original author: Jim Blandy michael@0: michael@0: // dwarf_line_to_module.cc: Implementation of DwarfLineToModule class. michael@0: // See dwarf_line_to_module.h for details. michael@0: michael@0: -#include michael@0: - michael@0: #include michael@0: michael@0: #include "common/dwarf_line_to_module.h" michael@0: #include "common/using_std_string.h" michael@0: +#include "common/logging.h" michael@0: michael@0: // Trying to support Windows paths in a reasonable way adds a lot of michael@0: // variations to test; it would be better to just put off dealing with michael@0: // it until we actually have to deal with DWARF on Windows. michael@0: michael@0: // Return true if PATH is an absolute path, false if it is relative. michael@0: static bool PathIsAbsolute(const string &path) { michael@0: return (path.size() >= 1 && path[0] == '/'); michael@0: @@ -84,18 +83,18 @@ void DwarfLineToModule::DefineFile(const michael@0: // an attribute on the compilation unit, rather than in the program table. michael@0: dir_name = compilation_dir_; michael@0: } else { michael@0: DirectoryTable::const_iterator directory_it = directories_.find(dir_num); michael@0: if (directory_it != directories_.end()) { michael@0: dir_name = directory_it->second; michael@0: } else { michael@0: if (!warned_bad_directory_number_) { michael@0: - fprintf(stderr, "warning: DWARF line number data refers to undefined" michael@0: - " directory numbers\n"); michael@0: + BPLOG(INFO) << "warning: DWARF line number data refers to undefined" michael@0: + << " directory numbers"; michael@0: warned_bad_directory_number_ = true; michael@0: } michael@0: } michael@0: } michael@0: michael@0: string full_name = ExpandPath(name, dir_name); michael@0: michael@0: // Find a Module::File object of the given name, and add it to the michael@0: @@ -120,18 +119,18 @@ void DwarfLineToModule::AddLine(uint64 a michael@0: } else { michael@0: omitted_line_end_ = 0; michael@0: } michael@0: michael@0: // Find the source file being referred to. michael@0: Module::File *file = files_[file_num]; michael@0: if (!file) { michael@0: if (!warned_bad_file_number_) { michael@0: - fprintf(stderr, "warning: DWARF line number data refers to " michael@0: - "undefined file numbers\n"); michael@0: + BPLOG(INFO) << "warning: DWARF line number data refers to " michael@0: + << "undefined file numbers"; michael@0: warned_bad_file_number_ = true; michael@0: } michael@0: return; michael@0: } michael@0: Module::Line line; michael@0: line.address = address; michael@0: // We set the size when we get the next line or the EndSequence call. michael@0: line.size = length; michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/linux/dump_symbols.cc michael@0: --- a/src/common/linux/dump_symbols.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/common/linux/dump_symbols.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -63,16 +63,17 @@ michael@0: #include "common/linux/file_id.h" michael@0: #include "common/module.h" michael@0: #include "common/scoped_ptr.h" michael@0: #ifndef NO_STABS_SUPPORT michael@0: #include "common/stabs_reader.h" michael@0: #include "common/stabs_to_module.h" michael@0: #endif michael@0: #include "common/using_std_string.h" michael@0: +#include "common/logging.h" michael@0: michael@0: // This namespace contains helper functions. michael@0: namespace { michael@0: michael@0: using google_breakpad::DwarfCFIToModule; michael@0: using google_breakpad::DwarfCUToModule; michael@0: using google_breakpad::DwarfLineToModule; michael@0: using google_breakpad::ElfClass; michael@0: @@ -523,16 +524,19 @@ bool LoadSymbols(const string& obj_file, michael@0: const bool read_gnu_debug_link, michael@0: LoadSymbolsInfo* info, michael@0: SymbolData symbol_data, michael@0: Module* module) { michael@0: typedef typename ElfClass::Addr Addr; michael@0: typedef typename ElfClass::Phdr Phdr; michael@0: typedef typename ElfClass::Shdr Shdr; michael@0: michael@0: + BPLOG(INFO) << ""; michael@0: + BPLOG(INFO) << "LoadSymbols: BEGIN " << obj_file; michael@0: + michael@0: Addr loading_addr = GetLoadingAddress( michael@0: GetOffset(elf_header, elf_header->e_phoff), michael@0: elf_header->e_phnum); michael@0: module->SetLoadAddress(loading_addr); michael@0: info->set_loading_addr(loading_addr, obj_file); michael@0: michael@0: const Shdr* sections = michael@0: GetOffset(elf_header, elf_header->e_shoff); michael@0: @@ -592,16 +596,18 @@ bool LoadSymbols(const string& obj_file, michael@0: // information, the other debugging information could be perfectly michael@0: // useful. michael@0: info->LoadedSection(".debug_frame"); michael@0: bool result = michael@0: LoadDwarfCFI(obj_file, elf_header, ".debug_frame", michael@0: dwarf_cfi_section, false, 0, 0, big_endian, michael@0: module); michael@0: found_usable_info = found_usable_info || result; michael@0: + if (result) michael@0: + BPLOG(INFO) << "LoadSymbols: read CFI from .debug_frame"; michael@0: } michael@0: michael@0: // Linux C++ exception handling information can also provide michael@0: // unwinding data. michael@0: const Shdr* eh_frame_section = michael@0: FindElfSectionByName(".eh_frame", SHT_PROGBITS, michael@0: sections, names, names_end, michael@0: elf_header->e_shnum); michael@0: @@ -618,16 +624,18 @@ bool LoadSymbols(const string& obj_file, michael@0: elf_header->e_shnum); michael@0: info->LoadedSection(".eh_frame"); michael@0: // As above, ignore the return value of this function. michael@0: bool result = michael@0: LoadDwarfCFI(obj_file, elf_header, ".eh_frame", michael@0: eh_frame_section, true, michael@0: got_section, text_section, big_endian, module); michael@0: found_usable_info = found_usable_info || result; michael@0: + if (result) michael@0: + BPLOG(INFO) << "LoadSymbols: read CFI from .eh_frame"; michael@0: } michael@0: } michael@0: michael@0: if (!found_debug_info_section && symbol_data != ONLY_CFI) { michael@0: fprintf(stderr, "%s: file contains no debugging information" michael@0: " (no \".stab\" or \".debug_info\" sections)\n", michael@0: obj_file.c_str()); michael@0: michael@0: @@ -685,24 +693,29 @@ bool LoadSymbols(const string& obj_file, michael@0: ElfClass::kAddrSize, michael@0: module); michael@0: found_usable_info = found_usable_info || result; michael@0: } michael@0: } michael@0: michael@0: // Return true if some usable information was found, since michael@0: // the caller doesn't want to use .gnu_debuglink. michael@0: + BPLOG(INFO) << "LoadSymbols: " michael@0: + << (found_usable_info ? "SUCCESS " : "FAILURE ") michael@0: + << obj_file; michael@0: return found_usable_info; michael@0: } michael@0: michael@0: // No debug info was found, let the user try again with .gnu_debuglink michael@0: // if present. michael@0: + BPLOG(INFO) << "LoadSymbols: FAILURE " << obj_file; michael@0: return false; michael@0: } michael@0: michael@0: + BPLOG(INFO) << "LoadSymbols: SUCCESS " << obj_file; michael@0: return true; michael@0: } michael@0: michael@0: // Return the breakpad symbol file identifier for the architecture of michael@0: // ELF_HEADER. michael@0: template michael@0: const char* ElfArchitecture(const typename ElfClass::Ehdr* elf_header) { michael@0: typedef typename ElfClass::Half Half; michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/logging.cc michael@0: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 michael@0: +++ b/src/common/logging.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -0,0 +1,139 @@ michael@0: +// Copyright (c) 2007, Google Inc. michael@0: +// All rights reserved. michael@0: +// michael@0: +// Redistribution and use in source and binary forms, with or without michael@0: +// modification, are permitted provided that the following conditions are michael@0: +// met: michael@0: +// michael@0: +// * Redistributions of source code must retain the above copyright michael@0: +// notice, this list of conditions and the following disclaimer. michael@0: +// * Redistributions in binary form must reproduce the above michael@0: +// copyright notice, this list of conditions and the following disclaimer michael@0: +// in the documentation and/or other materials provided with the michael@0: +// distribution. michael@0: +// * Neither the name of Google Inc. nor the names of its michael@0: +// contributors may be used to endorse or promote products derived from michael@0: +// this software without specific prior written permission. michael@0: +// michael@0: +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT michael@0: +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR michael@0: +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT michael@0: +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@0: +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@0: +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, michael@0: +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY michael@0: +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT michael@0: +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE michael@0: +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: + michael@0: +// logging.cc: Breakpad logging michael@0: +// michael@0: +// See logging.h for documentation. michael@0: +// michael@0: +// Author: Mark Mentovai michael@0: + michael@0: +#include michael@0: +#include michael@0: +#include michael@0: +#include michael@0: +#include michael@0: + michael@0: +#include michael@0: + michael@0: +#include "common/using_std_string.h" michael@0: +#include "common/logging.h" michael@0: +#include "common/pathname_stripper.h" michael@0: + michael@0: +#ifdef _WIN32 michael@0: +#define snprintf _snprintf michael@0: +#endif michael@0: + michael@0: +#ifdef __ANDROID__ michael@0: +# include michael@0: +#endif michael@0: + michael@0: +namespace google_breakpad { michael@0: + michael@0: +LogStream::LogStream(std::ostream &stream, Severity severity, michael@0: + const char *file, int line) michael@0: + : stream_(stream) { michael@0: + time_t clock; michael@0: + time(&clock); michael@0: + struct tm tm_struct; michael@0: +#ifdef _WIN32 michael@0: + localtime_s(&tm_struct, &clock); michael@0: +#else michael@0: + localtime_r(&clock, &tm_struct); michael@0: +#endif michael@0: + char time_string[20]; michael@0: + strftime(time_string, sizeof(time_string), "%Y-%m-%d %H:%M:%S", &tm_struct); michael@0: + michael@0: + const char *severity_string = "UNKNOWN_SEVERITY"; michael@0: + switch (severity) { michael@0: + case SEVERITY_INFO: michael@0: + severity_string = "INFO"; michael@0: + break; michael@0: + case SEVERITY_ERROR: michael@0: + severity_string = "ERROR"; michael@0: + break; michael@0: + } michael@0: + michael@0: + str_ << time_string << ": " << PathnameStripper::File(file) << ":" << michael@0: + line << ": " << severity_string << ": "; michael@0: +} michael@0: + michael@0: +LogStream::~LogStream() { michael@0: +#ifdef __ANDROID__ michael@0: + __android_log_print(ANDROID_LOG_ERROR, michael@0: + "Profiler", "%s", str_.str().c_str()); michael@0: +#else michael@0: + stream_ << str_.str(); michael@0: + stream_ << std::endl; michael@0: +#endif michael@0: +} michael@0: + michael@0: +string HexString(uint32_t number) { michael@0: + char buffer[11]; michael@0: + snprintf(buffer, sizeof(buffer), "0x%x", number); michael@0: + return string(buffer); michael@0: +} michael@0: + michael@0: +string HexString(uint64_t number) { michael@0: + char buffer[19]; michael@0: + snprintf(buffer, sizeof(buffer), "0x%" PRIx64, number); michael@0: + return string(buffer); michael@0: +} michael@0: + michael@0: +string HexString(int number) { michael@0: + char buffer[19]; michael@0: + snprintf(buffer, sizeof(buffer), "0x%x", number); michael@0: + return string(buffer); michael@0: +} michael@0: + michael@0: +int ErrnoString(string *error_string) { michael@0: + assert(error_string); michael@0: + michael@0: + // strerror isn't necessarily thread-safe. strerror_r would be preferrable, michael@0: + // but GNU libc uses a nonstandard strerror_r by default, which returns a michael@0: + // char* (rather than an int success indicator) and doesn't necessarily michael@0: + // use the supplied buffer. michael@0: + error_string->assign(strerror(errno)); michael@0: + return errno; michael@0: +} michael@0: + michael@0: +} // namespace google_breakpad michael@0: + michael@0: +bool is_power_of_2(uint64_t x_in) michael@0: +{ michael@0: + uint64_t x = x_in; michael@0: + x = x | (x >> 1); michael@0: + x = x | (x >> 2); michael@0: + x = x | (x >> 4); michael@0: + x = x | (x >> 8); michael@0: + x = x | (x >> 16); michael@0: + x = x | (x >> 32); michael@0: + x = x - (x >> 1); michael@0: + // x has now been rounded down to the nearest power of 2 <= x_in. michael@0: + return x == x_in; michael@0: +} michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/logging.h michael@0: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 michael@0: +++ b/src/common/logging.h Thu Apr 04 21:02:11 2013 +0200 michael@0: @@ -0,0 +1,182 @@ michael@0: +// Copyright (c) 2007, Google Inc. michael@0: +// All rights reserved. michael@0: +// michael@0: +// Redistribution and use in source and binary forms, with or without michael@0: +// modification, are permitted provided that the following conditions are michael@0: +// met: michael@0: +// michael@0: +// * Redistributions of source code must retain the above copyright michael@0: +// notice, this list of conditions and the following disclaimer. michael@0: +// * Redistributions in binary form must reproduce the above michael@0: +// copyright notice, this list of conditions and the following disclaimer michael@0: +// in the documentation and/or other materials provided with the michael@0: +// distribution. michael@0: +// * Neither the name of Google Inc. nor the names of its michael@0: +// contributors may be used to endorse or promote products derived from michael@0: +// this software without specific prior written permission. michael@0: +// michael@0: +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT michael@0: +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR michael@0: +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT michael@0: +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@0: +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@0: +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, michael@0: +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY michael@0: +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT michael@0: +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE michael@0: +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: + michael@0: +// logging.h: Breakpad logging michael@0: +// michael@0: +// Breakpad itself uses Breakpad logging with statements of the form: michael@0: +// BPLOG(severity) << "message"; michael@0: +// severity may be INFO, ERROR, or other values defined in this file. michael@0: +// michael@0: +// BPLOG is an overridable macro so that users can customize Breakpad's michael@0: +// logging. Left at the default, logging messages are sent to stderr along michael@0: +// with a timestamp and the source code location that produced a message. michael@0: +// The streams may be changed by redefining BPLOG_*_STREAM, the logging michael@0: +// behavior may be changed by redefining BPLOG_*, and the entire logging michael@0: +// system may be overridden by redefining BPLOG(severity). These michael@0: +// redefinitions may be passed to the preprocessor as a command-line flag michael@0: +// (-D). michael@0: +// michael@0: +// If an additional header is required to override Breakpad logging, it can michael@0: +// be specified by the BP_LOGGING_INCLUDE macro. If defined, this header michael@0: +// will #include the header specified by that macro. michael@0: +// michael@0: +// If any initialization is needed before logging, it can be performed by michael@0: +// a function called through the BPLOG_INIT macro. Each main function of michael@0: +// an executable program in the Breakpad processor library calls michael@0: +// BPLOG_INIT(&argc, &argv); before any logging can be performed; define michael@0: +// BPLOG_INIT appropriately if initialization is required. michael@0: +// michael@0: +// Author: Mark Mentovai michael@0: + michael@0: +#ifndef PROCESSOR_LOGGING_H__ michael@0: +#define PROCESSOR_LOGGING_H__ michael@0: + michael@0: +#include michael@0: +#include michael@0: +#include michael@0: + michael@0: +#include "common/using_std_string.h" michael@0: +#include "google_breakpad/common/breakpad_types.h" michael@0: + michael@0: +#ifdef BP_LOGGING_INCLUDE michael@0: +#include BP_LOGGING_INCLUDE michael@0: +#endif // BP_LOGGING_INCLUDE michael@0: + michael@0: +#ifndef THIRD_PARTY_BREAKPAD_GOOGLE_GLUE_LOGGING_H_ michael@0: +namespace base_logging { michael@0: + michael@0: +// The open-source copy of logging.h has diverged from Google's internal copy michael@0: +// (temporarily, at least). To support the transition to structured logging michael@0: +// a definition for base_logging::LogMessage is needed, which is a ostream- michael@0: +// like object for streaming arguments to construct a log message. michael@0: +typedef std::ostream LogMessage; michael@0: + michael@0: +} // namespace base_logging michael@0: +#endif // THIRD_PARTY_BREAKPAD_GOOGLE_GLUE_LOGGING_H_ michael@0: + michael@0: +namespace google_breakpad { michael@0: + michael@0: +// These are defined in Microsoft headers. michael@0: +#ifdef SEVERITY_ERROR michael@0: +#undef SEVERITY_ERROR michael@0: +#endif michael@0: + michael@0: +#ifdef ERROR michael@0: +#undef ERROR michael@0: +#endif michael@0: + michael@0: +class LogStream { michael@0: + public: michael@0: + enum Severity { michael@0: + SEVERITY_INFO, michael@0: + SEVERITY_ERROR michael@0: + }; michael@0: + michael@0: + // Begin logging a message to the stream identified by |stream|, at the michael@0: + // indicated severity. The file and line parameters should be set so as to michael@0: + // identify the line of source code that is producing a message. michael@0: + LogStream(std::ostream &stream, Severity severity, michael@0: + const char *file, int line); michael@0: + michael@0: + // Finish logging by printing a newline and flushing the output stream. michael@0: + ~LogStream(); michael@0: + michael@0: + // Accumulate text in the str_. It will be emitted to stream_ when michael@0: + // the object is destructed. michael@0: + template std::ostream& operator<<(const T &t) { michael@0: + return str_ << t; michael@0: + } michael@0: + michael@0: + private: michael@0: + std::ostream &stream_; michael@0: + std::ostringstream str_; michael@0: + michael@0: + // Disallow copy constructor and assignment operator michael@0: + explicit LogStream(const LogStream &that); michael@0: + void operator=(const LogStream &that); michael@0: +}; michael@0: + michael@0: +// This class is used to explicitly ignore values in the conditional logging michael@0: +// macros. This avoids compiler warnings like "value computed is not used" michael@0: +// and "statement has no effect". michael@0: +class LogMessageVoidify { michael@0: + public: michael@0: + LogMessageVoidify() {} michael@0: + michael@0: + // This has to be an operator with a precedence lower than << but higher michael@0: + // than ?: michael@0: + void operator&(base_logging::LogMessage &) {} michael@0: +}; michael@0: + michael@0: +// Returns number formatted as a hexadecimal string, such as "0x7b". michael@0: +string HexString(uint32_t number); michael@0: +string HexString(uint64_t number); michael@0: +string HexString(int number); michael@0: + michael@0: +// Returns the error code as set in the global errno variable, and sets michael@0: +// error_string, a required argument, to a string describing that error michael@0: +// code. michael@0: +int ErrnoString(string *error_string); michael@0: + michael@0: +} // namespace google_breakpad michael@0: + michael@0: +// Useful for doing exponential backoff of error reporting michael@0: +bool is_power_of_2(uint64_t); michael@0: + michael@0: +#ifndef BPLOG_INIT michael@0: +#define BPLOG_INIT(pargc, pargv) michael@0: +#endif // BPLOG_INIT michael@0: + michael@0: +#ifndef BPLOG michael@0: +#define BPLOG(severity) BPLOG_ ## severity michael@0: +#endif // BPLOG michael@0: + michael@0: +#ifndef BPLOG_INFO michael@0: +#ifndef BPLOG_INFO_STREAM michael@0: +#define BPLOG_INFO_STREAM std::clog michael@0: +#endif // BPLOG_INFO_STREAM michael@0: +#define BPLOG_INFO google_breakpad::LogStream(BPLOG_INFO_STREAM, \ michael@0: + google_breakpad::LogStream::SEVERITY_INFO, \ michael@0: + __FILE__, __LINE__) michael@0: +#endif // BPLOG_INFO michael@0: + michael@0: +#ifndef BPLOG_ERROR michael@0: +#ifndef BPLOG_ERROR_STREAM michael@0: +#define BPLOG_ERROR_STREAM std::cerr michael@0: +#endif // BPLOG_ERROR_STREAM michael@0: +#define BPLOG_ERROR google_breakpad::LogStream(BPLOG_ERROR_STREAM, \ michael@0: + google_breakpad::LogStream::SEVERITY_ERROR, \ michael@0: + __FILE__, __LINE__) michael@0: +#endif // BPLOG_ERROR michael@0: + michael@0: +#define BPLOG_IF(severity, condition) \ michael@0: + !(condition) ? (void) 0 : \ michael@0: + google_breakpad::LogMessageVoidify() & BPLOG(severity) michael@0: + michael@0: +#endif // PROCESSOR_LOGGING_H__ michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/pathname_stripper.cc michael@0: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 michael@0: +++ b/src/common/pathname_stripper.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -0,0 +1,56 @@ michael@0: +// Copyright (c) 2006, Google Inc. michael@0: +// All rights reserved. michael@0: +// michael@0: +// Redistribution and use in source and binary forms, with or without michael@0: +// modification, are permitted provided that the following conditions are michael@0: +// met: michael@0: +// michael@0: +// * Redistributions of source code must retain the above copyright michael@0: +// notice, this list of conditions and the following disclaimer. michael@0: +// * Redistributions in binary form must reproduce the above michael@0: +// copyright notice, this list of conditions and the following disclaimer michael@0: +// in the documentation and/or other materials provided with the michael@0: +// distribution. michael@0: +// * Neither the name of Google Inc. nor the names of its michael@0: +// contributors may be used to endorse or promote products derived from michael@0: +// this software without specific prior written permission. michael@0: +// michael@0: +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT michael@0: +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR michael@0: +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT michael@0: +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@0: +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@0: +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, michael@0: +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY michael@0: +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT michael@0: +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE michael@0: +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: + michael@0: +// pathname_stripper.cc: Manipulates pathnames into their component parts. michael@0: +// michael@0: +// See pathname_stripper.h for documentation. michael@0: +// michael@0: +// Author: Mark Mentovai michael@0: + michael@0: +#include "common/pathname_stripper.h" michael@0: + michael@0: +namespace google_breakpad { michael@0: + michael@0: +// static michael@0: +string PathnameStripper::File(const string &path) { michael@0: + string::size_type slash = path.rfind('/'); michael@0: + string::size_type backslash = path.rfind('\\'); michael@0: + michael@0: + string::size_type file_start = 0; michael@0: + if (slash != string::npos && michael@0: + (backslash == string::npos || slash > backslash)) { michael@0: + file_start = slash + 1; michael@0: + } else if (backslash != string::npos) { michael@0: + file_start = backslash + 1; michael@0: + } michael@0: + michael@0: + return path.substr(file_start); michael@0: +} michael@0: + michael@0: +} // namespace google_breakpad michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/pathname_stripper.h michael@0: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 michael@0: +++ b/src/common/pathname_stripper.h Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -0,0 +1,53 @@ michael@0: +// Copyright (c) 2006, Google Inc. michael@0: +// All rights reserved. michael@0: +// michael@0: +// Redistribution and use in source and binary forms, with or without michael@0: +// modification, are permitted provided that the following conditions are michael@0: +// met: michael@0: +// michael@0: +// * Redistributions of source code must retain the above copyright michael@0: +// notice, this list of conditions and the following disclaimer. michael@0: +// * Redistributions in binary form must reproduce the above michael@0: +// copyright notice, this list of conditions and the following disclaimer michael@0: +// in the documentation and/or other materials provided with the michael@0: +// distribution. michael@0: +// * Neither the name of Google Inc. nor the names of its michael@0: +// contributors may be used to endorse or promote products derived from michael@0: +// this software without specific prior written permission. michael@0: +// michael@0: +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT michael@0: +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR michael@0: +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT michael@0: +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@0: +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@0: +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, michael@0: +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY michael@0: +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT michael@0: +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE michael@0: +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: + michael@0: +// pathname_stripper.h: Manipulates pathnames into their component parts. michael@0: +// michael@0: +// Author: Mark Mentovai michael@0: + michael@0: +#ifndef PROCESSOR_PATHNAME_STRIPPER_H__ michael@0: +#define PROCESSOR_PATHNAME_STRIPPER_H__ michael@0: + michael@0: +#include michael@0: + michael@0: +#include "common/using_std_string.h" michael@0: + michael@0: +namespace google_breakpad { michael@0: + michael@0: +class PathnameStripper { michael@0: + public: michael@0: + // Given path, a pathname with components separated by slashes (/) or michael@0: + // backslashes (\), returns the trailing component, without any separator. michael@0: + // If path ends in a separator character, returns an empty string. michael@0: + static string File(const string &path); michael@0: +}; michael@0: + michael@0: +} // namespace google_breakpad michael@0: + michael@0: +#endif // PROCESSOR_PATHNAME_STRIPPER_H__ michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/pathname_stripper_unittest.cc michael@0: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 michael@0: +++ b/src/common/pathname_stripper_unittest.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -0,0 +1,87 @@ michael@0: +// Copyright (c) 2006, Google Inc. michael@0: +// All rights reserved. michael@0: +// michael@0: +// Redistribution and use in source and binary forms, with or without michael@0: +// modification, are permitted provided that the following conditions are michael@0: +// met: michael@0: +// michael@0: +// * Redistributions of source code must retain the above copyright michael@0: +// notice, this list of conditions and the following disclaimer. michael@0: +// * Redistributions in binary form must reproduce the above michael@0: +// copyright notice, this list of conditions and the following disclaimer michael@0: +// in the documentation and/or other materials provided with the michael@0: +// distribution. michael@0: +// * Neither the name of Google Inc. nor the names of its michael@0: +// contributors may be used to endorse or promote products derived from michael@0: +// this software without specific prior written permission. michael@0: +// michael@0: +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT michael@0: +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR michael@0: +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT michael@0: +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@0: +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@0: +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, michael@0: +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY michael@0: +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT michael@0: +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE michael@0: +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: + michael@0: +#include michael@0: + michael@0: +#include "processor/pathname_stripper.h" michael@0: +#include "processor/logging.h" michael@0: + michael@0: +#define ASSERT_TRUE(condition) \ michael@0: + if (!(condition)) { \ michael@0: + fprintf(stderr, "FAIL: %s @ %s:%d\n", #condition, __FILE__, __LINE__); \ michael@0: + return false; \ michael@0: + } michael@0: + michael@0: +#define ASSERT_EQ(e1, e2) ASSERT_TRUE((e1) == (e2)) michael@0: + michael@0: +namespace { michael@0: + michael@0: +using google_breakpad::PathnameStripper; michael@0: + michael@0: +static bool RunTests() { michael@0: + ASSERT_EQ(PathnameStripper::File("/dir/file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("\\dir\\file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("/dir\\file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("\\dir/file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("dir/file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("dir\\file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("dir/\\file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("dir\\/file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("dir/"), ""); michael@0: + ASSERT_EQ(PathnameStripper::File("dir\\"), ""); michael@0: + ASSERT_EQ(PathnameStripper::File("dir/dir/"), ""); michael@0: + ASSERT_EQ(PathnameStripper::File("dir\\dir\\"), ""); michael@0: + ASSERT_EQ(PathnameStripper::File("dir1/dir2/file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("dir1\\dir2\\file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("dir1/dir2\\file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("dir1\\dir2/file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File(""), ""); michael@0: + ASSERT_EQ(PathnameStripper::File("1"), "1"); michael@0: + ASSERT_EQ(PathnameStripper::File("1/2"), "2"); michael@0: + ASSERT_EQ(PathnameStripper::File("1\\2"), "2"); michael@0: + ASSERT_EQ(PathnameStripper::File("/1/2"), "2"); michael@0: + ASSERT_EQ(PathnameStripper::File("\\1\\2"), "2"); michael@0: + ASSERT_EQ(PathnameStripper::File("dir//file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("dir\\\\file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("/dir//file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("\\dir\\\\file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("c:\\dir\\file"), "file"); michael@0: + ASSERT_EQ(PathnameStripper::File("c:\\dir\\file.ext"), "file.ext"); michael@0: + michael@0: + return true; michael@0: +} michael@0: + michael@0: +} // namespace michael@0: + michael@0: +int main(int argc, char **argv) { michael@0: + BPLOG_INIT(&argc, &argv); michael@0: + michael@0: + return RunTests() ? 0 : 1; michael@0: +} michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/Makefile.in michael@0: --- a/src/processor/Makefile.in Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/Makefile.in Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -5,44 +5,32 @@ michael@0: DEPTH = @DEPTH@ michael@0: topsrcdir = @top_srcdir@ michael@0: srcdir = @srcdir@ michael@0: VPATH = @srcdir@ michael@0: michael@0: include $(DEPTH)/config/autoconf.mk michael@0: michael@0: LIBRARY_NAME = breakpad_sps_common_s michael@0: -ifdef MOZ_CRASHREPORTER michael@0: -HOST_LIBRARY_NAME = host_breakpad_sps_common_s michael@0: -endif michael@0: michael@0: LOCAL_INCLUDES = -I$(srcdir)/../.. -I$(srcdir)/.. michael@0: michael@0: CPPSRCS = \ michael@0: stackwalker.cc \ michael@0: stackwalker_amd64.cc \ michael@0: stackwalker_arm.cc \ michael@0: stackwalker_ppc.cc \ michael@0: stackwalker_x86.cc \ michael@0: stackwalker_sparc.cc \ michael@0: minidump.cc \ michael@0: basic_source_line_resolver.cc \ michael@0: basic_code_modules.cc \ michael@0: cfi_frame_info.cc \ michael@0: call_stack.cc \ michael@0: - logging.cc \ michael@0: - pathname_stripper.cc \ michael@0: tokenize.cc \ michael@0: source_line_resolver_base.cc \ michael@0: stack_frame_symbolizer.cc \ michael@0: $(NULL) michael@0: michael@0: -ifdef MOZ_CRASHREPORTER michael@0: -HOST_CPPSRCS = \ michael@0: - logging.cc \ michael@0: - pathname_stripper.cc \ michael@0: - $(NULL) michael@0: -endif michael@0: - michael@0: # need static lib michael@0: FORCE_STATIC_LIB = 1 michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/address_map-inl.h michael@0: --- a/src/processor/address_map-inl.h Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/address_map-inl.h Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -35,17 +35,17 @@ michael@0: michael@0: #ifndef PROCESSOR_ADDRESS_MAP_INL_H__ michael@0: #define PROCESSOR_ADDRESS_MAP_INL_H__ michael@0: michael@0: #include "processor/address_map.h" michael@0: michael@0: #include michael@0: michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: template michael@0: bool AddressMap::Store(const AddressType &address, michael@0: const EntryType &entry) { michael@0: // Ensure that the specified address doesn't conflict with something already michael@0: // in the map. michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/basic_code_modules.cc michael@0: --- a/src/processor/basic_code_modules.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/basic_code_modules.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -35,17 +35,17 @@ michael@0: // Author: Mark Mentovai michael@0: michael@0: #include "processor/basic_code_modules.h" michael@0: michael@0: #include michael@0: michael@0: #include "google_breakpad/processor/code_module.h" michael@0: #include "processor/linked_ptr.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: #include "processor/range_map-inl.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: BasicCodeModules::BasicCodeModules(const CodeModules *that) michael@0: : main_address_(0), michael@0: map_(new RangeMap >()) { michael@0: BPLOG_IF(ERROR, !that) << "BasicCodeModules::BasicCodeModules requires " michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/contained_range_map-inl.h michael@0: --- a/src/processor/contained_range_map-inl.h Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/contained_range_map-inl.h Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -35,17 +35,17 @@ michael@0: michael@0: #ifndef PROCESSOR_CONTAINED_RANGE_MAP_INL_H__ michael@0: #define PROCESSOR_CONTAINED_RANGE_MAP_INL_H__ michael@0: michael@0: #include "processor/contained_range_map.h" michael@0: michael@0: #include michael@0: michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: michael@0: template michael@0: ContainedRangeMap::~ContainedRangeMap() { michael@0: // Clear frees the children pointed to by the map, and frees the map itself. michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/logging.cc michael@0: --- a/src/processor/logging.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 michael@0: @@ -1,115 +0,0 @@ michael@0: -// Copyright (c) 2007, Google Inc. michael@0: -// All rights reserved. michael@0: -// michael@0: -// Redistribution and use in source and binary forms, with or without michael@0: -// modification, are permitted provided that the following conditions are michael@0: -// met: michael@0: -// michael@0: -// * Redistributions of source code must retain the above copyright michael@0: -// notice, this list of conditions and the following disclaimer. michael@0: -// * Redistributions in binary form must reproduce the above michael@0: -// copyright notice, this list of conditions and the following disclaimer michael@0: -// in the documentation and/or other materials provided with the michael@0: -// distribution. michael@0: -// * Neither the name of Google Inc. nor the names of its michael@0: -// contributors may be used to endorse or promote products derived from michael@0: -// this software without specific prior written permission. michael@0: -// michael@0: -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT michael@0: -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR michael@0: -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT michael@0: -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@0: -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@0: -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, michael@0: -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY michael@0: -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT michael@0: -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE michael@0: -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: - michael@0: -// logging.cc: Breakpad logging michael@0: -// michael@0: -// See logging.h for documentation. michael@0: -// michael@0: -// Author: Mark Mentovai michael@0: - michael@0: -#include michael@0: -#include michael@0: -#include michael@0: -#include michael@0: -#include michael@0: - michael@0: -#include michael@0: - michael@0: -#include "common/using_std_string.h" michael@0: -#include "processor/logging.h" michael@0: -#include "processor/pathname_stripper.h" michael@0: - michael@0: -#ifdef _WIN32 michael@0: -#define snprintf _snprintf michael@0: -#endif michael@0: - michael@0: -namespace google_breakpad { michael@0: - michael@0: -LogStream::LogStream(std::ostream &stream, Severity severity, michael@0: - const char *file, int line) michael@0: - : stream_(stream) { michael@0: - time_t clock; michael@0: - time(&clock); michael@0: - struct tm tm_struct; michael@0: -#ifdef _WIN32 michael@0: - localtime_s(&tm_struct, &clock); michael@0: -#else michael@0: - localtime_r(&clock, &tm_struct); michael@0: -#endif michael@0: - char time_string[20]; michael@0: - strftime(time_string, sizeof(time_string), "%Y-%m-%d %H:%M:%S", &tm_struct); michael@0: - michael@0: - const char *severity_string = "UNKNOWN_SEVERITY"; michael@0: - switch (severity) { michael@0: - case SEVERITY_INFO: michael@0: - severity_string = "INFO"; michael@0: - break; michael@0: - case SEVERITY_ERROR: michael@0: - severity_string = "ERROR"; michael@0: - break; michael@0: - } michael@0: - michael@0: - stream_ << time_string << ": " << PathnameStripper::File(file) << ":" << michael@0: - line << ": " << severity_string << ": "; michael@0: -} michael@0: - michael@0: -LogStream::~LogStream() { michael@0: - stream_ << std::endl; michael@0: -} michael@0: - michael@0: -string HexString(uint32_t number) { michael@0: - char buffer[11]; michael@0: - snprintf(buffer, sizeof(buffer), "0x%x", number); michael@0: - return string(buffer); michael@0: -} michael@0: - michael@0: -string HexString(uint64_t number) { michael@0: - char buffer[19]; michael@0: - snprintf(buffer, sizeof(buffer), "0x%" PRIx64, number); michael@0: - return string(buffer); michael@0: -} michael@0: - michael@0: -string HexString(int number) { michael@0: - char buffer[19]; michael@0: - snprintf(buffer, sizeof(buffer), "0x%x", number); michael@0: - return string(buffer); michael@0: -} michael@0: - michael@0: -int ErrnoString(string *error_string) { michael@0: - assert(error_string); michael@0: - michael@0: - // strerror isn't necessarily thread-safe. strerror_r would be preferrable, michael@0: - // but GNU libc uses a nonstandard strerror_r by default, which returns a michael@0: - // char* (rather than an int success indicator) and doesn't necessarily michael@0: - // use the supplied buffer. michael@0: - error_string->assign(strerror(errno)); michael@0: - return errno; michael@0: -} michael@0: - michael@0: -} // namespace google_breakpad michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/logging.h michael@0: --- a/src/processor/logging.h Thu Apr 04 21:00:31 2013 +0200 michael@0: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 michael@0: @@ -1,175 +0,0 @@ michael@0: -// Copyright (c) 2007, Google Inc. michael@0: -// All rights reserved. michael@0: -// michael@0: -// Redistribution and use in source and binary forms, with or without michael@0: -// modification, are permitted provided that the following conditions are michael@0: -// met: michael@0: -// michael@0: -// * Redistributions of source code must retain the above copyright michael@0: -// notice, this list of conditions and the following disclaimer. michael@0: -// * Redistributions in binary form must reproduce the above michael@0: -// copyright notice, this list of conditions and the following disclaimer michael@0: -// in the documentation and/or other materials provided with the michael@0: -// distribution. michael@0: -// * Neither the name of Google Inc. nor the names of its michael@0: -// contributors may be used to endorse or promote products derived from michael@0: -// this software without specific prior written permission. michael@0: -// michael@0: -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT michael@0: -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR michael@0: -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT michael@0: -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@0: -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@0: -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, michael@0: -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY michael@0: -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT michael@0: -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE michael@0: -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: - michael@0: -// logging.h: Breakpad logging michael@0: -// michael@0: -// Breakpad itself uses Breakpad logging with statements of the form: michael@0: -// BPLOG(severity) << "message"; michael@0: -// severity may be INFO, ERROR, or other values defined in this file. michael@0: -// michael@0: -// BPLOG is an overridable macro so that users can customize Breakpad's michael@0: -// logging. Left at the default, logging messages are sent to stderr along michael@0: -// with a timestamp and the source code location that produced a message. michael@0: -// The streams may be changed by redefining BPLOG_*_STREAM, the logging michael@0: -// behavior may be changed by redefining BPLOG_*, and the entire logging michael@0: -// system may be overridden by redefining BPLOG(severity). These michael@0: -// redefinitions may be passed to the preprocessor as a command-line flag michael@0: -// (-D). michael@0: -// michael@0: -// If an additional header is required to override Breakpad logging, it can michael@0: -// be specified by the BP_LOGGING_INCLUDE macro. If defined, this header michael@0: -// will #include the header specified by that macro. michael@0: -// michael@0: -// If any initialization is needed before logging, it can be performed by michael@0: -// a function called through the BPLOG_INIT macro. Each main function of michael@0: -// an executable program in the Breakpad processor library calls michael@0: -// BPLOG_INIT(&argc, &argv); before any logging can be performed; define michael@0: -// BPLOG_INIT appropriately if initialization is required. michael@0: -// michael@0: -// Author: Mark Mentovai michael@0: - michael@0: -#ifndef PROCESSOR_LOGGING_H__ michael@0: -#define PROCESSOR_LOGGING_H__ michael@0: - michael@0: -#include michael@0: -#include michael@0: - michael@0: -#include "common/using_std_string.h" michael@0: -#include "google_breakpad/common/breakpad_types.h" michael@0: - michael@0: -#ifdef BP_LOGGING_INCLUDE michael@0: -#include BP_LOGGING_INCLUDE michael@0: -#endif // BP_LOGGING_INCLUDE michael@0: - michael@0: -#ifndef THIRD_PARTY_BREAKPAD_GOOGLE_GLUE_LOGGING_H_ michael@0: -namespace base_logging { michael@0: - michael@0: -// The open-source copy of logging.h has diverged from Google's internal copy michael@0: -// (temporarily, at least). To support the transition to structured logging michael@0: -// a definition for base_logging::LogMessage is needed, which is a ostream- michael@0: -// like object for streaming arguments to construct a log message. michael@0: -typedef std::ostream LogMessage; michael@0: - michael@0: -} // namespace base_logging michael@0: -#endif // THIRD_PARTY_BREAKPAD_GOOGLE_GLUE_LOGGING_H_ michael@0: - michael@0: -namespace google_breakpad { michael@0: - michael@0: -// These are defined in Microsoft headers. michael@0: -#ifdef SEVERITY_ERROR michael@0: -#undef SEVERITY_ERROR michael@0: -#endif michael@0: - michael@0: -#ifdef ERROR michael@0: -#undef ERROR michael@0: -#endif michael@0: - michael@0: -class LogStream { michael@0: - public: michael@0: - enum Severity { michael@0: - SEVERITY_INFO, michael@0: - SEVERITY_ERROR michael@0: - }; michael@0: - michael@0: - // Begin logging a message to the stream identified by |stream|, at the michael@0: - // indicated severity. The file and line parameters should be set so as to michael@0: - // identify the line of source code that is producing a message. michael@0: - LogStream(std::ostream &stream, Severity severity, michael@0: - const char *file, int line); michael@0: - michael@0: - // Finish logging by printing a newline and flushing the output stream. michael@0: - ~LogStream(); michael@0: - michael@0: - template std::ostream& operator<<(const T &t) { michael@0: - return stream_ << t; michael@0: - } michael@0: - michael@0: - private: michael@0: - std::ostream &stream_; michael@0: - michael@0: - // Disallow copy constructor and assignment operator michael@0: - explicit LogStream(const LogStream &that); michael@0: - void operator=(const LogStream &that); michael@0: -}; michael@0: - michael@0: -// This class is used to explicitly ignore values in the conditional logging michael@0: -// macros. This avoids compiler warnings like "value computed is not used" michael@0: -// and "statement has no effect". michael@0: -class LogMessageVoidify { michael@0: - public: michael@0: - LogMessageVoidify() {} michael@0: - michael@0: - // This has to be an operator with a precedence lower than << but higher michael@0: - // than ?: michael@0: - void operator&(base_logging::LogMessage &) {} michael@0: -}; michael@0: - michael@0: -// Returns number formatted as a hexadecimal string, such as "0x7b". michael@0: -string HexString(uint32_t number); michael@0: -string HexString(uint64_t number); michael@0: -string HexString(int number); michael@0: - michael@0: -// Returns the error code as set in the global errno variable, and sets michael@0: -// error_string, a required argument, to a string describing that error michael@0: -// code. michael@0: -int ErrnoString(string *error_string); michael@0: - michael@0: -} // namespace google_breakpad michael@0: - michael@0: -#ifndef BPLOG_INIT michael@0: -#define BPLOG_INIT(pargc, pargv) michael@0: -#endif // BPLOG_INIT michael@0: - michael@0: -#ifndef BPLOG michael@0: -#define BPLOG(severity) BPLOG_ ## severity michael@0: -#endif // BPLOG michael@0: - michael@0: -#ifndef BPLOG_INFO michael@0: -#ifndef BPLOG_INFO_STREAM michael@0: -#define BPLOG_INFO_STREAM std::clog michael@0: -#endif // BPLOG_INFO_STREAM michael@0: -#define BPLOG_INFO google_breakpad::LogStream(BPLOG_INFO_STREAM, \ michael@0: - google_breakpad::LogStream::SEVERITY_INFO, \ michael@0: - __FILE__, __LINE__) michael@0: -#endif // BPLOG_INFO michael@0: - michael@0: -#ifndef BPLOG_ERROR michael@0: -#ifndef BPLOG_ERROR_STREAM michael@0: -#define BPLOG_ERROR_STREAM std::cerr michael@0: -#endif // BPLOG_ERROR_STREAM michael@0: -#define BPLOG_ERROR google_breakpad::LogStream(BPLOG_ERROR_STREAM, \ michael@0: - google_breakpad::LogStream::SEVERITY_ERROR, \ michael@0: - __FILE__, __LINE__) michael@0: -#endif // BPLOG_ERROR michael@0: - michael@0: -#define BPLOG_IF(severity, condition) \ michael@0: - !(condition) ? (void) 0 : \ michael@0: - google_breakpad::LogMessageVoidify() & BPLOG(severity) michael@0: - michael@0: -#endif // PROCESSOR_LOGGING_H__ michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/minidump.cc michael@0: --- a/src/processor/minidump.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/minidump.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -58,17 +58,17 @@ michael@0: #include michael@0: #include michael@0: michael@0: #include "processor/range_map-inl.h" michael@0: michael@0: #include "common/scoped_ptr.h" michael@0: #include "processor/basic_code_module.h" michael@0: #include "processor/basic_code_modules.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: michael@0: michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: michael@0: using std::istream; michael@0: using std::ifstream; michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/pathname_stripper.cc michael@0: --- a/src/processor/pathname_stripper.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 michael@0: @@ -1,56 +0,0 @@ michael@0: -// Copyright (c) 2006, Google Inc. michael@0: -// All rights reserved. michael@0: -// michael@0: -// Redistribution and use in source and binary forms, with or without michael@0: -// modification, are permitted provided that the following conditions are michael@0: -// met: michael@0: -// michael@0: -// * Redistributions of source code must retain the above copyright michael@0: -// notice, this list of conditions and the following disclaimer. michael@0: -// * Redistributions in binary form must reproduce the above michael@0: -// copyright notice, this list of conditions and the following disclaimer michael@0: -// in the documentation and/or other materials provided with the michael@0: -// distribution. michael@0: -// * Neither the name of Google Inc. nor the names of its michael@0: -// contributors may be used to endorse or promote products derived from michael@0: -// this software without specific prior written permission. michael@0: -// michael@0: -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT michael@0: -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR michael@0: -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT michael@0: -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@0: -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@0: -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, michael@0: -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY michael@0: -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT michael@0: -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE michael@0: -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: - michael@0: -// pathname_stripper.cc: Manipulates pathnames into their component parts. michael@0: -// michael@0: -// See pathname_stripper.h for documentation. michael@0: -// michael@0: -// Author: Mark Mentovai michael@0: - michael@0: -#include "processor/pathname_stripper.h" michael@0: - michael@0: -namespace google_breakpad { michael@0: - michael@0: -// static michael@0: -string PathnameStripper::File(const string &path) { michael@0: - string::size_type slash = path.rfind('/'); michael@0: - string::size_type backslash = path.rfind('\\'); michael@0: - michael@0: - string::size_type file_start = 0; michael@0: - if (slash != string::npos && michael@0: - (backslash == string::npos || slash > backslash)) { michael@0: - file_start = slash + 1; michael@0: - } else if (backslash != string::npos) { michael@0: - file_start = backslash + 1; michael@0: - } michael@0: - michael@0: - return path.substr(file_start); michael@0: -} michael@0: - michael@0: -} // namespace google_breakpad michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/pathname_stripper.h michael@0: --- a/src/processor/pathname_stripper.h Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 michael@0: @@ -1,53 +0,0 @@ michael@0: -// Copyright (c) 2006, Google Inc. michael@0: -// All rights reserved. michael@0: -// michael@0: -// Redistribution and use in source and binary forms, with or without michael@0: -// modification, are permitted provided that the following conditions are michael@0: -// met: michael@0: -// michael@0: -// * Redistributions of source code must retain the above copyright michael@0: -// notice, this list of conditions and the following disclaimer. michael@0: -// * Redistributions in binary form must reproduce the above michael@0: -// copyright notice, this list of conditions and the following disclaimer michael@0: -// in the documentation and/or other materials provided with the michael@0: -// distribution. michael@0: -// * Neither the name of Google Inc. nor the names of its michael@0: -// contributors may be used to endorse or promote products derived from michael@0: -// this software without specific prior written permission. michael@0: -// michael@0: -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT michael@0: -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR michael@0: -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT michael@0: -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@0: -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@0: -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, michael@0: -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY michael@0: -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT michael@0: -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE michael@0: -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: - michael@0: -// pathname_stripper.h: Manipulates pathnames into their component parts. michael@0: -// michael@0: -// Author: Mark Mentovai michael@0: - michael@0: -#ifndef PROCESSOR_PATHNAME_STRIPPER_H__ michael@0: -#define PROCESSOR_PATHNAME_STRIPPER_H__ michael@0: - michael@0: -#include michael@0: - michael@0: -#include "common/using_std_string.h" michael@0: - michael@0: -namespace google_breakpad { michael@0: - michael@0: -class PathnameStripper { michael@0: - public: michael@0: - // Given path, a pathname with components separated by slashes (/) or michael@0: - // backslashes (\), returns the trailing component, without any separator. michael@0: - // If path ends in a separator character, returns an empty string. michael@0: - static string File(const string &path); michael@0: -}; michael@0: - michael@0: -} // namespace google_breakpad michael@0: - michael@0: -#endif // PROCESSOR_PATHNAME_STRIPPER_H__ michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/pathname_stripper_unittest.cc michael@0: --- a/src/processor/pathname_stripper_unittest.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 michael@0: @@ -1,87 +0,0 @@ michael@0: -// Copyright (c) 2006, Google Inc. michael@0: -// All rights reserved. michael@0: -// michael@0: -// Redistribution and use in source and binary forms, with or without michael@0: -// modification, are permitted provided that the following conditions are michael@0: -// met: michael@0: -// michael@0: -// * Redistributions of source code must retain the above copyright michael@0: -// notice, this list of conditions and the following disclaimer. michael@0: -// * Redistributions in binary form must reproduce the above michael@0: -// copyright notice, this list of conditions and the following disclaimer michael@0: -// in the documentation and/or other materials provided with the michael@0: -// distribution. michael@0: -// * Neither the name of Google Inc. nor the names of its michael@0: -// contributors may be used to endorse or promote products derived from michael@0: -// this software without specific prior written permission. michael@0: -// michael@0: -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT michael@0: -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR michael@0: -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT michael@0: -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@0: -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@0: -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, michael@0: -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY michael@0: -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT michael@0: -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE michael@0: -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: - michael@0: -#include michael@0: - michael@0: -#include "processor/pathname_stripper.h" michael@0: -#include "processor/logging.h" michael@0: - michael@0: -#define ASSERT_TRUE(condition) \ michael@0: - if (!(condition)) { \ michael@0: - fprintf(stderr, "FAIL: %s @ %s:%d\n", #condition, __FILE__, __LINE__); \ michael@0: - return false; \ michael@0: - } michael@0: - michael@0: -#define ASSERT_EQ(e1, e2) ASSERT_TRUE((e1) == (e2)) michael@0: - michael@0: -namespace { michael@0: - michael@0: -using google_breakpad::PathnameStripper; michael@0: - michael@0: -static bool RunTests() { michael@0: - ASSERT_EQ(PathnameStripper::File("/dir/file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("\\dir\\file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("/dir\\file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("\\dir/file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("dir/file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("dir\\file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("dir/\\file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("dir\\/file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("dir/"), ""); michael@0: - ASSERT_EQ(PathnameStripper::File("dir\\"), ""); michael@0: - ASSERT_EQ(PathnameStripper::File("dir/dir/"), ""); michael@0: - ASSERT_EQ(PathnameStripper::File("dir\\dir\\"), ""); michael@0: - ASSERT_EQ(PathnameStripper::File("dir1/dir2/file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("dir1\\dir2\\file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("dir1/dir2\\file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("dir1\\dir2/file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File(""), ""); michael@0: - ASSERT_EQ(PathnameStripper::File("1"), "1"); michael@0: - ASSERT_EQ(PathnameStripper::File("1/2"), "2"); michael@0: - ASSERT_EQ(PathnameStripper::File("1\\2"), "2"); michael@0: - ASSERT_EQ(PathnameStripper::File("/1/2"), "2"); michael@0: - ASSERT_EQ(PathnameStripper::File("\\1\\2"), "2"); michael@0: - ASSERT_EQ(PathnameStripper::File("dir//file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("dir\\\\file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("/dir//file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("\\dir\\\\file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("c:\\dir\\file"), "file"); michael@0: - ASSERT_EQ(PathnameStripper::File("c:\\dir\\file.ext"), "file.ext"); michael@0: - michael@0: - return true; michael@0: -} michael@0: - michael@0: -} // namespace michael@0: - michael@0: -int main(int argc, char **argv) { michael@0: - BPLOG_INIT(&argc, &argv); michael@0: - michael@0: - return RunTests() ? 0 : 1; michael@0: -} michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/postfix_evaluator-inl.h michael@0: --- a/src/processor/postfix_evaluator-inl.h Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/postfix_evaluator-inl.h Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -41,17 +41,17 @@ michael@0: michael@0: #include "processor/postfix_evaluator.h" michael@0: michael@0: #include michael@0: michael@0: #include michael@0: michael@0: #include "google_breakpad/processor/memory_region.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: using std::istringstream; michael@0: using std::ostringstream; michael@0: michael@0: michael@0: // A small class used in Evaluate to make sure to clean up the stack michael@0: @@ -147,17 +147,17 @@ bool PostfixEvaluator::Evalua michael@0: if (!memory_) { michael@0: BPLOG(ERROR) << "Attempt to dereference without memory: " << michael@0: expression; michael@0: return false; michael@0: } michael@0: michael@0: ValueType address; michael@0: if (!PopValue(&address)) { michael@0: - BPLOG(ERROR) << "Could not PopValue to get value to derefence: " << michael@0: + BPLOG(ERROR) << "Could not PopValue to get value to dereference: " << michael@0: expression; michael@0: return false; michael@0: } michael@0: michael@0: ValueType value; michael@0: if (!memory_->GetMemoryAtAddress(address, &value)) { michael@0: BPLOG(ERROR) << "Could not dereference memory at address " << michael@0: HexString(address) << ": " << expression; michael@0: @@ -305,18 +305,23 @@ bool PostfixEvaluator::Evalua michael@0: case Module::kExprSimple: michael@0: case Module::kExprSimpleMem: { michael@0: // Look up the base value michael@0: bool found = false; michael@0: ValueType v = dictionary_->get(&found, expr.ident_); michael@0: if (!found) { michael@0: // The identifier wasn't found in the dictionary. Don't imply any michael@0: // default value, just fail. michael@0: - BPLOG(INFO) << "Identifier " << FromUniqueString(expr.ident_) michael@0: - << " not in dictionary (kExprSimple{Mem})"; michael@0: + static uint64_t n_complaints = 0; // This isn't threadsafe. michael@0: + n_complaints++; michael@0: + if (is_power_of_2(n_complaints)) { michael@0: + BPLOG(INFO) << "Identifier " << FromUniqueString(expr.ident_) michael@0: + << " not in dictionary (kExprSimple{Mem})" michael@0: + << " (shown " << n_complaints << " times)"; michael@0: + } michael@0: return false; michael@0: } michael@0: michael@0: // Form the sum michael@0: ValueType sum = v + (int64_t)expr.offset_; michael@0: michael@0: // and dereference if necessary michael@0: if (expr.how_ == Module::kExprSimpleMem) { michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/range_map-inl.h michael@0: --- a/src/processor/range_map-inl.h Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/range_map-inl.h Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -35,17 +35,17 @@ michael@0: michael@0: #ifndef PROCESSOR_RANGE_MAP_INL_H__ michael@0: #define PROCESSOR_RANGE_MAP_INL_H__ michael@0: michael@0: michael@0: #include michael@0: michael@0: #include "processor/range_map.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: michael@0: template michael@0: bool RangeMap::StoreRange(const AddressType &base, michael@0: const AddressType &size, michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stack_frame_symbolizer.cc michael@0: --- a/src/processor/stack_frame_symbolizer.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/stack_frame_symbolizer.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -39,17 +39,17 @@ michael@0: #include "common/scoped_ptr.h" michael@0: #include "google_breakpad/processor/code_module.h" michael@0: #include "google_breakpad/processor/code_modules.h" michael@0: #include "google_breakpad/processor/source_line_resolver_interface.h" michael@0: #include "google_breakpad/processor/stack_frame.h" michael@0: #include "google_breakpad/processor/symbol_supplier.h" michael@0: #include "google_breakpad/processor/system_info.h" michael@0: #include "processor/linked_ptr.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: StackFrameSymbolizer::StackFrameSymbolizer( michael@0: SymbolSupplier* supplier, michael@0: SourceLineResolverInterface* resolver) : supplier_(supplier), michael@0: resolver_(resolver) { } michael@0: michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stackwalker.cc michael@0: --- a/src/processor/stackwalker.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/stackwalker.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -41,17 +41,17 @@ michael@0: #include "google_breakpad/processor/call_stack.h" michael@0: #include "google_breakpad/processor/code_module.h" michael@0: #include "google_breakpad/processor/code_modules.h" michael@0: #include "google_breakpad/processor/minidump.h" michael@0: #include "google_breakpad/processor/stack_frame.h" michael@0: #include "google_breakpad/processor/stack_frame_symbolizer.h" michael@0: #include "google_breakpad/processor/system_info.h" michael@0: #include "processor/linked_ptr.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: #include "processor/stackwalker_ppc.h" michael@0: #include "processor/stackwalker_sparc.h" michael@0: #include "processor/stackwalker_x86.h" michael@0: #include "processor/stackwalker_amd64.h" michael@0: #include "processor/stackwalker_arm.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stackwalker_amd64.cc michael@0: --- a/src/processor/stackwalker_amd64.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/stackwalker_amd64.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -36,17 +36,17 @@ michael@0: #include michael@0: michael@0: #include "common/scoped_ptr.h" michael@0: #include "google_breakpad/processor/call_stack.h" michael@0: #include "google_breakpad/processor/memory_region.h" michael@0: #include "google_breakpad/processor/source_line_resolver_interface.h" michael@0: #include "google_breakpad/processor/stack_frame_cpu.h" michael@0: #include "processor/cfi_frame_info.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: #include "processor/stackwalker_amd64.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: michael@0: const StackwalkerAMD64::CFIWalker::RegisterSet michael@0: StackwalkerAMD64::cfi_register_map_[] = { michael@0: // It may seem like $rip and $rsp are callee-saves, because the callee is michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stackwalker_arm.cc michael@0: --- a/src/processor/stackwalker_arm.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/stackwalker_arm.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -36,17 +36,17 @@ michael@0: #include michael@0: michael@0: #include "common/scoped_ptr.h" michael@0: #include "google_breakpad/processor/call_stack.h" michael@0: #include "google_breakpad/processor/memory_region.h" michael@0: #include "google_breakpad/processor/source_line_resolver_interface.h" michael@0: #include "google_breakpad/processor/stack_frame_cpu.h" michael@0: #include "processor/cfi_frame_info.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: #include "processor/stackwalker_arm.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: michael@0: StackwalkerARM::StackwalkerARM(const SystemInfo* system_info, michael@0: const MDRawContextARM* context, michael@0: int fp_register, michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stackwalker_ppc.cc michael@0: --- a/src/processor/stackwalker_ppc.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/stackwalker_ppc.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -33,17 +33,17 @@ michael@0: // michael@0: // Author: Mark Mentovai michael@0: michael@0: michael@0: #include "processor/stackwalker_ppc.h" michael@0: #include "google_breakpad/processor/call_stack.h" michael@0: #include "google_breakpad/processor/memory_region.h" michael@0: #include "google_breakpad/processor/stack_frame_cpu.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: michael@0: StackwalkerPPC::StackwalkerPPC(const SystemInfo* system_info, michael@0: const MDRawContextPPC* context, michael@0: MemoryRegion* memory, michael@0: const CodeModules* modules, michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stackwalker_sparc.cc michael@0: --- a/src/processor/stackwalker_sparc.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/stackwalker_sparc.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -32,17 +32,17 @@ michael@0: // See stackwalker_sparc.h for documentation. michael@0: // michael@0: // Author: Michael Shang michael@0: michael@0: michael@0: #include "google_breakpad/processor/call_stack.h" michael@0: #include "google_breakpad/processor/memory_region.h" michael@0: #include "google_breakpad/processor/stack_frame_cpu.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: #include "processor/stackwalker_sparc.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: michael@0: StackwalkerSPARC::StackwalkerSPARC(const SystemInfo* system_info, michael@0: const MDRawContextSPARC* context, michael@0: MemoryRegion* memory, michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stackwalker_x86.cc michael@0: --- a/src/processor/stackwalker_x86.cc Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/stackwalker_x86.cc Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -37,17 +37,17 @@ michael@0: #include michael@0: michael@0: #include "common/scoped_ptr.h" michael@0: #include "google_breakpad/processor/call_stack.h" michael@0: #include "google_breakpad/processor/code_modules.h" michael@0: #include "google_breakpad/processor/memory_region.h" michael@0: #include "google_breakpad/processor/source_line_resolver_interface.h" michael@0: #include "google_breakpad/processor/stack_frame_cpu.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: #include "processor/postfix_evaluator-inl.h" michael@0: #include "processor/stackwalker_x86.h" michael@0: #include "processor/windows_frame_info.h" michael@0: #include "processor/cfi_frame_info.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/static_address_map-inl.h michael@0: --- a/src/processor/static_address_map-inl.h Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/static_address_map-inl.h Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -33,17 +33,17 @@ michael@0: // michael@0: // Author: Siyang Xie (lambxsy@google.com) michael@0: michael@0: #ifndef PROCESSOR_STATIC_ADDRESS_MAP_INL_H__ michael@0: #define PROCESSOR_STATIC_ADDRESS_MAP_INL_H__ michael@0: michael@0: #include "processor/static_address_map.h" michael@0: michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: template michael@0: bool StaticAddressMap::Retrieve( michael@0: const AddressType &address, michael@0: const EntryType *&entry, AddressType *entry_address) const { michael@0: michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/static_contained_range_map-inl.h michael@0: --- a/src/processor/static_contained_range_map-inl.h Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/static_contained_range_map-inl.h Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -33,17 +33,17 @@ michael@0: // See static_contained_range_map.h for documentation. michael@0: // michael@0: // Author: Siyang Xie (lambxsy@google.com) michael@0: michael@0: #ifndef PROCESSOR_STATIC_CONTAINED_RANGE_MAP_INL_H__ michael@0: #define PROCESSOR_STATIC_CONTAINED_RANGE_MAP_INL_H__ michael@0: michael@0: #include "processor/static_contained_range_map.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: template michael@0: StaticContainedRangeMap::StaticContainedRangeMap( michael@0: const char *base) michael@0: : base_(*(reinterpret_cast(base))), michael@0: entry_size_(*(reinterpret_cast(base + sizeof(base_)))), michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/static_map-inl.h michael@0: --- a/src/processor/static_map-inl.h Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/static_map-inl.h Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -33,17 +33,17 @@ michael@0: // Author: Siyang Xie (lambxsy@google.com) michael@0: michael@0: michael@0: #ifndef PROCESSOR_STATIC_MAP_INL_H__ michael@0: #define PROCESSOR_STATIC_MAP_INL_H__ michael@0: michael@0: #include "processor/static_map.h" michael@0: #include "processor/static_map_iterator-inl.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: template michael@0: StaticMap::StaticMap(const char* raw_data) michael@0: : raw_data_(raw_data), michael@0: compare_() { michael@0: // First 4 Bytes store the number of nodes. michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/static_map_iterator-inl.h michael@0: --- a/src/processor/static_map_iterator-inl.h Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/static_map_iterator-inl.h Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -32,17 +32,17 @@ michael@0: // michael@0: // Author: Siyang Xie (lambxsy@google.com) michael@0: michael@0: #ifndef PROCESSOR_STATIC_MAP_ITERATOR_INL_H__ michael@0: #define PROCESSOR_STATIC_MAP_ITERATOR_INL_H__ michael@0: michael@0: #include "processor/static_map_iterator.h" michael@0: michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: template michael@0: StaticMapIterator::StaticMapIterator(const char* base, michael@0: const int &index): michael@0: index_(index), base_(base) { michael@0: // See static_map.h for documentation on michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/static_range_map-inl.h michael@0: --- a/src/processor/static_range_map-inl.h Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/static_range_map-inl.h Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -32,17 +32,17 @@ michael@0: // See static_range_map.h for documentation. michael@0: // michael@0: // Author: Siyang Xie (lambxsy@google.com) michael@0: michael@0: #ifndef PROCESSOR_STATIC_RANGE_MAP_INL_H__ michael@0: #define PROCESSOR_STATIC_RANGE_MAP_INL_H__ michael@0: michael@0: #include "processor/static_range_map.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: template michael@0: bool StaticRangeMap::RetrieveRange( michael@0: const AddressType &address, const EntryType *&entry, michael@0: AddressType *entry_base, AddressType *entry_size) const { michael@0: MapConstIterator iterator = map_.lower_bound(address); michael@0: diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/windows_frame_info.h michael@0: --- a/src/processor/windows_frame_info.h Thu Mar 28 18:38:05 2013 +0100 michael@0: +++ b/src/processor/windows_frame_info.h Thu Mar 28 18:06:39 2013 +0100 michael@0: @@ -41,17 +41,17 @@ michael@0: #include michael@0: #include michael@0: michael@0: #include michael@0: #include michael@0: michael@0: #include "common/using_std_string.h" michael@0: #include "google_breakpad/common/breakpad_types.h" michael@0: -#include "processor/logging.h" michael@0: +#include "common/logging.h" michael@0: #include "processor/tokenize.h" michael@0: michael@0: namespace google_breakpad { michael@0: michael@0: #ifdef _WIN32 michael@0: #define strtoull _strtoui64 michael@0: #endif michael@0: