aboutsummaryrefslogtreecommitdiff
path: root/src/common/dwarf/functioninfo.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/dwarf/functioninfo.cc')
-rw-r--r--src/common/dwarf/functioninfo.cc27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/common/dwarf/functioninfo.cc b/src/common/dwarf/functioninfo.cc
index 358a6eef..d8fdb842 100644
--- a/src/common/dwarf/functioninfo.cc
+++ b/src/common/dwarf/functioninfo.cc
@@ -1,4 +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
@@ -10,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.
//
@@ -42,24 +42,16 @@
#include "common/scoped_ptr.h"
#include "common/using_std_string.h"
-using google_breakpad::scoped_ptr;
-
-namespace dwarf2reader {
+namespace google_breakpad {
CULineInfoHandler::CULineInfoHandler(std::vector<SourceFileInfo>* files,
std::vector<string>* dirs,
LineMap* linemap):linemap_(linemap),
files_(files),
dirs_(dirs) {
- // The dirs and files are 1 indexed, so just make sure we put
- // nothing in the 0 vector.
- assert(dirs->size() == 0);
- assert(files->size() == 0);
- dirs->push_back("");
- SourceFileInfo s;
- s.name = "";
- s.lowpc = ULLONG_MAX;
- files->push_back(s);
+ // In dwarf4, the dirs and files are 1 indexed, and in dwarf5 they are zero
+ // indexed. This is handled in the LineInfo reader, so empty files are not
+ // needed here.
}
void CULineInfoHandler::DefineDir(const string& name, uint32_t dir_num) {
@@ -150,7 +142,7 @@ bool CUFunctionInfoHandler::StartDIE(uint64_t offset, enum DwarfTag tag) {
void CUFunctionInfoHandler::ProcessAttributeString(uint64_t offset,
enum DwarfAttribute attr,
enum DwarfForm form,
- const string &data) {
+ const string& data) {
if (current_function_info_) {
if (attr == DW_AT_name)
current_function_info_->name = data;
@@ -164,7 +156,8 @@ void CUFunctionInfoHandler::ProcessAttributeUnsigned(uint64_t offset,
enum DwarfForm form,
uint64_t data) {
if (attr == DW_AT_stmt_list) {
- SectionMap::const_iterator iter = sections_.find("__debug_line");
+ SectionMap::const_iterator iter =
+ GetSectionByName(sections_, ".debug_line");
assert(iter != sections_.end());
scoped_ptr<LineInfo> lireader(new LineInfo(iter->second.first + data,
@@ -232,4 +225,4 @@ void CUFunctionInfoHandler::EndDIE(uint64_t offset) {
current_function_info_));
}
-} // namespace dwarf2reader
+} // namespace google_breakpad