diff options
author | Mike Frysinger <vapier@chromium.org> | 2020-06-23 18:55:43 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@chromium.org> | 2020-07-15 06:20:02 +0000 |
commit | 09b056975dacd1f0f815ad820b6dc9913b0118a3 (patch) | |
tree | 67ba67549b44e6d98b9ff2dfb3e0396e0a252b96 /src/common/mac/dump_syms.cc | |
parent | Add support for dwarf5 line tables. (diff) | |
download | breakpad-09b056975dacd1f0f815ad820b6dc9913b0118a3.tar.xz |
fix pointer style to match the style guide
We do this in a lot of places, but we're inconsistent.
Normalize the code to the Google C++ style guide.
Change-Id: Ic2aceab661ce8f6b993dda21b1cdf5d2198dcbbf
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2262932
Reviewed-by: Sterling Augustine <saugustine@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Diffstat (limited to 'src/common/mac/dump_syms.cc')
-rw-r--r-- | src/common/mac/dump_syms.cc | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index 2734ff6f..24bcd653 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -120,7 +120,7 @@ vector<string> list_directory(const string& directory) { namespace google_breakpad { -bool DumpSymbols::Read(const string &filename) { +bool DumpSymbols::Read(const string& filename) { struct stat st; if (stat(filename.c_str(), &st) == -1) { fprintf(stderr, "Could not access object file %s: %s\n", @@ -195,7 +195,7 @@ bool DumpSymbols::Read(const string &filename) { // Get our own copy of fat_reader's object file list. size_t object_files_count; - const SuperFatArch *object_files = + const SuperFatArch* object_files = fat_reader.object_files(&object_files_count); if (object_files_count == 0) { fprintf(stderr, "Fat binary file contains *no* architectures: %s\n", @@ -212,7 +212,7 @@ bool DumpSymbols::Read(const string &filename) { bool DumpSymbols::SetArchitecture(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { // Find the best match for the architecture the user requested. - const SuperFatArch *best_match = FindBestMatchForArchitecture( + const SuperFatArch* best_match = FindBestMatchForArchitecture( cpu_type, cpu_subtype); if (!best_match) return false; @@ -221,9 +221,9 @@ bool DumpSymbols::SetArchitecture(cpu_type_t cpu_type, return true; } -bool DumpSymbols::SetArchitecture(const std::string &arch_name) { +bool DumpSymbols::SetArchitecture(const std::string& arch_name) { bool arch_set = false; - const NXArchInfo *arch_info = + const NXArchInfo* arch_info = google_breakpad::BreakpadGetArchInfoFromName(arch_name.c_str()); if (arch_info) { arch_set = SetArchitecture(arch_info->cputype, arch_info->cpusubtype); @@ -251,7 +251,7 @@ SuperFatArch* DumpSymbols::FindBestMatchForArchitecture( // If all the object files can be converted to struct fat_arch, use // NXFindBestFatArch. if (can_convert_to_fat_arch) { - const struct fat_arch *best_match + const struct fat_arch* best_match = NXFindBestFatArch(cpu_type, cpu_subtype, &fat_arch_vector[0], static_cast<uint32_t>(fat_arch_vector.size())); @@ -311,7 +311,7 @@ string DumpSymbols::Identifier() { class DumpSymbols::DumperRangesHandler: public DwarfCUToModule::RangesHandler { public: - DumperRangesHandler(const uint8_t *buffer, uint64_t size, + DumperRangesHandler(const uint8_t* buffer, uint64_t size, dwarf2reader::ByteReader* reader) : buffer_(buffer), size_(size), reader_(reader) { } @@ -325,7 +325,7 @@ class DumpSymbols::DumperRangesHandler: } private: - const uint8_t *buffer_; + const uint8_t* buffer_; uint64_t size_; dwarf2reader::ByteReader* reader_; }; @@ -337,7 +337,7 @@ class DumpSymbols::DumperLineToModule: public DwarfCUToModule::LineToModuleHandler { public: // Create a line-to-module converter using BYTE_READER. - DumperLineToModule(dwarf2reader::ByteReader *byte_reader) + DumperLineToModule(dwarf2reader::ByteReader* byte_reader) : byte_reader_(byte_reader) { } void StartCompilationUnit(const string& compilation_dir) { @@ -357,7 +357,7 @@ class DumpSymbols::DumperLineToModule: } private: string compilation_dir_; - dwarf2reader::ByteReader *byte_reader_; // WEAK + dwarf2reader::ByteReader* byte_reader_; // WEAK }; bool DumpSymbols::CreateEmptyModule(scoped_ptr<Module>& module) { @@ -369,7 +369,7 @@ bool DumpSymbols::CreateEmptyModule(scoped_ptr<Module>& module) { selected_object_file_ = &object_files_[0]; else { // Look for an object file whose architecture matches our own. - const NXArchInfo *local_arch = NXGetLocalArchInfo(); + const NXArchInfo* local_arch = NXGetLocalArchInfo(); if (!SetArchitecture(local_arch->cputype, local_arch->cpusubtype)) { fprintf(stderr, "%s: object file contains more than one" " architecture, none of which match the current" @@ -385,11 +385,11 @@ bool DumpSymbols::CreateEmptyModule(scoped_ptr<Module>& module) { // Find the name of the selected file's architecture, to appear in // the MODULE record and in error messages. - const NXArchInfo *selected_arch_info = + const NXArchInfo* selected_arch_info = google_breakpad::BreakpadGetArchInfoFromCpuType( selected_object_file_->cputype, selected_object_file_->cpusubtype); - const char *selected_arch_name = selected_arch_info->name; + const char* selected_arch_name = selected_arch_info->name; if (strcmp(selected_arch_name, "i386") == 0) selected_arch_name = "x86"; @@ -418,9 +418,9 @@ bool DumpSymbols::CreateEmptyModule(scoped_ptr<Module>& module) { return true; } -void DumpSymbols::ReadDwarf(google_breakpad::Module *module, - const mach_o::Reader &macho_reader, - const mach_o::SectionMap &dwarf_sections, +void DumpSymbols::ReadDwarf(google_breakpad::Module* module, + const mach_o::Reader& macho_reader, + const mach_o::SectionMap& dwarf_sections, bool handle_inter_cu_refs) const { // Build a byte reader of the appropriate endianness. ByteReader byte_reader(macho_reader.big_endian() @@ -461,7 +461,7 @@ void DumpSymbols::ReadDwarf(google_breakpad::Module *module, dwarf2reader::SectionMap::const_iterator ranges_entry = file_context.section_map().find("__debug_ranges"); if (ranges_entry != file_context.section_map().end()) { - const std::pair<const uint8_t *, uint64_t>& ranges_section = + const std::pair<const uint8_t*, uint64_t>& ranges_section = ranges_entry->second; ranges_handler.reset( new DumperRangesHandler(ranges_section.first, ranges_section.second, @@ -490,9 +490,9 @@ void DumpSymbols::ReadDwarf(google_breakpad::Module *module, } } -bool DumpSymbols::ReadCFI(google_breakpad::Module *module, - const mach_o::Reader &macho_reader, - const mach_o::Section §ion, +bool DumpSymbols::ReadCFI(google_breakpad::Module* module, + const mach_o::Reader& macho_reader, + const mach_o::Section& section, bool eh_frame) const { // Find the appropriate set of register names for this file's // architecture. @@ -511,7 +511,7 @@ bool DumpSymbols::ReadCFI(google_breakpad::Module *module, register_names = DwarfCFIToModule::RegisterNames::ARM64(); break; default: { - const NXArchInfo *arch = google_breakpad::BreakpadGetArchInfoFromCpuType( + const NXArchInfo* arch = google_breakpad::BreakpadGetArchInfoFromCpuType( macho_reader.cpu_type(), macho_reader.cpu_subtype()); fprintf(stderr, "%s: cannot convert DWARF call frame information for ", selected_object_name_.c_str()); @@ -526,7 +526,7 @@ bool DumpSymbols::ReadCFI(google_breakpad::Module *module, } // Find the call frame information and its size. - const uint8_t *cfi = section.contents.start; + const uint8_t* cfi = section.contents.start; size_t cfi_size = section.contents.Size(); // Plug together the parser, handler, and their entourages. @@ -558,9 +558,9 @@ class DumpSymbols::LoadCommandDumper: public: // Create a load command dumper handling load commands from READER's // file, and adding data to MODULE. - LoadCommandDumper(const DumpSymbols &dumper, - google_breakpad::Module *module, - const mach_o::Reader &reader, + LoadCommandDumper(const DumpSymbols& dumper, + google_breakpad::Module* module, + const mach_o::Reader& reader, SymbolData symbol_data, bool handle_inter_cu_refs) : dumper_(dumper), @@ -569,18 +569,18 @@ class DumpSymbols::LoadCommandDumper: symbol_data_(symbol_data), handle_inter_cu_refs_(handle_inter_cu_refs) { } - bool SegmentCommand(const mach_o::Segment &segment); - bool SymtabCommand(const ByteBuffer &entries, const ByteBuffer &strings); + bool SegmentCommand(const mach_o::Segment& segment); + bool SymtabCommand(const ByteBuffer& entries, const ByteBuffer& strings); private: - const DumpSymbols &dumper_; - google_breakpad::Module *module_; // WEAK - const mach_o::Reader &reader_; + const DumpSymbols& dumper_; + google_breakpad::Module* module_; // WEAK + const mach_o::Reader& reader_; const SymbolData symbol_data_; const bool handle_inter_cu_refs_; }; -bool DumpSymbols::LoadCommandDumper::SegmentCommand(const Segment &segment) { +bool DumpSymbols::LoadCommandDumper::SegmentCommand(const Segment& segment) { mach_o::SectionMap section_map; if (!reader_.MapSegmentSections(segment, §ion_map)) return false; @@ -615,8 +615,8 @@ bool DumpSymbols::LoadCommandDumper::SegmentCommand(const Segment &segment) { return true; } -bool DumpSymbols::LoadCommandDumper::SymtabCommand(const ByteBuffer &entries, - const ByteBuffer &strings) { +bool DumpSymbols::LoadCommandDumper::SymtabCommand(const ByteBuffer& entries, + const ByteBuffer& strings) { StabsToModule stabs_to_module(module_); // Mac OS X STABS are never "unitized", and the size of the 'value' field // matches the address size of the executable. @@ -658,7 +658,7 @@ bool DumpSymbols::ReadSymbolData(Module** out_module) { return true; } -bool DumpSymbols::WriteSymbolFile(std::ostream &stream) { +bool DumpSymbols::WriteSymbolFile(std::ostream& stream) { Module* module = NULL; if (ReadSymbolData(&module) && module) { @@ -673,7 +673,7 @@ bool DumpSymbols::WriteSymbolFile(std::ostream &stream) { // Read the selected object file's debugging information, and write out the // header only to |stream|. Return true on success; if an error occurs, report // it and return false. -bool DumpSymbols::WriteSymbolFileHeader(std::ostream &stream) { +bool DumpSymbols::WriteSymbolFileHeader(std::ostream& stream) { scoped_ptr<Module> module; if (!CreateEmptyModule(module)) return false; |