aboutsummaryrefslogtreecommitdiff
path: root/src/common/dwarf_line_to_module.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/dwarf_line_to_module.cc')
-rw-r--r--src/common/dwarf_line_to_module.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/common/dwarf_line_to_module.cc b/src/common/dwarf_line_to_module.cc
index 443d7448..e716d483 100644
--- a/src/common/dwarf_line_to_module.cc
+++ b/src/common/dwarf_line_to_module.cc
@@ -1,5 +1,4 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
+// Copyright 2010 Google LLC
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -11,7 +10,7 @@
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
-// * Neither the name of Google Inc. nor the names of its
+// * Neither the name of Google LLC nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
@@ -44,18 +43,18 @@
// it until we actually have to deal with DWARF on Windows.
// Return true if PATH is an absolute path, false if it is relative.
-static bool PathIsAbsolute(const string &path) {
+static bool PathIsAbsolute(const string& path) {
return (path.size() >= 1 && path[0] == '/');
}
-static bool HasTrailingSlash(const string &path) {
+static bool HasTrailingSlash(const string& path) {
return (path.size() >= 1 && path[path.size() - 1] == '/');
}
// If PATH is an absolute path, return PATH. If PATH is a relative path,
// treat it as relative to BASE and return the combined path.
-static string ExpandPath(const string &path,
- const string &base) {
+static string ExpandPath(const string& path,
+ const string& base) {
if (PathIsAbsolute(path) || base.empty())
return path;
return base + (HasTrailingSlash(base) ? "" : "/") + path;
@@ -63,14 +62,14 @@ static string ExpandPath(const string &path,
namespace google_breakpad {
-void DwarfLineToModule::DefineDir(const string &name, uint32_t dir_num) {
+void DwarfLineToModule::DefineDir(const string& name, uint32_t dir_num) {
// Directory number zero is reserved to mean the compilation
// directory. Silently ignore attempts to redefine it.
if (dir_num != 0)
directories_[dir_num] = ExpandPath(name, compilation_dir_);
}
-void DwarfLineToModule::DefineFile(const string &name, int32_t file_num,
+void DwarfLineToModule::DefineFile(const string& name, int32_t file_num,
uint32_t dir_num, uint64_t mod_time,
uint64_t length) {
if (file_num == -1)
@@ -100,7 +99,7 @@ void DwarfLineToModule::DefineFile(const string &name, int32_t file_num,
// Find a Module::File object of the given name, and add it to the
// file table.
- files_[file_num] = module_->FindFile(full_name);
+ (*files_)[file_num] = module_->FindFile(full_name);
}
void DwarfLineToModule::AddLine(uint64_t address, uint64_t length,
@@ -122,7 +121,7 @@ void DwarfLineToModule::AddLine(uint64_t address, uint64_t length,
}
// Find the source file being referred to.
- Module::File *file = files_[file_num];
+ Module::File *file = (*files_)[file_num];
if (!file) {
if (!warned_bad_file_number_) {
fprintf(stderr, "warning: DWARF line number data refers to "