diff --git a/src/common/dwarf_cu_to_module.h b/src/common/dwarf_cu_to_module.h index d83108437..82c25091d 100644 --- a/src/common/dwarf_cu_to_module.h +++ b/src/common/dwarf_cu_to_module.h @@ -254,61 +254,61 @@ class DwarfCUToModule: public RootDIEHandler { void UncoveredHeading(); }; - class NullWarningReporter: public WarningReporter { + class NullWarningReporter : public WarningReporter { public: - NullWarningReporter(const string &filename, uint64_t cu_offset): - WarningReporter(filename, cu_offset) { } + NullWarningReporter(const string& filename, uint64_t cu_offset) + : WarningReporter(filename, cu_offset) {} // Set the name of the compilation unit we're processing to NAME. - void SetCUName(const string &name) { } + void SetCUName(const string& name) {} // Accessor and setter for uncovered_warnings_enabled_. // UncoveredFunction and UncoveredLine only report a problem if that is // true. By default, these warnings are disabled, because those // conditions occur occasionally in healthy code. - void set_uncovered_warnings_enabled(bool value) { } + void set_uncovered_warnings_enabled(bool value) {} // A DW_AT_specification in the DIE at OFFSET refers to a DIE we // haven't processed yet, or that wasn't marked as a declaration, // at TARGET. - void UnknownSpecification(uint64_t offset, uint64_t target) { } + void UnknownSpecification(uint64_t offset, uint64_t target) {} // A DW_AT_abstract_origin in the DIE at OFFSET refers to a DIE we // haven't processed yet, or that wasn't marked as inline, at TARGET. - void UnknownAbstractOrigin(uint64_t offset, uint64_t target) { } + void UnknownAbstractOrigin(uint64_t offset, uint64_t target) {} // We were unable to find the DWARF section named SECTION_NAME. - void MissingSection(const string §ion_name) { } + void MissingSection(const string& section_name) {} // The CU's DW_AT_stmt_list offset OFFSET is bogus. - void BadLineInfoOffset(uint64_t offset) { } + void BadLineInfoOffset(uint64_t offset) {} // FUNCTION includes code covered by no line number data. - void UncoveredFunction(const Module::Function &function) { } + void UncoveredFunction(const Module::Function& function) {} // Line number NUMBER in LINE_FILE, of length LENGTH, includes code // covered by no function. - void UncoveredLine(const Module::Line &line) { } + void UncoveredLine(const Module::Line& line) {} // The DW_TAG_subprogram DIE at OFFSET has no name specified directly // in the DIE, nor via a DW_AT_specification or DW_AT_abstract_origin // link. - void UnnamedFunction(uint64_t offset) { } + void UnnamedFunction(uint64_t offset) {} // __cxa_demangle() failed to demangle INPUT. - void DemangleError(const string &input) { } + void DemangleError(const string& input) {} // The DW_FORM_ref_addr at OFFSET to TARGET was not handled because // FilePrivate did not retain the inter-CU specification data. - void UnhandledInterCUReference(uint64_t offset, uint64_t target) { } + void UnhandledInterCUReference(uint64_t offset, uint64_t target) {} // The DW_AT_ranges at offset is malformed (truncated or outside of the // .debug_ranges section's bound). - void MalformedRangeList(uint64_t offset) { } + void MalformedRangeList(uint64_t offset) {} // A DW_AT_ranges attribute was encountered but the no .debug_ranges // section was found. - void MissingRanges() { } + void MissingRanges() {} }; // Create a DWARF debugging info handler for a compilation unit diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index bcb62413f..3c56734d6 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -528,13 +528,13 @@ void DumpSymbols::ReadDwarf(google_breakpad::Module* module, for (uint64_t offset = 0; offset < debug_info_length;) { // Make a handler for the root DIE that populates MODULE with the // debug info. - DwarfCUToModule::WarningReporter *reporter = nullptr; + std::unique_ptr reporter; if (report_warnings_) { - reporter = new DwarfCUToModule::WarningReporter( - selected_object_name_, offset); + reporter = std::make_unique( + selected_object_name_, offset); } else { - reporter = new DwarfCUToModule::NullWarningReporter( - selected_object_name_, offset); + reporter = std::make_unique( + selected_object_name_, offset); } DwarfCUToModule root_handler(&file_context, &line_to_module, &ranges_handler, reporter, @@ -554,7 +554,6 @@ void DumpSymbols::ReadDwarf(google_breakpad::Module* module, StartProcessSplitDwarf(&dwarf_reader, module, endianness, handle_inter_cu_refs, handle_inline); } - delete reporter; } }