aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-04-24 21:40:27 +0000
committerthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-04-24 21:40:27 +0000
commitaffac9413bd103f7a9bb1cbff947cdf106693cea (patch)
treebc71c89e33e21d40fd596a45299dca3691a6bf22 /src
parentAdd an option to not handle DWARF inter-compilation unit references in Linux ... (diff)
downloadbreakpad-affac9413bd103f7a9bb1cbff947cdf106693cea.tar.xz
Cleanup: Use scoped_ptr where appropriate in DwarfCUToModule.
Review URL: https://breakpad.appspot.com/572002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1164 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src')
-rw-r--r--src/common/dwarf_cu_to_module.cc19
-rw-r--r--src/common/dwarf_cu_to_module.h7
2 files changed, 13 insertions, 13 deletions
diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc
index 9f892290..8246daf9 100644
--- a/src/common/dwarf_cu_to_module.cc
+++ b/src/common/dwarf_cu_to_module.cc
@@ -133,12 +133,11 @@ DwarfCUToModule::FileContext::FileContext(const string &filename,
bool handle_inter_cu_refs)
: filename_(filename),
module_(module),
- handle_inter_cu_refs_(handle_inter_cu_refs) {
- file_private_ = new FilePrivate();
+ handle_inter_cu_refs_(handle_inter_cu_refs),
+ file_private_(new FilePrivate()) {
}
DwarfCUToModule::FileContext::~FileContext() {
- delete file_private_;
}
void DwarfCUToModule::FileContext::AddSectionToSectionMap(
@@ -675,14 +674,13 @@ void DwarfCUToModule::WarningReporter::UnhandledInterCUReference(
DwarfCUToModule::DwarfCUToModule(FileContext *file_context,
LineToModuleHandler *line_reader,
WarningReporter *reporter)
- : line_reader_(line_reader), has_source_line_info_(false) {
- cu_context_ = new CUContext(file_context, reporter);
- child_context_ = new DIEContext();
+ : line_reader_(line_reader),
+ cu_context_(new CUContext(file_context, reporter)),
+ child_context_(new DIEContext()),
+ has_source_line_info_(false) {
}
DwarfCUToModule::~DwarfCUToModule() {
- delete cu_context_;
- delete child_context_;
}
void DwarfCUToModule::ProcessAttributeSigned(enum DwarfAttribute attr,
@@ -737,12 +735,13 @@ dwarf2reader::DIEHandler *DwarfCUToModule::FindChildHandler(
enum DwarfTag tag) {
switch (tag) {
case dwarf2reader::DW_TAG_subprogram:
- return new FuncHandler(cu_context_, child_context_, offset);
+ return new FuncHandler(cu_context_.get(), child_context_.get(), offset);
case dwarf2reader::DW_TAG_namespace:
case dwarf2reader::DW_TAG_class_type:
case dwarf2reader::DW_TAG_structure_type:
case dwarf2reader::DW_TAG_union_type:
- return new NamedScopeHandler(cu_context_, child_context_, offset);
+ return new NamedScopeHandler(cu_context_.get(), child_context_.get(),
+ offset);
default:
return NULL;
}
diff --git a/src/common/dwarf_cu_to_module.h b/src/common/dwarf_cu_to_module.h
index 4f466ace..ab95485f 100644
--- a/src/common/dwarf_cu_to_module.h
+++ b/src/common/dwarf_cu_to_module.h
@@ -46,6 +46,7 @@
#include "common/dwarf/bytereader.h"
#include "common/dwarf/dwarf2diehandler.h"
#include "common/dwarf/dwarf2reader.h"
+#include "common/scoped_ptr.h"
#include "common/using_std_string.h"
namespace google_breakpad {
@@ -117,7 +118,7 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
const bool handle_inter_cu_refs_;
// Inter-compilation unit data used internally by the handlers.
- FilePrivate *file_private_;
+ scoped_ptr<FilePrivate> file_private_;
};
// An abstract base class for handlers that handle DWARF line data
@@ -291,10 +292,10 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
LineToModuleHandler *line_reader_;
// This compilation unit's context.
- CUContext *cu_context_;
+ scoped_ptr<CUContext> cu_context_;
// A context for our children.
- DIEContext *child_context_;
+ scoped_ptr<DIEContext> child_context_;
// True if this compilation unit has source line information.
bool has_source_line_info_;