From cff813962a1a92508c4824c1c4079895793dfebf Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Tue, 9 Apr 2013 18:58:39 +0000 Subject: Remove auto_ptr usage in Breakpad. Also fix some lint errors. Review URL: https://breakpad.appspot.com/553002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1145 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/dwarf/functioninfo.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/common/dwarf') diff --git a/src/common/dwarf/functioninfo.cc b/src/common/dwarf/functioninfo.cc index 69023bff..8e4d041b 100644 --- a/src/common/dwarf/functioninfo.cc +++ b/src/common/dwarf/functioninfo.cc @@ -36,10 +36,10 @@ #include #include #include -#include #include "common/dwarf/functioninfo.h" #include "common/dwarf/bytereader.h" +#include "common/scoped_ptr.h" #include "common/using_std_string.h" namespace dwarf2reader { @@ -99,11 +99,11 @@ void CULineInfoHandler::AddLine(uint64 address, uint64 length, uint32 file_num, std::make_pair(files_->at(file_num).name.c_str(), line_num))); - if(address < files_->at(file_num).lowpc) { + if (address < files_->at(file_num).lowpc) { files_->at(file_num).lowpc = address; } } else { - fprintf(stderr,"error in AddLine"); + fprintf(stderr, "error in AddLine"); } } @@ -151,7 +151,7 @@ void CUFunctionInfoHandler::ProcessAttributeString(uint64 offset, if (current_function_info_) { if (attr == DW_AT_name) current_function_info_->name = data; - else if(attr == DW_AT_MIPS_linkage_name) + else if (attr == DW_AT_MIPS_linkage_name) current_function_info_->mangled_name = data; } } @@ -164,10 +164,9 @@ void CUFunctionInfoHandler::ProcessAttributeUnsigned(uint64 offset, SectionMap::const_iterator iter = sections_.find("__debug_line"); assert(iter != sections_.end()); - // this should be a scoped_ptr but we dont' use boost :-( - std::auto_ptr lireader(new LineInfo(iter->second.first + data, - iter->second.second - data, - reader_, linehandler_)); + scoped_ptr lireader(new LineInfo(iter->second.first + data, + iter->second.second - data, + reader_, linehandler_)); lireader->Start(); } else if (current_function_info_) { switch (attr) { @@ -208,7 +207,10 @@ void CUFunctionInfoHandler::ProcessAttributeReference(uint64 offset, current_function_info_->mangled_name = iter->second->mangled_name; } else { // If you hit this, this code probably needs to be rewritten. - fprintf(stderr, "Error: DW_AT_specification was seen before the referenced DIE! (Looking for DIE at offset %08llx, in DIE at offset %08llx)\n", data, offset); + fprintf(stderr, + "Error: DW_AT_specification was seen before the referenced " + "DIE! (Looking for DIE at offset %08llx, in DIE at " + "offset %08llx)\n", data, offset); } break; } -- cgit v1.2.1