toolkit/crashreporter/breakpad-patches/10-logging.patch

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/crashreporter/breakpad-patches/10-logging.patch	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,1963 @@
     1.4 +changeset:   126589:636cfcab9682
     1.5 +user:        Julian Seward <jseward@acm.org>
     1.6 +date:        Thu Mar 28 18:06:39 2013 +0100
     1.7 +summary:     Bug 853851 - Transition some breakpad logging to BPLOG.  r=ted
     1.8 +
     1.9 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/dwarf_cfi_to_module.cc
    1.10 +--- a/src/common/dwarf_cfi_to_module.cc	Thu Mar 28 18:38:05 2013 +0100
    1.11 ++++ b/src/common/dwarf_cfi_to_module.cc	Thu Mar 28 18:06:39 2013 +0100
    1.12 +@@ -30,18 +30,20 @@
    1.13 + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.14 + 
    1.15 + // Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
    1.16 + 
    1.17 + // Implementation of google_breakpad::DwarfCFIToModule.
    1.18 + // See dwarf_cfi_to_module.h for details.
    1.19 + 
    1.20 + #include <sstream>
    1.21 ++#include <iomanip>
    1.22 + 
    1.23 + #include "common/dwarf_cfi_to_module.h"
    1.24 ++#include "common/logging.h"
    1.25 + 
    1.26 + namespace google_breakpad {
    1.27 + 
    1.28 + using std::ostringstream;
    1.29 + 
    1.30 + vector<const UniqueString*> DwarfCFIToModule::RegisterNames::MakeVector(
    1.31 +     const char* const* strings,
    1.32 +     size_t size) {
    1.33 +@@ -226,36 +228,42 @@ bool DwarfCFIToModule::ValExpressionRule
    1.34 + 
    1.35 + bool DwarfCFIToModule::End() {
    1.36 +   module_->AddStackFrameEntry(entry_);
    1.37 +   entry_ = NULL;
    1.38 +   return true;
    1.39 + }
    1.40 + 
    1.41 + void DwarfCFIToModule::Reporter::UnnamedRegister(size_t offset, int reg) {
    1.42 +-  fprintf(stderr, "%s, section '%s': "
    1.43 +-          "the call frame entry at offset 0x%zx refers to register %d,"
    1.44 +-          " whose name we don't know\n",
    1.45 +-          file_.c_str(), section_.c_str(), offset, reg);
    1.46 ++  BPLOG(INFO) << file_ << ", section '" << section_ 
    1.47 ++    << "': the call frame entry at offset 0x" 
    1.48 ++    << std::setbase(16) << offset << std::setbase(10)
    1.49 ++    << " refers to register " << reg << ", whose name we don't know";
    1.50 + }
    1.51 + 
    1.52 + void DwarfCFIToModule::Reporter::UndefinedNotSupported(
    1.53 +     size_t offset,
    1.54 +     const UniqueString* reg) {
    1.55 +-  fprintf(stderr, "%s, section '%s': "
    1.56 +-          "the call frame entry at offset 0x%zx sets the rule for "
    1.57 +-          "register '%s' to 'undefined', but the Breakpad symbol file format"
    1.58 +-          " cannot express this\n",
    1.59 +-          file_.c_str(), section_.c_str(), offset, FromUniqueString(reg));
    1.60 ++  BPLOG(INFO) << file_ << ", section '" << section_ 
    1.61 ++    << "': the call frame entry at offset 0x" 
    1.62 ++    << std::setbase(16) << offset << std::setbase(10)
    1.63 ++    << " sets the rule for register '" << FromUniqueString(reg)
    1.64 ++    << "' to 'undefined', but the Breakpad symbol file format cannot "
    1.65 ++    << " express this";
    1.66 + }
    1.67 + 
    1.68 + void DwarfCFIToModule::Reporter::ExpressionsNotSupported(
    1.69 +     size_t offset,
    1.70 +     const UniqueString* reg) {
    1.71 +-  fprintf(stderr, "%s, section '%s': "
    1.72 +-          "the call frame entry at offset 0x%zx uses a DWARF expression to"
    1.73 +-          " describe how to recover register '%s', "
    1.74 +-          " but this translator cannot yet translate DWARF expressions to"
    1.75 +-          " Breakpad postfix expressions\n",
    1.76 +-          file_.c_str(), section_.c_str(), offset, FromUniqueString(reg));
    1.77 ++  static uint64_t n_complaints = 0; // This isn't threadsafe
    1.78 ++  n_complaints++;
    1.79 ++  if (!is_power_of_2(n_complaints))
    1.80 ++    return;
    1.81 ++  BPLOG(INFO) << file_ << ", section '" << section_ 
    1.82 ++    << "': the call frame entry at offset 0x" 
    1.83 ++    << std::setbase(16) << offset << std::setbase(10)
    1.84 ++    << " uses a DWARF expression to describe how to recover register '"
    1.85 ++    << FromUniqueString(reg) << "', but this translator cannot yet "
    1.86 ++    << "translate DWARF expressions to Breakpad postfix expressions (shown "
    1.87 ++    << n_complaints << " times)";
    1.88 + }
    1.89 + 
    1.90 + } // namespace google_breakpad
    1.91 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/dwarf_cu_to_module.cc
    1.92 +--- a/src/common/dwarf_cu_to_module.cc	Thu Mar 28 18:38:05 2013 +0100
    1.93 ++++ b/src/common/dwarf_cu_to_module.cc	Thu Mar 28 18:06:39 2013 +0100
    1.94 +@@ -38,23 +38,24 @@
    1.95 + 
    1.96 + #include "common/dwarf_cu_to_module.h"
    1.97 + 
    1.98 + #include <assert.h>
    1.99 + #if !defined(__ANDROID__)
   1.100 + #include <cxxabi.h>
   1.101 + #endif
   1.102 + #include <inttypes.h>
   1.103 +-#include <stdio.h>
   1.104 + 
   1.105 + #include <algorithm>
   1.106 + #include <set>
   1.107 + #include <utility>
   1.108 ++#include <iomanip>
   1.109 + 
   1.110 + #include "common/dwarf_line_to_module.h"
   1.111 ++#include "common/logging.h"
   1.112 + 
   1.113 + namespace google_breakpad {
   1.114 + 
   1.115 + using std::map;
   1.116 + using std::pair;
   1.117 + using std::set;
   1.118 + using std::sort;
   1.119 + using std::vector;
   1.120 +@@ -553,84 +554,89 @@ dwarf2reader::DIEHandler *DwarfCUToModul
   1.121 +     default:
   1.122 +       return NULL;
   1.123 +   }
   1.124 + }
   1.125 + 
   1.126 + void DwarfCUToModule::WarningReporter::CUHeading() {
   1.127 +   if (printed_cu_header_)
   1.128 +     return;
   1.129 +-  fprintf(stderr, "%s: in compilation unit '%s' (offset 0x%llx):\n",
   1.130 +-          filename_.c_str(), cu_name_.c_str(), cu_offset_);
   1.131 ++  BPLOG(INFO)
   1.132 ++    << filename_ << ": in compilation unit '" << cu_name_
   1.133 ++    << "' (offset 0x" << std::setbase(16) << cu_offset_ << std::setbase(10)
   1.134 ++    << "):";
   1.135 +   printed_cu_header_ = true;
   1.136 + }
   1.137 + 
   1.138 + void DwarfCUToModule::WarningReporter::UnknownSpecification(uint64 offset,
   1.139 +                                                             uint64 target) {
   1.140 +   CUHeading();
   1.141 +-  fprintf(stderr, "%s: the DIE at offset 0x%llx has a DW_AT_specification"
   1.142 +-          " attribute referring to the die at offset 0x%llx, which either"
   1.143 +-          " was not marked as a declaration, or comes later in the file\n",
   1.144 +-          filename_.c_str(), offset, target);
   1.145 ++  BPLOG(INFO)
   1.146 ++    << filename_ << ": the DIE at offset 0x" 
   1.147 ++    << std::setbase(16) << offset << std::setbase(10)
   1.148 ++    << " has a DW_AT_specification attribute referring to the die at offset 0x"
   1.149 ++    << std::setbase(16) << target << std::setbase(10)
   1.150 ++    << ", which either was not marked as a declaration, or comes "
   1.151 ++    << "later in the file";
   1.152 + }
   1.153 + 
   1.154 + void DwarfCUToModule::WarningReporter::UnknownAbstractOrigin(uint64 offset,
   1.155 +                                                              uint64 target) {
   1.156 +   CUHeading();
   1.157 +-  fprintf(stderr, "%s: the DIE at offset 0x%llx has a DW_AT_abstract_origin"
   1.158 +-          " attribute referring to the die at offset 0x%llx, which either"
   1.159 +-          " was not marked as an inline, or comes later in the file\n",
   1.160 +-          filename_.c_str(), offset, target);
   1.161 ++  BPLOG(INFO)
   1.162 ++    << filename_ << ": the DIE at offset 0x" 
   1.163 ++    << std::setbase(16) << offset << std::setbase(10)
   1.164 ++    << " has a DW_AT_abstract_origin attribute referring to the die at"
   1.165 ++    << " offset 0x" << std::setbase(16) << target << std::setbase(10)
   1.166 ++    << ", which either was not marked as an inline, or comes "
   1.167 ++    << "later in the file";
   1.168 + }
   1.169 + 
   1.170 + void DwarfCUToModule::WarningReporter::MissingSection(const string &name) {
   1.171 +   CUHeading();
   1.172 +-  fprintf(stderr, "%s: warning: couldn't find DWARF '%s' section\n",
   1.173 +-          filename_.c_str(), name.c_str());
   1.174 ++  BPLOG(INFO) << filename_ << ": warning: couldn't find DWARF '"
   1.175 ++    << name << "' section";
   1.176 + }
   1.177 + 
   1.178 + void DwarfCUToModule::WarningReporter::BadLineInfoOffset(uint64 offset) {
   1.179 +   CUHeading();
   1.180 +-  fprintf(stderr, "%s: warning: line number data offset beyond end"
   1.181 +-          " of '.debug_line' section\n",
   1.182 +-          filename_.c_str());
   1.183 ++  BPLOG(INFO) << filename_ << ": warning: line number data offset beyond "
   1.184 ++    << "end of '.debug_line' section";
   1.185 + }
   1.186 + 
   1.187 + void DwarfCUToModule::WarningReporter::UncoveredHeading() {
   1.188 +   if (printed_unpaired_header_)
   1.189 +     return;
   1.190 +   CUHeading();
   1.191 +-  fprintf(stderr, "%s: warning: skipping unpaired lines/functions:\n",
   1.192 +-          filename_.c_str());
   1.193 ++  BPLOG(INFO) << filename_ << ": warning: skipping unpaired lines/functions:";
   1.194 +   printed_unpaired_header_ = true;
   1.195 + }
   1.196 + 
   1.197 + void DwarfCUToModule::WarningReporter::UncoveredFunction(
   1.198 +     const Module::Function &function) {
   1.199 +   if (!uncovered_warnings_enabled_)
   1.200 +     return;
   1.201 +   UncoveredHeading();
   1.202 +-  fprintf(stderr, "    function%s: %s\n",
   1.203 +-          function.size == 0 ? " (zero-length)" : "",
   1.204 +-          function.name.c_str());
   1.205 ++  BPLOG(INFO) << "    function" << (function.size == 0 ? " (zero-length)" : "")
   1.206 ++    << ": " << function.name;
   1.207 + }
   1.208 + 
   1.209 + void DwarfCUToModule::WarningReporter::UncoveredLine(const Module::Line &line) {
   1.210 +   if (!uncovered_warnings_enabled_)
   1.211 +     return;
   1.212 +   UncoveredHeading();
   1.213 +-  fprintf(stderr, "    line%s: %s:%d at 0x%" PRIx64 "\n",
   1.214 +-          (line.size == 0 ? " (zero-length)" : ""),
   1.215 +-          line.file->name.c_str(), line.number, line.address);
   1.216 ++  BPLOG(INFO) << "    line" << (line.size == 0 ? " (zero-length)" : "")
   1.217 ++    << ": " << line.file->name << ":" << line.number
   1.218 ++    << " at 0x" << std::setbase(16) << line.address << std::setbase(10);
   1.219 + }
   1.220 + 
   1.221 + void DwarfCUToModule::WarningReporter::UnnamedFunction(uint64 offset) {
   1.222 +   CUHeading();
   1.223 +-  fprintf(stderr, "%s: warning: function at offset 0x%llx has no name\n",
   1.224 +-          filename_.c_str(), offset);
   1.225 ++  BPLOG(INFO) << filename_ << ": warning: function at offset 0x"
   1.226 ++    << std::setbase(16) << offset << std::setbase(10) << " has no name";
   1.227 + }
   1.228 + 
   1.229 + DwarfCUToModule::DwarfCUToModule(FileContext *file_context,
   1.230 +                                  LineToModuleHandler *line_reader,
   1.231 +                                  WarningReporter *reporter)
   1.232 +     : line_reader_(line_reader), has_source_line_info_(false) { 
   1.233 +   cu_context_ = new CUContext(file_context, reporter);
   1.234 +   child_context_ = new DIEContext();
   1.235 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/dwarf_line_to_module.cc
   1.236 +--- a/src/common/dwarf_line_to_module.cc	Thu Mar 28 18:38:05 2013 +0100
   1.237 ++++ b/src/common/dwarf_line_to_module.cc	Thu Mar 28 18:06:39 2013 +0100
   1.238 +@@ -27,22 +27,21 @@
   1.239 + // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   1.240 + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   1.241 + 
   1.242 + // Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
   1.243 + 
   1.244 + // dwarf_line_to_module.cc: Implementation of DwarfLineToModule class.
   1.245 + // See dwarf_line_to_module.h for details. 
   1.246 + 
   1.247 +-#include <stdio.h>
   1.248 +-
   1.249 + #include <string>
   1.250 + 
   1.251 + #include "common/dwarf_line_to_module.h"
   1.252 + #include "common/using_std_string.h"
   1.253 ++#include "common/logging.h"
   1.254 + 
   1.255 + // Trying to support Windows paths in a reasonable way adds a lot of
   1.256 + // variations to test; it would be better to just put off dealing with
   1.257 + // it until we actually have to deal with DWARF on Windows.
   1.258 + 
   1.259 + // Return true if PATH is an absolute path, false if it is relative.
   1.260 + static bool PathIsAbsolute(const string &path) {
   1.261 +   return (path.size() >= 1 && path[0] == '/');
   1.262 +@@ -84,18 +83,18 @@ void DwarfLineToModule::DefineFile(const
   1.263 +     // an attribute on the compilation unit, rather than in the program table.
   1.264 +     dir_name = compilation_dir_;
   1.265 +   } else {
   1.266 +     DirectoryTable::const_iterator directory_it = directories_.find(dir_num);
   1.267 +     if (directory_it != directories_.end()) {
   1.268 +       dir_name = directory_it->second;
   1.269 +     } else {
   1.270 +       if (!warned_bad_directory_number_) {
   1.271 +-        fprintf(stderr, "warning: DWARF line number data refers to undefined"
   1.272 +-                " directory numbers\n");
   1.273 ++        BPLOG(INFO) << "warning: DWARF line number data refers to undefined"
   1.274 ++                    << " directory numbers";
   1.275 +         warned_bad_directory_number_ = true;
   1.276 +       }
   1.277 +     }
   1.278 +   }
   1.279 + 
   1.280 +   string full_name = ExpandPath(name, dir_name);
   1.281 + 
   1.282 +   // Find a Module::File object of the given name, and add it to the
   1.283 +@@ -120,18 +119,18 @@ void DwarfLineToModule::AddLine(uint64 a
   1.284 +   } else {
   1.285 +     omitted_line_end_ = 0;
   1.286 +   }
   1.287 + 
   1.288 +   // Find the source file being referred to.
   1.289 +   Module::File *file = files_[file_num];
   1.290 +   if (!file) {
   1.291 +     if (!warned_bad_file_number_) {
   1.292 +-      fprintf(stderr, "warning: DWARF line number data refers to "
   1.293 +-              "undefined file numbers\n");
   1.294 ++      BPLOG(INFO) << "warning: DWARF line number data refers to "
   1.295 ++                  << "undefined file numbers";
   1.296 +       warned_bad_file_number_ = true;
   1.297 +     }
   1.298 +     return;
   1.299 +   }
   1.300 +   Module::Line line;
   1.301 +   line.address = address;
   1.302 +   // We set the size when we get the next line or the EndSequence call.
   1.303 +   line.size = length;
   1.304 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/linux/dump_symbols.cc
   1.305 +--- a/src/common/linux/dump_symbols.cc	Thu Mar 28 18:38:05 2013 +0100
   1.306 ++++ b/src/common/linux/dump_symbols.cc	Thu Mar 28 18:06:39 2013 +0100
   1.307 +@@ -63,16 +63,17 @@
   1.308 + #include "common/linux/file_id.h"
   1.309 + #include "common/module.h"
   1.310 + #include "common/scoped_ptr.h"
   1.311 + #ifndef NO_STABS_SUPPORT
   1.312 + #include "common/stabs_reader.h"
   1.313 + #include "common/stabs_to_module.h"
   1.314 + #endif
   1.315 + #include "common/using_std_string.h"
   1.316 ++#include "common/logging.h"
   1.317 + 
   1.318 + // This namespace contains helper functions.
   1.319 + namespace {
   1.320 + 
   1.321 + using google_breakpad::DwarfCFIToModule;
   1.322 + using google_breakpad::DwarfCUToModule;
   1.323 + using google_breakpad::DwarfLineToModule;
   1.324 + using google_breakpad::ElfClass;
   1.325 +@@ -523,16 +524,19 @@ bool LoadSymbols(const string& obj_file,
   1.326 +                  const bool read_gnu_debug_link,
   1.327 +                  LoadSymbolsInfo<ElfClass>* info,
   1.328 +                  SymbolData symbol_data,
   1.329 +                  Module* module) {
   1.330 +   typedef typename ElfClass::Addr Addr;
   1.331 +   typedef typename ElfClass::Phdr Phdr;
   1.332 +   typedef typename ElfClass::Shdr Shdr;
   1.333 + 
   1.334 ++  BPLOG(INFO) << "";
   1.335 ++  BPLOG(INFO) << "LoadSymbols: BEGIN   " << obj_file;
   1.336 ++
   1.337 +   Addr loading_addr = GetLoadingAddress<ElfClass>(
   1.338 +       GetOffset<ElfClass, Phdr>(elf_header, elf_header->e_phoff),
   1.339 +       elf_header->e_phnum);
   1.340 +   module->SetLoadAddress(loading_addr);
   1.341 +   info->set_loading_addr(loading_addr, obj_file);
   1.342 + 
   1.343 +   const Shdr* sections =
   1.344 +       GetOffset<ElfClass, Shdr>(elf_header, elf_header->e_shoff);
   1.345 +@@ -592,16 +596,18 @@ bool LoadSymbols(const string& obj_file,
   1.346 +       // information, the other debugging information could be perfectly
   1.347 +       // useful.
   1.348 +       info->LoadedSection(".debug_frame");
   1.349 +       bool result =
   1.350 +           LoadDwarfCFI<ElfClass>(obj_file, elf_header, ".debug_frame",
   1.351 +                                  dwarf_cfi_section, false, 0, 0, big_endian,
   1.352 +                                  module);
   1.353 +       found_usable_info = found_usable_info || result;
   1.354 ++      if (result)
   1.355 ++        BPLOG(INFO) << "LoadSymbols:   read CFI from .debug_frame";
   1.356 +     }
   1.357 + 
   1.358 +     // Linux C++ exception handling information can also provide
   1.359 +     // unwinding data.
   1.360 +     const Shdr* eh_frame_section =
   1.361 +         FindElfSectionByName<ElfClass>(".eh_frame", SHT_PROGBITS,
   1.362 +                                        sections, names, names_end,
   1.363 +                                        elf_header->e_shnum);
   1.364 +@@ -618,16 +624,18 @@ bool LoadSymbols(const string& obj_file,
   1.365 +                                          elf_header->e_shnum);
   1.366 +       info->LoadedSection(".eh_frame");
   1.367 +       // As above, ignore the return value of this function.
   1.368 +       bool result =
   1.369 +           LoadDwarfCFI<ElfClass>(obj_file, elf_header, ".eh_frame",
   1.370 +                                  eh_frame_section, true,
   1.371 +                                  got_section, text_section, big_endian, module);
   1.372 +       found_usable_info = found_usable_info || result;
   1.373 ++      if (result)
   1.374 ++        BPLOG(INFO) << "LoadSymbols:   read CFI from .eh_frame";
   1.375 +     }
   1.376 +   }
   1.377 + 
   1.378 +   if (!found_debug_info_section && symbol_data != ONLY_CFI) {
   1.379 +     fprintf(stderr, "%s: file contains no debugging information"
   1.380 +             " (no \".stab\" or \".debug_info\" sections)\n",
   1.381 +             obj_file.c_str());
   1.382 + 
   1.383 +@@ -685,24 +693,29 @@ bool LoadSymbols(const string& obj_file,
   1.384 +                                  ElfClass::kAddrSize,
   1.385 +                                  module);
   1.386 +           found_usable_info = found_usable_info || result;
   1.387 +         }
   1.388 +       }
   1.389 + 
   1.390 +       // Return true if some usable information was found, since
   1.391 +       // the caller doesn't want to use .gnu_debuglink.
   1.392 ++      BPLOG(INFO) << "LoadSymbols: " 
   1.393 ++                  << (found_usable_info ? "SUCCESS " : "FAILURE ")
   1.394 ++                  << obj_file;
   1.395 +       return found_usable_info;
   1.396 +     }
   1.397 + 
   1.398 +     // No debug info was found, let the user try again with .gnu_debuglink
   1.399 +     // if present.
   1.400 ++    BPLOG(INFO) << "LoadSymbols: FAILURE " << obj_file;
   1.401 +     return false;
   1.402 +   }
   1.403 + 
   1.404 ++  BPLOG(INFO) << "LoadSymbols: SUCCESS " << obj_file;
   1.405 +   return true;
   1.406 + }
   1.407 + 
   1.408 + // Return the breakpad symbol file identifier for the architecture of
   1.409 + // ELF_HEADER.
   1.410 + template<typename ElfClass>
   1.411 + const char* ElfArchitecture(const typename ElfClass::Ehdr* elf_header) {
   1.412 +   typedef typename ElfClass::Half Half;
   1.413 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/logging.cc
   1.414 +--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   1.415 ++++ b/src/common/logging.cc	Thu Mar 28 18:06:39 2013 +0100
   1.416 +@@ -0,0 +1,139 @@
   1.417 ++// Copyright (c) 2007, Google Inc.
   1.418 ++// All rights reserved.
   1.419 ++//
   1.420 ++// Redistribution and use in source and binary forms, with or without
   1.421 ++// modification, are permitted provided that the following conditions are
   1.422 ++// met:
   1.423 ++//
   1.424 ++//     * Redistributions of source code must retain the above copyright
   1.425 ++// notice, this list of conditions and the following disclaimer.
   1.426 ++//     * Redistributions in binary form must reproduce the above
   1.427 ++// copyright notice, this list of conditions and the following disclaimer
   1.428 ++// in the documentation and/or other materials provided with the
   1.429 ++// distribution.
   1.430 ++//     * Neither the name of Google Inc. nor the names of its
   1.431 ++// contributors may be used to endorse or promote products derived from
   1.432 ++// this software without specific prior written permission.
   1.433 ++//
   1.434 ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   1.435 ++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   1.436 ++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   1.437 ++// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   1.438 ++// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   1.439 ++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   1.440 ++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   1.441 ++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   1.442 ++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   1.443 ++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   1.444 ++// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   1.445 ++
   1.446 ++// logging.cc: Breakpad logging
   1.447 ++//
   1.448 ++// See logging.h for documentation.
   1.449 ++//
   1.450 ++// Author: Mark Mentovai
   1.451 ++
   1.452 ++#include <assert.h>
   1.453 ++#include <errno.h>
   1.454 ++#include <stdio.h>
   1.455 ++#include <string.h>
   1.456 ++#include <time.h>
   1.457 ++
   1.458 ++#include <string>
   1.459 ++
   1.460 ++#include "common/using_std_string.h"
   1.461 ++#include "common/logging.h"
   1.462 ++#include "common/pathname_stripper.h"
   1.463 ++
   1.464 ++#ifdef _WIN32
   1.465 ++#define snprintf _snprintf
   1.466 ++#endif
   1.467 ++
   1.468 ++#ifdef __ANDROID__
   1.469 ++# include <android/log.h>
   1.470 ++#endif
   1.471 ++
   1.472 ++namespace google_breakpad {
   1.473 ++
   1.474 ++LogStream::LogStream(std::ostream &stream, Severity severity,
   1.475 ++                     const char *file, int line)
   1.476 ++    : stream_(stream) {
   1.477 ++  time_t clock;
   1.478 ++  time(&clock);
   1.479 ++  struct tm tm_struct;
   1.480 ++#ifdef _WIN32
   1.481 ++  localtime_s(&tm_struct, &clock);
   1.482 ++#else
   1.483 ++  localtime_r(&clock, &tm_struct);
   1.484 ++#endif
   1.485 ++  char time_string[20];
   1.486 ++  strftime(time_string, sizeof(time_string), "%Y-%m-%d %H:%M:%S", &tm_struct);
   1.487 ++
   1.488 ++  const char *severity_string = "UNKNOWN_SEVERITY";
   1.489 ++  switch (severity) {
   1.490 ++    case SEVERITY_INFO:
   1.491 ++      severity_string = "INFO";
   1.492 ++      break;
   1.493 ++    case SEVERITY_ERROR:
   1.494 ++      severity_string = "ERROR";
   1.495 ++      break;
   1.496 ++  }
   1.497 ++
   1.498 ++  str_ << time_string << ": " << PathnameStripper::File(file) << ":" <<
   1.499 ++          line << ": " << severity_string << ": ";
   1.500 ++}
   1.501 ++
   1.502 ++LogStream::~LogStream() {
   1.503 ++#ifdef __ANDROID__
   1.504 ++  __android_log_print(ANDROID_LOG_ERROR,
   1.505 ++                      "Profiler", "%s", str_.str().c_str());
   1.506 ++#else
   1.507 ++  stream_ << str_.str();
   1.508 ++  stream_ << std::endl;
   1.509 ++#endif
   1.510 ++}
   1.511 ++
   1.512 ++string HexString(uint32_t number) {
   1.513 ++  char buffer[11];
   1.514 ++  snprintf(buffer, sizeof(buffer), "0x%x", number);
   1.515 ++  return string(buffer);
   1.516 ++}
   1.517 ++
   1.518 ++string HexString(uint64_t number) {
   1.519 ++  char buffer[19];
   1.520 ++  snprintf(buffer, sizeof(buffer), "0x%" PRIx64, number);
   1.521 ++  return string(buffer);
   1.522 ++}
   1.523 ++
   1.524 ++string HexString(int number) {
   1.525 ++  char buffer[19];
   1.526 ++  snprintf(buffer, sizeof(buffer), "0x%x", number);
   1.527 ++  return string(buffer);
   1.528 ++}
   1.529 ++
   1.530 ++int ErrnoString(string *error_string) {
   1.531 ++  assert(error_string);
   1.532 ++
   1.533 ++  // strerror isn't necessarily thread-safe.  strerror_r would be preferrable,
   1.534 ++  // but GNU libc uses a nonstandard strerror_r by default, which returns a
   1.535 ++  // char* (rather than an int success indicator) and doesn't necessarily
   1.536 ++  // use the supplied buffer.
   1.537 ++  error_string->assign(strerror(errno));
   1.538 ++  return errno;
   1.539 ++}
   1.540 ++
   1.541 ++}  // namespace google_breakpad
   1.542 ++
   1.543 ++bool is_power_of_2(uint64_t x_in)
   1.544 ++{
   1.545 ++  uint64_t x = x_in;
   1.546 ++  x = x | (x >> 1);
   1.547 ++  x = x | (x >> 2);
   1.548 ++  x = x | (x >> 4);
   1.549 ++  x = x | (x >> 8);
   1.550 ++  x = x | (x >> 16);
   1.551 ++  x = x | (x >> 32);
   1.552 ++  x = x - (x >> 1);
   1.553 ++  // x has now been rounded down to the nearest power of 2 <= x_in.
   1.554 ++  return x == x_in;
   1.555 ++}
   1.556 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/logging.h
   1.557 +--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   1.558 ++++ b/src/common/logging.h	Thu Apr 04 21:02:11 2013 +0200
   1.559 +@@ -0,0 +1,182 @@
   1.560 ++// Copyright (c) 2007, Google Inc.
   1.561 ++// All rights reserved.
   1.562 ++//
   1.563 ++// Redistribution and use in source and binary forms, with or without
   1.564 ++// modification, are permitted provided that the following conditions are
   1.565 ++// met:
   1.566 ++//
   1.567 ++//     * Redistributions of source code must retain the above copyright
   1.568 ++// notice, this list of conditions and the following disclaimer.
   1.569 ++//     * Redistributions in binary form must reproduce the above
   1.570 ++// copyright notice, this list of conditions and the following disclaimer
   1.571 ++// in the documentation and/or other materials provided with the
   1.572 ++// distribution.
   1.573 ++//     * Neither the name of Google Inc. nor the names of its
   1.574 ++// contributors may be used to endorse or promote products derived from
   1.575 ++// this software without specific prior written permission.
   1.576 ++//
   1.577 ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   1.578 ++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   1.579 ++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   1.580 ++// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   1.581 ++// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   1.582 ++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   1.583 ++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   1.584 ++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   1.585 ++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   1.586 ++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   1.587 ++// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   1.588 ++
   1.589 ++// logging.h: Breakpad logging
   1.590 ++//
   1.591 ++// Breakpad itself uses Breakpad logging with statements of the form:
   1.592 ++//   BPLOG(severity) << "message";
   1.593 ++// severity may be INFO, ERROR, or other values defined in this file.
   1.594 ++//
   1.595 ++// BPLOG is an overridable macro so that users can customize Breakpad's
   1.596 ++// logging.  Left at the default, logging messages are sent to stderr along
   1.597 ++// with a timestamp and the source code location that produced a message.
   1.598 ++// The streams may be changed by redefining BPLOG_*_STREAM, the logging
   1.599 ++// behavior may be changed by redefining BPLOG_*, and the entire logging
   1.600 ++// system may be overridden by redefining BPLOG(severity).  These
   1.601 ++// redefinitions may be passed to the preprocessor as a command-line flag
   1.602 ++// (-D).
   1.603 ++//
   1.604 ++// If an additional header is required to override Breakpad logging, it can
   1.605 ++// be specified by the BP_LOGGING_INCLUDE macro.  If defined, this header
   1.606 ++// will #include the header specified by that macro.
   1.607 ++//
   1.608 ++// If any initialization is needed before logging, it can be performed by
   1.609 ++// a function called through the BPLOG_INIT macro.  Each main function of
   1.610 ++// an executable program in the Breakpad processor library calls
   1.611 ++// BPLOG_INIT(&argc, &argv); before any logging can be performed; define
   1.612 ++// BPLOG_INIT appropriately if initialization is required.
   1.613 ++//
   1.614 ++// Author: Mark Mentovai
   1.615 ++
   1.616 ++#ifndef PROCESSOR_LOGGING_H__
   1.617 ++#define PROCESSOR_LOGGING_H__
   1.618 ++
   1.619 ++#include <iostream>
   1.620 ++#include <sstream>
   1.621 ++#include <string>
   1.622 ++
   1.623 ++#include "common/using_std_string.h"
   1.624 ++#include "google_breakpad/common/breakpad_types.h"
   1.625 ++
   1.626 ++#ifdef BP_LOGGING_INCLUDE
   1.627 ++#include BP_LOGGING_INCLUDE
   1.628 ++#endif  // BP_LOGGING_INCLUDE
   1.629 ++
   1.630 ++#ifndef THIRD_PARTY_BREAKPAD_GOOGLE_GLUE_LOGGING_H_
   1.631 ++namespace base_logging {
   1.632 ++
   1.633 ++// The open-source copy of logging.h has diverged from Google's internal copy
   1.634 ++// (temporarily, at least).  To support the transition to structured logging
   1.635 ++// a definition for base_logging::LogMessage is needed, which is a ostream-
   1.636 ++// like object for streaming arguments to construct a log message.
   1.637 ++typedef std::ostream LogMessage;
   1.638 ++
   1.639 ++}  // namespace base_logging
   1.640 ++#endif  // THIRD_PARTY_BREAKPAD_GOOGLE_GLUE_LOGGING_H_
   1.641 ++
   1.642 ++namespace google_breakpad {
   1.643 ++
   1.644 ++// These are defined in Microsoft headers.
   1.645 ++#ifdef SEVERITY_ERROR
   1.646 ++#undef SEVERITY_ERROR
   1.647 ++#endif
   1.648 ++
   1.649 ++#ifdef ERROR
   1.650 ++#undef ERROR
   1.651 ++#endif
   1.652 ++
   1.653 ++class LogStream {
   1.654 ++ public:
   1.655 ++  enum Severity {
   1.656 ++    SEVERITY_INFO,
   1.657 ++    SEVERITY_ERROR
   1.658 ++  };
   1.659 ++
   1.660 ++  // Begin logging a message to the stream identified by |stream|, at the
   1.661 ++  // indicated severity.  The file and line parameters should be set so as to
   1.662 ++  // identify the line of source code that is producing a message.
   1.663 ++  LogStream(std::ostream &stream, Severity severity,
   1.664 ++            const char *file, int line);
   1.665 ++
   1.666 ++  // Finish logging by printing a newline and flushing the output stream.
   1.667 ++  ~LogStream();
   1.668 ++
   1.669 ++  // Accumulate text in the str_.  It will be emitted to stream_ when
   1.670 ++  // the object is destructed.
   1.671 ++  template<typename T> std::ostream& operator<<(const T &t) {
   1.672 ++    return str_ << t;
   1.673 ++  }
   1.674 ++
   1.675 ++ private:
   1.676 ++  std::ostream &stream_;
   1.677 ++  std::ostringstream str_;
   1.678 ++
   1.679 ++  // Disallow copy constructor and assignment operator
   1.680 ++  explicit LogStream(const LogStream &that);
   1.681 ++  void operator=(const LogStream &that);
   1.682 ++};
   1.683 ++
   1.684 ++// This class is used to explicitly ignore values in the conditional logging
   1.685 ++// macros.  This avoids compiler warnings like "value computed is not used"
   1.686 ++// and "statement has no effect".
   1.687 ++class LogMessageVoidify {
   1.688 ++ public:
   1.689 ++  LogMessageVoidify() {}
   1.690 ++
   1.691 ++  // This has to be an operator with a precedence lower than << but higher
   1.692 ++  // than ?:
   1.693 ++  void operator&(base_logging::LogMessage &) {}
   1.694 ++};
   1.695 ++
   1.696 ++// Returns number formatted as a hexadecimal string, such as "0x7b".
   1.697 ++string HexString(uint32_t number);
   1.698 ++string HexString(uint64_t number);
   1.699 ++string HexString(int number);
   1.700 ++
   1.701 ++// Returns the error code as set in the global errno variable, and sets
   1.702 ++// error_string, a required argument, to a string describing that error
   1.703 ++// code.
   1.704 ++int ErrnoString(string *error_string);
   1.705 ++
   1.706 ++}  // namespace google_breakpad
   1.707 ++
   1.708 ++// Useful for doing exponential backoff of error reporting
   1.709 ++bool is_power_of_2(uint64_t);
   1.710 ++
   1.711 ++#ifndef BPLOG_INIT
   1.712 ++#define BPLOG_INIT(pargc, pargv)
   1.713 ++#endif  // BPLOG_INIT
   1.714 ++
   1.715 ++#ifndef BPLOG
   1.716 ++#define BPLOG(severity) BPLOG_ ## severity
   1.717 ++#endif  // BPLOG
   1.718 ++
   1.719 ++#ifndef BPLOG_INFO
   1.720 ++#ifndef BPLOG_INFO_STREAM
   1.721 ++#define BPLOG_INFO_STREAM std::clog
   1.722 ++#endif  // BPLOG_INFO_STREAM
   1.723 ++#define BPLOG_INFO google_breakpad::LogStream(BPLOG_INFO_STREAM, \
   1.724 ++                       google_breakpad::LogStream::SEVERITY_INFO, \
   1.725 ++                       __FILE__, __LINE__)
   1.726 ++#endif  // BPLOG_INFO
   1.727 ++
   1.728 ++#ifndef BPLOG_ERROR
   1.729 ++#ifndef BPLOG_ERROR_STREAM
   1.730 ++#define BPLOG_ERROR_STREAM std::cerr
   1.731 ++#endif  // BPLOG_ERROR_STREAM
   1.732 ++#define BPLOG_ERROR google_breakpad::LogStream(BPLOG_ERROR_STREAM, \
   1.733 ++                        google_breakpad::LogStream::SEVERITY_ERROR, \
   1.734 ++                        __FILE__, __LINE__)
   1.735 ++#endif  // BPLOG_ERROR
   1.736 ++
   1.737 ++#define BPLOG_IF(severity, condition) \
   1.738 ++    !(condition) ? (void) 0 : \
   1.739 ++                   google_breakpad::LogMessageVoidify() & BPLOG(severity)
   1.740 ++
   1.741 ++#endif  // PROCESSOR_LOGGING_H__
   1.742 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/pathname_stripper.cc
   1.743 +--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   1.744 ++++ b/src/common/pathname_stripper.cc	Thu Mar 28 18:06:39 2013 +0100
   1.745 +@@ -0,0 +1,56 @@
   1.746 ++// Copyright (c) 2006, Google Inc.
   1.747 ++// All rights reserved.
   1.748 ++//
   1.749 ++// Redistribution and use in source and binary forms, with or without
   1.750 ++// modification, are permitted provided that the following conditions are
   1.751 ++// met:
   1.752 ++//
   1.753 ++//     * Redistributions of source code must retain the above copyright
   1.754 ++// notice, this list of conditions and the following disclaimer.
   1.755 ++//     * Redistributions in binary form must reproduce the above
   1.756 ++// copyright notice, this list of conditions and the following disclaimer
   1.757 ++// in the documentation and/or other materials provided with the
   1.758 ++// distribution.
   1.759 ++//     * Neither the name of Google Inc. nor the names of its
   1.760 ++// contributors may be used to endorse or promote products derived from
   1.761 ++// this software without specific prior written permission.
   1.762 ++//
   1.763 ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   1.764 ++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   1.765 ++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   1.766 ++// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   1.767 ++// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   1.768 ++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   1.769 ++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   1.770 ++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   1.771 ++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   1.772 ++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   1.773 ++// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   1.774 ++
   1.775 ++// pathname_stripper.cc: Manipulates pathnames into their component parts.
   1.776 ++//
   1.777 ++// See pathname_stripper.h for documentation.
   1.778 ++//
   1.779 ++// Author: Mark Mentovai
   1.780 ++
   1.781 ++#include "common/pathname_stripper.h"
   1.782 ++
   1.783 ++namespace google_breakpad {
   1.784 ++
   1.785 ++// static
   1.786 ++string PathnameStripper::File(const string &path) {
   1.787 ++  string::size_type slash = path.rfind('/');
   1.788 ++  string::size_type backslash = path.rfind('\\');
   1.789 ++
   1.790 ++  string::size_type file_start = 0;
   1.791 ++  if (slash != string::npos &&
   1.792 ++      (backslash == string::npos || slash > backslash)) {
   1.793 ++    file_start = slash + 1;
   1.794 ++  } else if (backslash != string::npos) {
   1.795 ++    file_start = backslash + 1;
   1.796 ++  }
   1.797 ++
   1.798 ++  return path.substr(file_start);
   1.799 ++}
   1.800 ++
   1.801 ++}  // namespace google_breakpad
   1.802 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/pathname_stripper.h
   1.803 +--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   1.804 ++++ b/src/common/pathname_stripper.h	Thu Mar 28 18:06:39 2013 +0100
   1.805 +@@ -0,0 +1,53 @@
   1.806 ++// Copyright (c) 2006, Google Inc.
   1.807 ++// All rights reserved.
   1.808 ++//
   1.809 ++// Redistribution and use in source and binary forms, with or without
   1.810 ++// modification, are permitted provided that the following conditions are
   1.811 ++// met:
   1.812 ++//
   1.813 ++//     * Redistributions of source code must retain the above copyright
   1.814 ++// notice, this list of conditions and the following disclaimer.
   1.815 ++//     * Redistributions in binary form must reproduce the above
   1.816 ++// copyright notice, this list of conditions and the following disclaimer
   1.817 ++// in the documentation and/or other materials provided with the
   1.818 ++// distribution.
   1.819 ++//     * Neither the name of Google Inc. nor the names of its
   1.820 ++// contributors may be used to endorse or promote products derived from
   1.821 ++// this software without specific prior written permission.
   1.822 ++//
   1.823 ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   1.824 ++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   1.825 ++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   1.826 ++// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   1.827 ++// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   1.828 ++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   1.829 ++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   1.830 ++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   1.831 ++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   1.832 ++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   1.833 ++// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   1.834 ++
   1.835 ++// pathname_stripper.h: Manipulates pathnames into their component parts.
   1.836 ++//
   1.837 ++// Author: Mark Mentovai
   1.838 ++
   1.839 ++#ifndef PROCESSOR_PATHNAME_STRIPPER_H__
   1.840 ++#define PROCESSOR_PATHNAME_STRIPPER_H__
   1.841 ++
   1.842 ++#include <string>
   1.843 ++
   1.844 ++#include "common/using_std_string.h"
   1.845 ++
   1.846 ++namespace google_breakpad {
   1.847 ++
   1.848 ++class PathnameStripper {
   1.849 ++ public:
   1.850 ++  // Given path, a pathname with components separated by slashes (/) or
   1.851 ++  // backslashes (\), returns the trailing component, without any separator.
   1.852 ++  // If path ends in a separator character, returns an empty string.
   1.853 ++  static string File(const string &path);
   1.854 ++};
   1.855 ++
   1.856 ++}  // namespace google_breakpad
   1.857 ++
   1.858 ++#endif  // PROCESSOR_PATHNAME_STRIPPER_H__
   1.859 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/common/pathname_stripper_unittest.cc
   1.860 +--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   1.861 ++++ b/src/common/pathname_stripper_unittest.cc	Thu Mar 28 18:06:39 2013 +0100
   1.862 +@@ -0,0 +1,87 @@
   1.863 ++// Copyright (c) 2006, Google Inc.
   1.864 ++// All rights reserved.
   1.865 ++//
   1.866 ++// Redistribution and use in source and binary forms, with or without
   1.867 ++// modification, are permitted provided that the following conditions are
   1.868 ++// met:
   1.869 ++//
   1.870 ++//     * Redistributions of source code must retain the above copyright
   1.871 ++// notice, this list of conditions and the following disclaimer.
   1.872 ++//     * Redistributions in binary form must reproduce the above
   1.873 ++// copyright notice, this list of conditions and the following disclaimer
   1.874 ++// in the documentation and/or other materials provided with the
   1.875 ++// distribution.
   1.876 ++//     * Neither the name of Google Inc. nor the names of its
   1.877 ++// contributors may be used to endorse or promote products derived from
   1.878 ++// this software without specific prior written permission.
   1.879 ++//
   1.880 ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   1.881 ++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   1.882 ++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   1.883 ++// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   1.884 ++// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   1.885 ++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   1.886 ++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   1.887 ++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   1.888 ++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   1.889 ++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   1.890 ++// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   1.891 ++
   1.892 ++#include <stdio.h>
   1.893 ++
   1.894 ++#include "processor/pathname_stripper.h"
   1.895 ++#include "processor/logging.h"
   1.896 ++
   1.897 ++#define ASSERT_TRUE(condition) \
   1.898 ++  if (!(condition)) { \
   1.899 ++    fprintf(stderr, "FAIL: %s @ %s:%d\n", #condition, __FILE__, __LINE__); \
   1.900 ++    return false; \
   1.901 ++  }
   1.902 ++
   1.903 ++#define ASSERT_EQ(e1, e2) ASSERT_TRUE((e1) == (e2))
   1.904 ++
   1.905 ++namespace {
   1.906 ++
   1.907 ++using google_breakpad::PathnameStripper;
   1.908 ++
   1.909 ++static bool RunTests() {
   1.910 ++  ASSERT_EQ(PathnameStripper::File("/dir/file"), "file");
   1.911 ++  ASSERT_EQ(PathnameStripper::File("\\dir\\file"), "file");
   1.912 ++  ASSERT_EQ(PathnameStripper::File("/dir\\file"), "file");
   1.913 ++  ASSERT_EQ(PathnameStripper::File("\\dir/file"), "file");
   1.914 ++  ASSERT_EQ(PathnameStripper::File("dir/file"), "file");
   1.915 ++  ASSERT_EQ(PathnameStripper::File("dir\\file"), "file");
   1.916 ++  ASSERT_EQ(PathnameStripper::File("dir/\\file"), "file");
   1.917 ++  ASSERT_EQ(PathnameStripper::File("dir\\/file"), "file");
   1.918 ++  ASSERT_EQ(PathnameStripper::File("file"), "file");
   1.919 ++  ASSERT_EQ(PathnameStripper::File("dir/"), "");
   1.920 ++  ASSERT_EQ(PathnameStripper::File("dir\\"), "");
   1.921 ++  ASSERT_EQ(PathnameStripper::File("dir/dir/"), "");
   1.922 ++  ASSERT_EQ(PathnameStripper::File("dir\\dir\\"), "");
   1.923 ++  ASSERT_EQ(PathnameStripper::File("dir1/dir2/file"), "file");
   1.924 ++  ASSERT_EQ(PathnameStripper::File("dir1\\dir2\\file"), "file");
   1.925 ++  ASSERT_EQ(PathnameStripper::File("dir1/dir2\\file"), "file");
   1.926 ++  ASSERT_EQ(PathnameStripper::File("dir1\\dir2/file"), "file");
   1.927 ++  ASSERT_EQ(PathnameStripper::File(""), "");
   1.928 ++  ASSERT_EQ(PathnameStripper::File("1"), "1");
   1.929 ++  ASSERT_EQ(PathnameStripper::File("1/2"), "2");
   1.930 ++  ASSERT_EQ(PathnameStripper::File("1\\2"), "2");
   1.931 ++  ASSERT_EQ(PathnameStripper::File("/1/2"), "2");
   1.932 ++  ASSERT_EQ(PathnameStripper::File("\\1\\2"), "2");
   1.933 ++  ASSERT_EQ(PathnameStripper::File("dir//file"), "file");
   1.934 ++  ASSERT_EQ(PathnameStripper::File("dir\\\\file"), "file");
   1.935 ++  ASSERT_EQ(PathnameStripper::File("/dir//file"), "file");
   1.936 ++  ASSERT_EQ(PathnameStripper::File("\\dir\\\\file"), "file");
   1.937 ++  ASSERT_EQ(PathnameStripper::File("c:\\dir\\file"), "file");
   1.938 ++  ASSERT_EQ(PathnameStripper::File("c:\\dir\\file.ext"), "file.ext");
   1.939 ++
   1.940 ++  return true;
   1.941 ++}
   1.942 ++
   1.943 ++}  // namespace
   1.944 ++
   1.945 ++int main(int argc, char **argv) {
   1.946 ++  BPLOG_INIT(&argc, &argv);
   1.947 ++
   1.948 ++  return RunTests() ? 0 : 1;
   1.949 ++}
   1.950 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/Makefile.in
   1.951 +--- a/src/processor/Makefile.in	Thu Mar 28 18:38:05 2013 +0100
   1.952 ++++ b/src/processor/Makefile.in	Thu Mar 28 18:06:39 2013 +0100
   1.953 +@@ -5,44 +5,32 @@
   1.954 + DEPTH		= @DEPTH@
   1.955 + topsrcdir	= @top_srcdir@
   1.956 + srcdir		= @srcdir@
   1.957 + VPATH		= @srcdir@
   1.958 + 
   1.959 + include $(DEPTH)/config/autoconf.mk
   1.960 + 
   1.961 + LIBRARY_NAME	= breakpad_sps_common_s
   1.962 +-ifdef MOZ_CRASHREPORTER
   1.963 +-HOST_LIBRARY_NAME = host_breakpad_sps_common_s
   1.964 +-endif
   1.965 + 
   1.966 + LOCAL_INCLUDES 	= -I$(srcdir)/../.. -I$(srcdir)/..
   1.967 + 
   1.968 + CPPSRCS	= \
   1.969 +   stackwalker.cc \
   1.970 +   stackwalker_amd64.cc \
   1.971 +   stackwalker_arm.cc \
   1.972 +   stackwalker_ppc.cc \
   1.973 +   stackwalker_x86.cc \
   1.974 +   stackwalker_sparc.cc \
   1.975 +   minidump.cc \
   1.976 +   basic_source_line_resolver.cc \
   1.977 +   basic_code_modules.cc \
   1.978 +   cfi_frame_info.cc \
   1.979 +   call_stack.cc \
   1.980 +-  logging.cc \
   1.981 +-  pathname_stripper.cc \
   1.982 +   tokenize.cc \
   1.983 +   source_line_resolver_base.cc \
   1.984 +   stack_frame_symbolizer.cc \
   1.985 +   $(NULL)
   1.986 + 
   1.987 +-ifdef MOZ_CRASHREPORTER
   1.988 +-HOST_CPPSRCS = \
   1.989 +-  logging.cc \
   1.990 +-  pathname_stripper.cc \
   1.991 +-  $(NULL)
   1.992 +-endif
   1.993 +-
   1.994 + # need static lib
   1.995 + FORCE_STATIC_LIB = 1
   1.996 + 
   1.997 + include $(topsrcdir)/config/rules.mk
   1.998 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/address_map-inl.h
   1.999 +--- a/src/processor/address_map-inl.h	Thu Mar 28 18:38:05 2013 +0100
  1.1000 ++++ b/src/processor/address_map-inl.h	Thu Mar 28 18:06:39 2013 +0100
  1.1001 +@@ -35,17 +35,17 @@
  1.1002 + 
  1.1003 + #ifndef PROCESSOR_ADDRESS_MAP_INL_H__
  1.1004 + #define PROCESSOR_ADDRESS_MAP_INL_H__
  1.1005 + 
  1.1006 + #include "processor/address_map.h"
  1.1007 + 
  1.1008 + #include <assert.h>
  1.1009 + 
  1.1010 +-#include "processor/logging.h"
  1.1011 ++#include "common/logging.h"
  1.1012 + 
  1.1013 + namespace google_breakpad {
  1.1014 + 
  1.1015 + template<typename AddressType, typename EntryType>
  1.1016 + bool AddressMap<AddressType, EntryType>::Store(const AddressType &address,
  1.1017 +                                                const EntryType &entry) {
  1.1018 +   // Ensure that the specified address doesn't conflict with something already
  1.1019 +   // in the map.
  1.1020 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/basic_code_modules.cc
  1.1021 +--- a/src/processor/basic_code_modules.cc	Thu Mar 28 18:38:05 2013 +0100
  1.1022 ++++ b/src/processor/basic_code_modules.cc	Thu Mar 28 18:06:39 2013 +0100
  1.1023 +@@ -35,17 +35,17 @@
  1.1024 + // Author: Mark Mentovai
  1.1025 + 
  1.1026 + #include "processor/basic_code_modules.h"
  1.1027 + 
  1.1028 + #include <assert.h>
  1.1029 + 
  1.1030 + #include "google_breakpad/processor/code_module.h"
  1.1031 + #include "processor/linked_ptr.h"
  1.1032 +-#include "processor/logging.h"
  1.1033 ++#include "common/logging.h"
  1.1034 + #include "processor/range_map-inl.h"
  1.1035 + 
  1.1036 + namespace google_breakpad {
  1.1037 + 
  1.1038 + BasicCodeModules::BasicCodeModules(const CodeModules *that)
  1.1039 +     : main_address_(0),
  1.1040 +       map_(new RangeMap<uint64_t, linked_ptr<const CodeModule> >()) {
  1.1041 +   BPLOG_IF(ERROR, !that) << "BasicCodeModules::BasicCodeModules requires "
  1.1042 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/contained_range_map-inl.h
  1.1043 +--- a/src/processor/contained_range_map-inl.h	Thu Mar 28 18:38:05 2013 +0100
  1.1044 ++++ b/src/processor/contained_range_map-inl.h	Thu Mar 28 18:06:39 2013 +0100
  1.1045 +@@ -35,17 +35,17 @@
  1.1046 + 
  1.1047 + #ifndef PROCESSOR_CONTAINED_RANGE_MAP_INL_H__
  1.1048 + #define PROCESSOR_CONTAINED_RANGE_MAP_INL_H__
  1.1049 + 
  1.1050 + #include "processor/contained_range_map.h"
  1.1051 + 
  1.1052 + #include <assert.h>
  1.1053 + 
  1.1054 +-#include "processor/logging.h"
  1.1055 ++#include "common/logging.h"
  1.1056 + 
  1.1057 + 
  1.1058 + namespace google_breakpad {
  1.1059 + 
  1.1060 + 
  1.1061 + template<typename AddressType, typename EntryType>
  1.1062 + ContainedRangeMap<AddressType, EntryType>::~ContainedRangeMap() {
  1.1063 +   // Clear frees the children pointed to by the map, and frees the map itself.
  1.1064 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/logging.cc
  1.1065 +--- a/src/processor/logging.cc	Thu Mar 28 18:38:05 2013 +0100
  1.1066 ++++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1.1067 +@@ -1,115 +0,0 @@
  1.1068 +-// Copyright (c) 2007, Google Inc.
  1.1069 +-// All rights reserved.
  1.1070 +-//
  1.1071 +-// Redistribution and use in source and binary forms, with or without
  1.1072 +-// modification, are permitted provided that the following conditions are
  1.1073 +-// met:
  1.1074 +-//
  1.1075 +-//     * Redistributions of source code must retain the above copyright
  1.1076 +-// notice, this list of conditions and the following disclaimer.
  1.1077 +-//     * Redistributions in binary form must reproduce the above
  1.1078 +-// copyright notice, this list of conditions and the following disclaimer
  1.1079 +-// in the documentation and/or other materials provided with the
  1.1080 +-// distribution.
  1.1081 +-//     * Neither the name of Google Inc. nor the names of its
  1.1082 +-// contributors may be used to endorse or promote products derived from
  1.1083 +-// this software without specific prior written permission.
  1.1084 +-//
  1.1085 +-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  1.1086 +-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  1.1087 +-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1.1088 +-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  1.1089 +-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  1.1090 +-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  1.1091 +-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  1.1092 +-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  1.1093 +-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  1.1094 +-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  1.1095 +-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1.1096 +-
  1.1097 +-// logging.cc: Breakpad logging
  1.1098 +-//
  1.1099 +-// See logging.h for documentation.
  1.1100 +-//
  1.1101 +-// Author: Mark Mentovai
  1.1102 +-
  1.1103 +-#include <assert.h>
  1.1104 +-#include <errno.h>
  1.1105 +-#include <stdio.h>
  1.1106 +-#include <string.h>
  1.1107 +-#include <time.h>
  1.1108 +-
  1.1109 +-#include <string>
  1.1110 +-
  1.1111 +-#include "common/using_std_string.h"
  1.1112 +-#include "processor/logging.h"
  1.1113 +-#include "processor/pathname_stripper.h"
  1.1114 +-
  1.1115 +-#ifdef _WIN32
  1.1116 +-#define snprintf _snprintf
  1.1117 +-#endif
  1.1118 +-
  1.1119 +-namespace google_breakpad {
  1.1120 +-
  1.1121 +-LogStream::LogStream(std::ostream &stream, Severity severity,
  1.1122 +-                     const char *file, int line)
  1.1123 +-    : stream_(stream) {
  1.1124 +-  time_t clock;
  1.1125 +-  time(&clock);
  1.1126 +-  struct tm tm_struct;
  1.1127 +-#ifdef _WIN32
  1.1128 +-  localtime_s(&tm_struct, &clock);
  1.1129 +-#else
  1.1130 +-  localtime_r(&clock, &tm_struct);
  1.1131 +-#endif
  1.1132 +-  char time_string[20];
  1.1133 +-  strftime(time_string, sizeof(time_string), "%Y-%m-%d %H:%M:%S", &tm_struct);
  1.1134 +-
  1.1135 +-  const char *severity_string = "UNKNOWN_SEVERITY";
  1.1136 +-  switch (severity) {
  1.1137 +-    case SEVERITY_INFO:
  1.1138 +-      severity_string = "INFO";
  1.1139 +-      break;
  1.1140 +-    case SEVERITY_ERROR:
  1.1141 +-      severity_string = "ERROR";
  1.1142 +-      break;
  1.1143 +-  }
  1.1144 +-
  1.1145 +-  stream_ << time_string << ": " << PathnameStripper::File(file) << ":" <<
  1.1146 +-             line << ": " << severity_string << ": ";
  1.1147 +-}
  1.1148 +-
  1.1149 +-LogStream::~LogStream() {
  1.1150 +-  stream_ << std::endl;
  1.1151 +-}
  1.1152 +-
  1.1153 +-string HexString(uint32_t number) {
  1.1154 +-  char buffer[11];
  1.1155 +-  snprintf(buffer, sizeof(buffer), "0x%x", number);
  1.1156 +-  return string(buffer);
  1.1157 +-}
  1.1158 +-
  1.1159 +-string HexString(uint64_t number) {
  1.1160 +-  char buffer[19];
  1.1161 +-  snprintf(buffer, sizeof(buffer), "0x%" PRIx64, number);
  1.1162 +-  return string(buffer);
  1.1163 +-}
  1.1164 +-
  1.1165 +-string HexString(int number) {
  1.1166 +-  char buffer[19];
  1.1167 +-  snprintf(buffer, sizeof(buffer), "0x%x", number);
  1.1168 +-  return string(buffer);
  1.1169 +-}
  1.1170 +-
  1.1171 +-int ErrnoString(string *error_string) {
  1.1172 +-  assert(error_string);
  1.1173 +-
  1.1174 +-  // strerror isn't necessarily thread-safe.  strerror_r would be preferrable,
  1.1175 +-  // but GNU libc uses a nonstandard strerror_r by default, which returns a
  1.1176 +-  // char* (rather than an int success indicator) and doesn't necessarily
  1.1177 +-  // use the supplied buffer.
  1.1178 +-  error_string->assign(strerror(errno));
  1.1179 +-  return errno;
  1.1180 +-}
  1.1181 +-
  1.1182 +-}  // namespace google_breakpad
  1.1183 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/logging.h
  1.1184 +--- a/src/processor/logging.h        Thu Apr 04 21:00:31 2013 +0200
  1.1185 ++++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1.1186 +@@ -1,175 +0,0 @@
  1.1187 +-// Copyright (c) 2007, Google Inc.
  1.1188 +-// All rights reserved.
  1.1189 +-//
  1.1190 +-// Redistribution and use in source and binary forms, with or without
  1.1191 +-// modification, are permitted provided that the following conditions are
  1.1192 +-// met:
  1.1193 +-//
  1.1194 +-//     * Redistributions of source code must retain the above copyright
  1.1195 +-// notice, this list of conditions and the following disclaimer.
  1.1196 +-//     * Redistributions in binary form must reproduce the above
  1.1197 +-// copyright notice, this list of conditions and the following disclaimer
  1.1198 +-// in the documentation and/or other materials provided with the
  1.1199 +-// distribution.
  1.1200 +-//     * Neither the name of Google Inc. nor the names of its
  1.1201 +-// contributors may be used to endorse or promote products derived from
  1.1202 +-// this software without specific prior written permission.
  1.1203 +-//
  1.1204 +-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  1.1205 +-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  1.1206 +-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1.1207 +-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  1.1208 +-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  1.1209 +-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  1.1210 +-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  1.1211 +-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  1.1212 +-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  1.1213 +-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  1.1214 +-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1.1215 +-
  1.1216 +-// logging.h: Breakpad logging
  1.1217 +-//
  1.1218 +-// Breakpad itself uses Breakpad logging with statements of the form:
  1.1219 +-//   BPLOG(severity) << "message";
  1.1220 +-// severity may be INFO, ERROR, or other values defined in this file.
  1.1221 +-//
  1.1222 +-// BPLOG is an overridable macro so that users can customize Breakpad's
  1.1223 +-// logging.  Left at the default, logging messages are sent to stderr along
  1.1224 +-// with a timestamp and the source code location that produced a message.
  1.1225 +-// The streams may be changed by redefining BPLOG_*_STREAM, the logging
  1.1226 +-// behavior may be changed by redefining BPLOG_*, and the entire logging
  1.1227 +-// system may be overridden by redefining BPLOG(severity).  These
  1.1228 +-// redefinitions may be passed to the preprocessor as a command-line flag
  1.1229 +-// (-D).
  1.1230 +-//
  1.1231 +-// If an additional header is required to override Breakpad logging, it can
  1.1232 +-// be specified by the BP_LOGGING_INCLUDE macro.  If defined, this header
  1.1233 +-// will #include the header specified by that macro.
  1.1234 +-//
  1.1235 +-// If any initialization is needed before logging, it can be performed by
  1.1236 +-// a function called through the BPLOG_INIT macro.  Each main function of
  1.1237 +-// an executable program in the Breakpad processor library calls
  1.1238 +-// BPLOG_INIT(&argc, &argv); before any logging can be performed; define
  1.1239 +-// BPLOG_INIT appropriately if initialization is required.
  1.1240 +-//
  1.1241 +-// Author: Mark Mentovai
  1.1242 +-
  1.1243 +-#ifndef PROCESSOR_LOGGING_H__
  1.1244 +-#define PROCESSOR_LOGGING_H__
  1.1245 +-
  1.1246 +-#include <iostream>
  1.1247 +-#include <string>
  1.1248 +-
  1.1249 +-#include "common/using_std_string.h"
  1.1250 +-#include "google_breakpad/common/breakpad_types.h"
  1.1251 +-
  1.1252 +-#ifdef BP_LOGGING_INCLUDE
  1.1253 +-#include BP_LOGGING_INCLUDE
  1.1254 +-#endif  // BP_LOGGING_INCLUDE
  1.1255 +-
  1.1256 +-#ifndef THIRD_PARTY_BREAKPAD_GOOGLE_GLUE_LOGGING_H_
  1.1257 +-namespace base_logging {
  1.1258 +-
  1.1259 +-// The open-source copy of logging.h has diverged from Google's internal copy
  1.1260 +-// (temporarily, at least).  To support the transition to structured logging
  1.1261 +-// a definition for base_logging::LogMessage is needed, which is a ostream-
  1.1262 +-// like object for streaming arguments to construct a log message.
  1.1263 +-typedef std::ostream LogMessage;
  1.1264 +-
  1.1265 +-}  // namespace base_logging
  1.1266 +-#endif  // THIRD_PARTY_BREAKPAD_GOOGLE_GLUE_LOGGING_H_
  1.1267 +-
  1.1268 +-namespace google_breakpad {
  1.1269 +-
  1.1270 +-// These are defined in Microsoft headers.
  1.1271 +-#ifdef SEVERITY_ERROR
  1.1272 +-#undef SEVERITY_ERROR
  1.1273 +-#endif
  1.1274 +-
  1.1275 +-#ifdef ERROR
  1.1276 +-#undef ERROR
  1.1277 +-#endif
  1.1278 +-
  1.1279 +-class LogStream {
  1.1280 +- public:
  1.1281 +-  enum Severity {
  1.1282 +-    SEVERITY_INFO,
  1.1283 +-    SEVERITY_ERROR
  1.1284 +-  };
  1.1285 +-
  1.1286 +-  // Begin logging a message to the stream identified by |stream|, at the
  1.1287 +-  // indicated severity.  The file and line parameters should be set so as to
  1.1288 +-  // identify the line of source code that is producing a message.
  1.1289 +-  LogStream(std::ostream &stream, Severity severity,
  1.1290 +-            const char *file, int line);
  1.1291 +-
  1.1292 +-  // Finish logging by printing a newline and flushing the output stream.
  1.1293 +-  ~LogStream();
  1.1294 +-
  1.1295 +-  template<typename T> std::ostream& operator<<(const T &t) {
  1.1296 +-    return stream_ << t;
  1.1297 +-  }
  1.1298 +-
  1.1299 +- private:
  1.1300 +-  std::ostream &stream_;
  1.1301 +-
  1.1302 +-  // Disallow copy constructor and assignment operator
  1.1303 +-  explicit LogStream(const LogStream &that);
  1.1304 +-  void operator=(const LogStream &that);
  1.1305 +-};
  1.1306 +-
  1.1307 +-// This class is used to explicitly ignore values in the conditional logging
  1.1308 +-// macros.  This avoids compiler warnings like "value computed is not used"
  1.1309 +-// and "statement has no effect".
  1.1310 +-class LogMessageVoidify {
  1.1311 +- public:
  1.1312 +-  LogMessageVoidify() {}
  1.1313 +-
  1.1314 +-  // This has to be an operator with a precedence lower than << but higher
  1.1315 +-  // than ?:
  1.1316 +-  void operator&(base_logging::LogMessage &) {}
  1.1317 +-};
  1.1318 +-
  1.1319 +-// Returns number formatted as a hexadecimal string, such as "0x7b".
  1.1320 +-string HexString(uint32_t number);
  1.1321 +-string HexString(uint64_t number);
  1.1322 +-string HexString(int number);
  1.1323 +-
  1.1324 +-// Returns the error code as set in the global errno variable, and sets
  1.1325 +-// error_string, a required argument, to a string describing that error
  1.1326 +-// code.
  1.1327 +-int ErrnoString(string *error_string);
  1.1328 +-
  1.1329 +-}  // namespace google_breakpad
  1.1330 +-
  1.1331 +-#ifndef BPLOG_INIT
  1.1332 +-#define BPLOG_INIT(pargc, pargv)
  1.1333 +-#endif  // BPLOG_INIT
  1.1334 +-
  1.1335 +-#ifndef BPLOG
  1.1336 +-#define BPLOG(severity) BPLOG_ ## severity
  1.1337 +-#endif  // BPLOG
  1.1338 +-
  1.1339 +-#ifndef BPLOG_INFO
  1.1340 +-#ifndef BPLOG_INFO_STREAM
  1.1341 +-#define BPLOG_INFO_STREAM std::clog
  1.1342 +-#endif  // BPLOG_INFO_STREAM
  1.1343 +-#define BPLOG_INFO google_breakpad::LogStream(BPLOG_INFO_STREAM, \
  1.1344 +-                       google_breakpad::LogStream::SEVERITY_INFO, \
  1.1345 +-                       __FILE__, __LINE__)
  1.1346 +-#endif  // BPLOG_INFO
  1.1347 +-
  1.1348 +-#ifndef BPLOG_ERROR
  1.1349 +-#ifndef BPLOG_ERROR_STREAM
  1.1350 +-#define BPLOG_ERROR_STREAM std::cerr
  1.1351 +-#endif  // BPLOG_ERROR_STREAM
  1.1352 +-#define BPLOG_ERROR google_breakpad::LogStream(BPLOG_ERROR_STREAM, \
  1.1353 +-                        google_breakpad::LogStream::SEVERITY_ERROR, \
  1.1354 +-                        __FILE__, __LINE__)
  1.1355 +-#endif  // BPLOG_ERROR
  1.1356 +-
  1.1357 +-#define BPLOG_IF(severity, condition) \
  1.1358 +-    !(condition) ? (void) 0 : \
  1.1359 +-                   google_breakpad::LogMessageVoidify() & BPLOG(severity)
  1.1360 +-
  1.1361 +-#endif  // PROCESSOR_LOGGING_H__
  1.1362 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/minidump.cc
  1.1363 +--- a/src/processor/minidump.cc	Thu Mar 28 18:38:05 2013 +0100
  1.1364 ++++ b/src/processor/minidump.cc	Thu Mar 28 18:06:39 2013 +0100
  1.1365 +@@ -58,17 +58,17 @@
  1.1366 + #include <map>
  1.1367 + #include <vector>
  1.1368 + 
  1.1369 + #include "processor/range_map-inl.h"
  1.1370 + 
  1.1371 + #include "common/scoped_ptr.h"
  1.1372 + #include "processor/basic_code_module.h"
  1.1373 + #include "processor/basic_code_modules.h"
  1.1374 +-#include "processor/logging.h"
  1.1375 ++#include "common/logging.h"
  1.1376 + 
  1.1377 + 
  1.1378 + 
  1.1379 + namespace google_breakpad {
  1.1380 + 
  1.1381 + 
  1.1382 + using std::istream;
  1.1383 + using std::ifstream;
  1.1384 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/pathname_stripper.cc
  1.1385 +--- a/src/processor/pathname_stripper.cc	Thu Mar 28 18:38:05 2013 +0100
  1.1386 ++++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1.1387 +@@ -1,56 +0,0 @@
  1.1388 +-// Copyright (c) 2006, Google Inc.
  1.1389 +-// All rights reserved.
  1.1390 +-//
  1.1391 +-// Redistribution and use in source and binary forms, with or without
  1.1392 +-// modification, are permitted provided that the following conditions are
  1.1393 +-// met:
  1.1394 +-//
  1.1395 +-//     * Redistributions of source code must retain the above copyright
  1.1396 +-// notice, this list of conditions and the following disclaimer.
  1.1397 +-//     * Redistributions in binary form must reproduce the above
  1.1398 +-// copyright notice, this list of conditions and the following disclaimer
  1.1399 +-// in the documentation and/or other materials provided with the
  1.1400 +-// distribution.
  1.1401 +-//     * Neither the name of Google Inc. nor the names of its
  1.1402 +-// contributors may be used to endorse or promote products derived from
  1.1403 +-// this software without specific prior written permission.
  1.1404 +-//
  1.1405 +-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  1.1406 +-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  1.1407 +-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1.1408 +-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  1.1409 +-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  1.1410 +-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  1.1411 +-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  1.1412 +-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  1.1413 +-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  1.1414 +-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  1.1415 +-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1.1416 +-
  1.1417 +-// pathname_stripper.cc: Manipulates pathnames into their component parts.
  1.1418 +-//
  1.1419 +-// See pathname_stripper.h for documentation.
  1.1420 +-//
  1.1421 +-// Author: Mark Mentovai
  1.1422 +-
  1.1423 +-#include "processor/pathname_stripper.h"
  1.1424 +-
  1.1425 +-namespace google_breakpad {
  1.1426 +-
  1.1427 +-// static
  1.1428 +-string PathnameStripper::File(const string &path) {
  1.1429 +-  string::size_type slash = path.rfind('/');
  1.1430 +-  string::size_type backslash = path.rfind('\\');
  1.1431 +-
  1.1432 +-  string::size_type file_start = 0;
  1.1433 +-  if (slash != string::npos &&
  1.1434 +-      (backslash == string::npos || slash > backslash)) {
  1.1435 +-    file_start = slash + 1;
  1.1436 +-  } else if (backslash != string::npos) {
  1.1437 +-    file_start = backslash + 1;
  1.1438 +-  }
  1.1439 +-
  1.1440 +-  return path.substr(file_start);
  1.1441 +-}
  1.1442 +-
  1.1443 +-}  // namespace google_breakpad
  1.1444 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/pathname_stripper.h
  1.1445 +--- a/src/processor/pathname_stripper.h	Thu Mar 28 18:38:05 2013 +0100
  1.1446 ++++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1.1447 +@@ -1,53 +0,0 @@
  1.1448 +-// Copyright (c) 2006, Google Inc.
  1.1449 +-// All rights reserved.
  1.1450 +-//
  1.1451 +-// Redistribution and use in source and binary forms, with or without
  1.1452 +-// modification, are permitted provided that the following conditions are
  1.1453 +-// met:
  1.1454 +-//
  1.1455 +-//     * Redistributions of source code must retain the above copyright
  1.1456 +-// notice, this list of conditions and the following disclaimer.
  1.1457 +-//     * Redistributions in binary form must reproduce the above
  1.1458 +-// copyright notice, this list of conditions and the following disclaimer
  1.1459 +-// in the documentation and/or other materials provided with the
  1.1460 +-// distribution.
  1.1461 +-//     * Neither the name of Google Inc. nor the names of its
  1.1462 +-// contributors may be used to endorse or promote products derived from
  1.1463 +-// this software without specific prior written permission.
  1.1464 +-//
  1.1465 +-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  1.1466 +-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  1.1467 +-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1.1468 +-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  1.1469 +-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  1.1470 +-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  1.1471 +-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  1.1472 +-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  1.1473 +-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  1.1474 +-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  1.1475 +-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1.1476 +-
  1.1477 +-// pathname_stripper.h: Manipulates pathnames into their component parts.
  1.1478 +-//
  1.1479 +-// Author: Mark Mentovai
  1.1480 +-
  1.1481 +-#ifndef PROCESSOR_PATHNAME_STRIPPER_H__
  1.1482 +-#define PROCESSOR_PATHNAME_STRIPPER_H__
  1.1483 +-
  1.1484 +-#include <string>
  1.1485 +-
  1.1486 +-#include "common/using_std_string.h"
  1.1487 +-
  1.1488 +-namespace google_breakpad {
  1.1489 +-
  1.1490 +-class PathnameStripper {
  1.1491 +- public:
  1.1492 +-  // Given path, a pathname with components separated by slashes (/) or
  1.1493 +-  // backslashes (\), returns the trailing component, without any separator.
  1.1494 +-  // If path ends in a separator character, returns an empty string.
  1.1495 +-  static string File(const string &path);
  1.1496 +-};
  1.1497 +-
  1.1498 +-}  // namespace google_breakpad
  1.1499 +-
  1.1500 +-#endif  // PROCESSOR_PATHNAME_STRIPPER_H__
  1.1501 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/pathname_stripper_unittest.cc
  1.1502 +--- a/src/processor/pathname_stripper_unittest.cc	Thu Mar 28 18:38:05 2013 +0100
  1.1503 ++++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1.1504 +@@ -1,87 +0,0 @@
  1.1505 +-// Copyright (c) 2006, Google Inc.
  1.1506 +-// All rights reserved.
  1.1507 +-//
  1.1508 +-// Redistribution and use in source and binary forms, with or without
  1.1509 +-// modification, are permitted provided that the following conditions are
  1.1510 +-// met:
  1.1511 +-//
  1.1512 +-//     * Redistributions of source code must retain the above copyright
  1.1513 +-// notice, this list of conditions and the following disclaimer.
  1.1514 +-//     * Redistributions in binary form must reproduce the above
  1.1515 +-// copyright notice, this list of conditions and the following disclaimer
  1.1516 +-// in the documentation and/or other materials provided with the
  1.1517 +-// distribution.
  1.1518 +-//     * Neither the name of Google Inc. nor the names of its
  1.1519 +-// contributors may be used to endorse or promote products derived from
  1.1520 +-// this software without specific prior written permission.
  1.1521 +-//
  1.1522 +-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  1.1523 +-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  1.1524 +-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  1.1525 +-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  1.1526 +-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  1.1527 +-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  1.1528 +-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  1.1529 +-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  1.1530 +-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  1.1531 +-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  1.1532 +-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1.1533 +-
  1.1534 +-#include <stdio.h>
  1.1535 +-
  1.1536 +-#include "processor/pathname_stripper.h"
  1.1537 +-#include "processor/logging.h"
  1.1538 +-
  1.1539 +-#define ASSERT_TRUE(condition) \
  1.1540 +-  if (!(condition)) { \
  1.1541 +-    fprintf(stderr, "FAIL: %s @ %s:%d\n", #condition, __FILE__, __LINE__); \
  1.1542 +-    return false; \
  1.1543 +-  }
  1.1544 +-
  1.1545 +-#define ASSERT_EQ(e1, e2) ASSERT_TRUE((e1) == (e2))
  1.1546 +-
  1.1547 +-namespace {
  1.1548 +-
  1.1549 +-using google_breakpad::PathnameStripper;
  1.1550 +-
  1.1551 +-static bool RunTests() {
  1.1552 +-  ASSERT_EQ(PathnameStripper::File("/dir/file"), "file");
  1.1553 +-  ASSERT_EQ(PathnameStripper::File("\\dir\\file"), "file");
  1.1554 +-  ASSERT_EQ(PathnameStripper::File("/dir\\file"), "file");
  1.1555 +-  ASSERT_EQ(PathnameStripper::File("\\dir/file"), "file");
  1.1556 +-  ASSERT_EQ(PathnameStripper::File("dir/file"), "file");
  1.1557 +-  ASSERT_EQ(PathnameStripper::File("dir\\file"), "file");
  1.1558 +-  ASSERT_EQ(PathnameStripper::File("dir/\\file"), "file");
  1.1559 +-  ASSERT_EQ(PathnameStripper::File("dir\\/file"), "file");
  1.1560 +-  ASSERT_EQ(PathnameStripper::File("file"), "file");
  1.1561 +-  ASSERT_EQ(PathnameStripper::File("dir/"), "");
  1.1562 +-  ASSERT_EQ(PathnameStripper::File("dir\\"), "");
  1.1563 +-  ASSERT_EQ(PathnameStripper::File("dir/dir/"), "");
  1.1564 +-  ASSERT_EQ(PathnameStripper::File("dir\\dir\\"), "");
  1.1565 +-  ASSERT_EQ(PathnameStripper::File("dir1/dir2/file"), "file");
  1.1566 +-  ASSERT_EQ(PathnameStripper::File("dir1\\dir2\\file"), "file");
  1.1567 +-  ASSERT_EQ(PathnameStripper::File("dir1/dir2\\file"), "file");
  1.1568 +-  ASSERT_EQ(PathnameStripper::File("dir1\\dir2/file"), "file");
  1.1569 +-  ASSERT_EQ(PathnameStripper::File(""), "");
  1.1570 +-  ASSERT_EQ(PathnameStripper::File("1"), "1");
  1.1571 +-  ASSERT_EQ(PathnameStripper::File("1/2"), "2");
  1.1572 +-  ASSERT_EQ(PathnameStripper::File("1\\2"), "2");
  1.1573 +-  ASSERT_EQ(PathnameStripper::File("/1/2"), "2");
  1.1574 +-  ASSERT_EQ(PathnameStripper::File("\\1\\2"), "2");
  1.1575 +-  ASSERT_EQ(PathnameStripper::File("dir//file"), "file");
  1.1576 +-  ASSERT_EQ(PathnameStripper::File("dir\\\\file"), "file");
  1.1577 +-  ASSERT_EQ(PathnameStripper::File("/dir//file"), "file");
  1.1578 +-  ASSERT_EQ(PathnameStripper::File("\\dir\\\\file"), "file");
  1.1579 +-  ASSERT_EQ(PathnameStripper::File("c:\\dir\\file"), "file");
  1.1580 +-  ASSERT_EQ(PathnameStripper::File("c:\\dir\\file.ext"), "file.ext");
  1.1581 +-
  1.1582 +-  return true;
  1.1583 +-}
  1.1584 +-
  1.1585 +-}  // namespace
  1.1586 +-
  1.1587 +-int main(int argc, char **argv) {
  1.1588 +-  BPLOG_INIT(&argc, &argv);
  1.1589 +-
  1.1590 +-  return RunTests() ? 0 : 1;
  1.1591 +-}
  1.1592 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/postfix_evaluator-inl.h
  1.1593 +--- a/src/processor/postfix_evaluator-inl.h	Thu Mar 28 18:38:05 2013 +0100
  1.1594 ++++ b/src/processor/postfix_evaluator-inl.h	Thu Mar 28 18:06:39 2013 +0100
  1.1595 +@@ -41,17 +41,17 @@
  1.1596 + 
  1.1597 + #include "processor/postfix_evaluator.h"
  1.1598 + 
  1.1599 + #include <stdio.h>
  1.1600 + 
  1.1601 + #include <sstream>
  1.1602 + 
  1.1603 + #include "google_breakpad/processor/memory_region.h"
  1.1604 +-#include "processor/logging.h"
  1.1605 ++#include "common/logging.h"
  1.1606 + 
  1.1607 + namespace google_breakpad {
  1.1608 + 
  1.1609 + using std::istringstream;
  1.1610 + using std::ostringstream;
  1.1611 + 
  1.1612 + 
  1.1613 + // A small class used in Evaluate to make sure to clean up the stack
  1.1614 +@@ -147,17 +147,17 @@ bool PostfixEvaluator<ValueType>::Evalua
  1.1615 +     if (!memory_) {
  1.1616 +       BPLOG(ERROR) << "Attempt to dereference without memory: " <<
  1.1617 +                       expression;
  1.1618 +       return false;
  1.1619 +     }
  1.1620 + 
  1.1621 +     ValueType address;
  1.1622 +     if (!PopValue(&address)) {
  1.1623 +-      BPLOG(ERROR) << "Could not PopValue to get value to derefence: " <<
  1.1624 ++      BPLOG(ERROR) << "Could not PopValue to get value to dereference: " <<
  1.1625 +                       expression;
  1.1626 +       return false;
  1.1627 +     }
  1.1628 + 
  1.1629 +     ValueType value;
  1.1630 +     if (!memory_->GetMemoryAtAddress(address, &value)) {
  1.1631 +       BPLOG(ERROR) << "Could not dereference memory at address " <<
  1.1632 +                       HexString(address) << ": " << expression;
  1.1633 +@@ -305,18 +305,23 @@ bool PostfixEvaluator<ValueType>::Evalua
  1.1634 +     case Module::kExprSimple:
  1.1635 +     case Module::kExprSimpleMem: {
  1.1636 +       // Look up the base value
  1.1637 +       bool found = false;
  1.1638 +       ValueType v = dictionary_->get(&found, expr.ident_);
  1.1639 +       if (!found) {
  1.1640 +         // The identifier wasn't found in the dictionary.  Don't imply any
  1.1641 +         // default value, just fail.
  1.1642 +-        BPLOG(INFO) << "Identifier " << FromUniqueString(expr.ident_)
  1.1643 +-                    << " not in dictionary (kExprSimple{Mem})";
  1.1644 ++        static uint64_t n_complaints = 0; // This isn't threadsafe.
  1.1645 ++        n_complaints++;
  1.1646 ++        if (is_power_of_2(n_complaints)) {
  1.1647 ++          BPLOG(INFO) << "Identifier " << FromUniqueString(expr.ident_)
  1.1648 ++                      << " not in dictionary (kExprSimple{Mem})"
  1.1649 ++                      << " (shown " << n_complaints << " times)";
  1.1650 ++        }
  1.1651 +         return false;
  1.1652 +       }
  1.1653 + 
  1.1654 +       // Form the sum
  1.1655 +       ValueType sum = v + (int64_t)expr.offset_;
  1.1656 + 
  1.1657 +       // and dereference if necessary
  1.1658 +       if (expr.how_ == Module::kExprSimpleMem) {
  1.1659 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/range_map-inl.h
  1.1660 +--- a/src/processor/range_map-inl.h	Thu Mar 28 18:38:05 2013 +0100
  1.1661 ++++ b/src/processor/range_map-inl.h	Thu Mar 28 18:06:39 2013 +0100
  1.1662 +@@ -35,17 +35,17 @@
  1.1663 + 
  1.1664 + #ifndef PROCESSOR_RANGE_MAP_INL_H__
  1.1665 + #define PROCESSOR_RANGE_MAP_INL_H__
  1.1666 + 
  1.1667 + 
  1.1668 + #include <assert.h>
  1.1669 + 
  1.1670 + #include "processor/range_map.h"
  1.1671 +-#include "processor/logging.h"
  1.1672 ++#include "common/logging.h"
  1.1673 + 
  1.1674 + 
  1.1675 + namespace google_breakpad {
  1.1676 + 
  1.1677 + 
  1.1678 + template<typename AddressType, typename EntryType>
  1.1679 + bool RangeMap<AddressType, EntryType>::StoreRange(const AddressType &base,
  1.1680 +                                                   const AddressType &size,
  1.1681 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stack_frame_symbolizer.cc
  1.1682 +--- a/src/processor/stack_frame_symbolizer.cc	Thu Mar 28 18:38:05 2013 +0100
  1.1683 ++++ b/src/processor/stack_frame_symbolizer.cc	Thu Mar 28 18:06:39 2013 +0100
  1.1684 +@@ -39,17 +39,17 @@
  1.1685 + #include "common/scoped_ptr.h"
  1.1686 + #include "google_breakpad/processor/code_module.h"
  1.1687 + #include "google_breakpad/processor/code_modules.h"
  1.1688 + #include "google_breakpad/processor/source_line_resolver_interface.h"
  1.1689 + #include "google_breakpad/processor/stack_frame.h"
  1.1690 + #include "google_breakpad/processor/symbol_supplier.h"
  1.1691 + #include "google_breakpad/processor/system_info.h"
  1.1692 + #include "processor/linked_ptr.h"
  1.1693 +-#include "processor/logging.h"
  1.1694 ++#include "common/logging.h"
  1.1695 + 
  1.1696 + namespace google_breakpad {
  1.1697 + 
  1.1698 + StackFrameSymbolizer::StackFrameSymbolizer(
  1.1699 +     SymbolSupplier* supplier,
  1.1700 +     SourceLineResolverInterface* resolver) : supplier_(supplier),
  1.1701 +                                              resolver_(resolver) { }
  1.1702 + 
  1.1703 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stackwalker.cc
  1.1704 +--- a/src/processor/stackwalker.cc	Thu Mar 28 18:38:05 2013 +0100
  1.1705 ++++ b/src/processor/stackwalker.cc	Thu Mar 28 18:06:39 2013 +0100
  1.1706 +@@ -41,17 +41,17 @@
  1.1707 + #include "google_breakpad/processor/call_stack.h"
  1.1708 + #include "google_breakpad/processor/code_module.h"
  1.1709 + #include "google_breakpad/processor/code_modules.h"
  1.1710 + #include "google_breakpad/processor/minidump.h"
  1.1711 + #include "google_breakpad/processor/stack_frame.h"
  1.1712 + #include "google_breakpad/processor/stack_frame_symbolizer.h"
  1.1713 + #include "google_breakpad/processor/system_info.h"
  1.1714 + #include "processor/linked_ptr.h"
  1.1715 +-#include "processor/logging.h"
  1.1716 ++#include "common/logging.h"
  1.1717 + #include "processor/stackwalker_ppc.h"
  1.1718 + #include "processor/stackwalker_sparc.h"
  1.1719 + #include "processor/stackwalker_x86.h"
  1.1720 + #include "processor/stackwalker_amd64.h"
  1.1721 + #include "processor/stackwalker_arm.h"
  1.1722 + 
  1.1723 + namespace google_breakpad {
  1.1724 + 
  1.1725 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stackwalker_amd64.cc
  1.1726 +--- a/src/processor/stackwalker_amd64.cc	Thu Mar 28 18:38:05 2013 +0100
  1.1727 ++++ b/src/processor/stackwalker_amd64.cc	Thu Mar 28 18:06:39 2013 +0100
  1.1728 +@@ -36,17 +36,17 @@
  1.1729 + #include <assert.h>
  1.1730 + 
  1.1731 + #include "common/scoped_ptr.h"
  1.1732 + #include "google_breakpad/processor/call_stack.h"
  1.1733 + #include "google_breakpad/processor/memory_region.h"
  1.1734 + #include "google_breakpad/processor/source_line_resolver_interface.h"
  1.1735 + #include "google_breakpad/processor/stack_frame_cpu.h"
  1.1736 + #include "processor/cfi_frame_info.h"
  1.1737 +-#include "processor/logging.h"
  1.1738 ++#include "common/logging.h"
  1.1739 + #include "processor/stackwalker_amd64.h"
  1.1740 + 
  1.1741 + namespace google_breakpad {
  1.1742 + 
  1.1743 + 
  1.1744 + const StackwalkerAMD64::CFIWalker::RegisterSet
  1.1745 + StackwalkerAMD64::cfi_register_map_[] = {
  1.1746 +   // It may seem like $rip and $rsp are callee-saves, because the callee is
  1.1747 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stackwalker_arm.cc
  1.1748 +--- a/src/processor/stackwalker_arm.cc	Thu Mar 28 18:38:05 2013 +0100
  1.1749 ++++ b/src/processor/stackwalker_arm.cc	Thu Mar 28 18:06:39 2013 +0100
  1.1750 +@@ -36,17 +36,17 @@
  1.1751 + #include <vector>
  1.1752 + 
  1.1753 + #include "common/scoped_ptr.h"
  1.1754 + #include "google_breakpad/processor/call_stack.h"
  1.1755 + #include "google_breakpad/processor/memory_region.h"
  1.1756 + #include "google_breakpad/processor/source_line_resolver_interface.h"
  1.1757 + #include "google_breakpad/processor/stack_frame_cpu.h"
  1.1758 + #include "processor/cfi_frame_info.h"
  1.1759 +-#include "processor/logging.h"
  1.1760 ++#include "common/logging.h"
  1.1761 + #include "processor/stackwalker_arm.h"
  1.1762 + 
  1.1763 + namespace google_breakpad {
  1.1764 + 
  1.1765 + 
  1.1766 + StackwalkerARM::StackwalkerARM(const SystemInfo* system_info,
  1.1767 +                                const MDRawContextARM* context,
  1.1768 +                                int fp_register,
  1.1769 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stackwalker_ppc.cc
  1.1770 +--- a/src/processor/stackwalker_ppc.cc	Thu Mar 28 18:38:05 2013 +0100
  1.1771 ++++ b/src/processor/stackwalker_ppc.cc	Thu Mar 28 18:06:39 2013 +0100
  1.1772 +@@ -33,17 +33,17 @@
  1.1773 + //
  1.1774 + // Author: Mark Mentovai
  1.1775 + 
  1.1776 + 
  1.1777 + #include "processor/stackwalker_ppc.h"
  1.1778 + #include "google_breakpad/processor/call_stack.h"
  1.1779 + #include "google_breakpad/processor/memory_region.h"
  1.1780 + #include "google_breakpad/processor/stack_frame_cpu.h"
  1.1781 +-#include "processor/logging.h"
  1.1782 ++#include "common/logging.h"
  1.1783 + 
  1.1784 + namespace google_breakpad {
  1.1785 + 
  1.1786 + 
  1.1787 + StackwalkerPPC::StackwalkerPPC(const SystemInfo* system_info,
  1.1788 +                                const MDRawContextPPC* context,
  1.1789 +                                MemoryRegion* memory,
  1.1790 +                                const CodeModules* modules,
  1.1791 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stackwalker_sparc.cc
  1.1792 +--- a/src/processor/stackwalker_sparc.cc	Thu Mar 28 18:38:05 2013 +0100
  1.1793 ++++ b/src/processor/stackwalker_sparc.cc	Thu Mar 28 18:06:39 2013 +0100
  1.1794 +@@ -32,17 +32,17 @@
  1.1795 + // See stackwalker_sparc.h for documentation.
  1.1796 + //
  1.1797 + // Author: Michael Shang
  1.1798 + 
  1.1799 + 
  1.1800 + #include "google_breakpad/processor/call_stack.h"
  1.1801 + #include "google_breakpad/processor/memory_region.h"
  1.1802 + #include "google_breakpad/processor/stack_frame_cpu.h"
  1.1803 +-#include "processor/logging.h"
  1.1804 ++#include "common/logging.h"
  1.1805 + #include "processor/stackwalker_sparc.h"
  1.1806 + 
  1.1807 + namespace google_breakpad {
  1.1808 + 
  1.1809 + 
  1.1810 + StackwalkerSPARC::StackwalkerSPARC(const SystemInfo* system_info,
  1.1811 +                                    const MDRawContextSPARC* context,
  1.1812 +                                    MemoryRegion* memory,
  1.1813 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/stackwalker_x86.cc
  1.1814 +--- a/src/processor/stackwalker_x86.cc	Thu Mar 28 18:38:05 2013 +0100
  1.1815 ++++ b/src/processor/stackwalker_x86.cc	Thu Mar 28 18:06:39 2013 +0100
  1.1816 +@@ -37,17 +37,17 @@
  1.1817 + #include <string>
  1.1818 + 
  1.1819 + #include "common/scoped_ptr.h"
  1.1820 + #include "google_breakpad/processor/call_stack.h"
  1.1821 + #include "google_breakpad/processor/code_modules.h"
  1.1822 + #include "google_breakpad/processor/memory_region.h"
  1.1823 + #include "google_breakpad/processor/source_line_resolver_interface.h"
  1.1824 + #include "google_breakpad/processor/stack_frame_cpu.h"
  1.1825 +-#include "processor/logging.h"
  1.1826 ++#include "common/logging.h"
  1.1827 + #include "processor/postfix_evaluator-inl.h"
  1.1828 + #include "processor/stackwalker_x86.h"
  1.1829 + #include "processor/windows_frame_info.h"
  1.1830 + #include "processor/cfi_frame_info.h"
  1.1831 + 
  1.1832 + namespace google_breakpad {
  1.1833 + 
  1.1834 + 
  1.1835 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/static_address_map-inl.h
  1.1836 +--- a/src/processor/static_address_map-inl.h	Thu Mar 28 18:38:05 2013 +0100
  1.1837 ++++ b/src/processor/static_address_map-inl.h	Thu Mar 28 18:06:39 2013 +0100
  1.1838 +@@ -33,17 +33,17 @@
  1.1839 + //
  1.1840 + // Author: Siyang Xie (lambxsy@google.com)
  1.1841 + 
  1.1842 + #ifndef PROCESSOR_STATIC_ADDRESS_MAP_INL_H__
  1.1843 + #define PROCESSOR_STATIC_ADDRESS_MAP_INL_H__
  1.1844 + 
  1.1845 + #include "processor/static_address_map.h"
  1.1846 + 
  1.1847 +-#include "processor/logging.h"
  1.1848 ++#include "common/logging.h"
  1.1849 + 
  1.1850 + namespace google_breakpad {
  1.1851 + 
  1.1852 + template<typename AddressType, typename EntryType>
  1.1853 + bool StaticAddressMap<AddressType, EntryType>::Retrieve(
  1.1854 +     const AddressType &address,
  1.1855 +     const EntryType *&entry, AddressType *entry_address) const {
  1.1856 + 
  1.1857 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/static_contained_range_map-inl.h
  1.1858 +--- a/src/processor/static_contained_range_map-inl.h	Thu Mar 28 18:38:05 2013 +0100
  1.1859 ++++ b/src/processor/static_contained_range_map-inl.h	Thu Mar 28 18:06:39 2013 +0100
  1.1860 +@@ -33,17 +33,17 @@
  1.1861 + // See static_contained_range_map.h for documentation.
  1.1862 + //
  1.1863 + // Author: Siyang Xie (lambxsy@google.com)
  1.1864 + 
  1.1865 + #ifndef PROCESSOR_STATIC_CONTAINED_RANGE_MAP_INL_H__
  1.1866 + #define PROCESSOR_STATIC_CONTAINED_RANGE_MAP_INL_H__
  1.1867 + 
  1.1868 + #include "processor/static_contained_range_map.h"
  1.1869 +-#include "processor/logging.h"
  1.1870 ++#include "common/logging.h"
  1.1871 + 
  1.1872 + namespace google_breakpad {
  1.1873 + 
  1.1874 + template<typename AddressType, typename EntryType>
  1.1875 + StaticContainedRangeMap<AddressType, EntryType>::StaticContainedRangeMap(
  1.1876 +     const char *base)
  1.1877 +     : base_(*(reinterpret_cast<const AddressType*>(base))),
  1.1878 +       entry_size_(*(reinterpret_cast<const uint32_t*>(base + sizeof(base_)))),
  1.1879 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/static_map-inl.h
  1.1880 +--- a/src/processor/static_map-inl.h	Thu Mar 28 18:38:05 2013 +0100
  1.1881 ++++ b/src/processor/static_map-inl.h	Thu Mar 28 18:06:39 2013 +0100
  1.1882 +@@ -33,17 +33,17 @@
  1.1883 + // Author: Siyang Xie (lambxsy@google.com)
  1.1884 + 
  1.1885 + 
  1.1886 + #ifndef PROCESSOR_STATIC_MAP_INL_H__
  1.1887 + #define PROCESSOR_STATIC_MAP_INL_H__
  1.1888 + 
  1.1889 + #include "processor/static_map.h"
  1.1890 + #include "processor/static_map_iterator-inl.h"
  1.1891 +-#include "processor/logging.h"
  1.1892 ++#include "common/logging.h"
  1.1893 + 
  1.1894 + namespace google_breakpad {
  1.1895 + 
  1.1896 + template<typename Key, typename Value, typename Compare>
  1.1897 + StaticMap<Key, Value, Compare>::StaticMap(const char* raw_data)
  1.1898 +     : raw_data_(raw_data),
  1.1899 +       compare_() {
  1.1900 +   // First 4 Bytes store the number of nodes.
  1.1901 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/static_map_iterator-inl.h
  1.1902 +--- a/src/processor/static_map_iterator-inl.h	Thu Mar 28 18:38:05 2013 +0100
  1.1903 ++++ b/src/processor/static_map_iterator-inl.h	Thu Mar 28 18:06:39 2013 +0100
  1.1904 +@@ -32,17 +32,17 @@
  1.1905 + //
  1.1906 + // Author: Siyang Xie (lambxsy@google.com)
  1.1907 + 
  1.1908 + #ifndef PROCESSOR_STATIC_MAP_ITERATOR_INL_H__
  1.1909 + #define PROCESSOR_STATIC_MAP_ITERATOR_INL_H__
  1.1910 + 
  1.1911 + #include "processor/static_map_iterator.h"
  1.1912 + 
  1.1913 +-#include "processor/logging.h"
  1.1914 ++#include "common/logging.h"
  1.1915 + 
  1.1916 + namespace google_breakpad {
  1.1917 + 
  1.1918 + template<typename Key, typename Value, typename Compare>
  1.1919 + StaticMapIterator<Key, Value, Compare>::StaticMapIterator(const char* base,
  1.1920 +                                                             const int &index):
  1.1921 +       index_(index), base_(base) {
  1.1922 +   // See static_map.h for documentation on
  1.1923 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/static_range_map-inl.h
  1.1924 +--- a/src/processor/static_range_map-inl.h	Thu Mar 28 18:38:05 2013 +0100
  1.1925 ++++ b/src/processor/static_range_map-inl.h	Thu Mar 28 18:06:39 2013 +0100
  1.1926 +@@ -32,17 +32,17 @@
  1.1927 + // See static_range_map.h for documentation.
  1.1928 + //
  1.1929 + // Author: Siyang Xie (lambxsy@google.com)
  1.1930 + 
  1.1931 + #ifndef PROCESSOR_STATIC_RANGE_MAP_INL_H__
  1.1932 + #define PROCESSOR_STATIC_RANGE_MAP_INL_H__
  1.1933 + 
  1.1934 + #include "processor/static_range_map.h"
  1.1935 +-#include "processor/logging.h"
  1.1936 ++#include "common/logging.h"
  1.1937 + 
  1.1938 + namespace google_breakpad {
  1.1939 + 
  1.1940 + template<typename AddressType, typename EntryType>
  1.1941 + bool StaticRangeMap<AddressType, EntryType>::RetrieveRange(
  1.1942 +     const AddressType &address, const EntryType *&entry,
  1.1943 +     AddressType *entry_base, AddressType *entry_size) const {
  1.1944 +   MapConstIterator iterator = map_.lower_bound(address);
  1.1945 +diff --git -r 85dd7094b78d -r 636cfcab9682 src/processor/windows_frame_info.h
  1.1946 +--- a/src/processor/windows_frame_info.h	Thu Mar 28 18:38:05 2013 +0100
  1.1947 ++++ b/src/processor/windows_frame_info.h	Thu Mar 28 18:06:39 2013 +0100
  1.1948 +@@ -41,17 +41,17 @@
  1.1949 + #include <string.h>
  1.1950 + #include <stdlib.h>
  1.1951 + 
  1.1952 + #include <string>
  1.1953 + #include <vector>
  1.1954 + 
  1.1955 + #include "common/using_std_string.h"
  1.1956 + #include "google_breakpad/common/breakpad_types.h"
  1.1957 +-#include "processor/logging.h"
  1.1958 ++#include "common/logging.h"
  1.1959 + #include "processor/tokenize.h"
  1.1960 + 
  1.1961 + namespace google_breakpad {
  1.1962 + 
  1.1963 + #ifdef _WIN32
  1.1964 + #define strtoull _strtoui64
  1.1965 + #endif
  1.1966 + 

mercurial