diff options
Diffstat (limited to 'src/common/mac/macho_reader.h')
-rw-r--r-- | src/common/mac/macho_reader.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/common/mac/macho_reader.h b/src/common/mac/macho_reader.h index 145d17d1..02762c55 100644 --- a/src/common/mac/macho_reader.h +++ b/src/common/mac/macho_reader.h @@ -78,7 +78,7 @@ class FatReader { class Reporter { public: // Create a reporter that attributes problems to |filename|. - explicit Reporter(const string &filename) : filename_(filename) { } + explicit Reporter(const string& filename) : filename_(filename) { } virtual ~Reporter() { } @@ -101,7 +101,7 @@ class FatReader { }; // Create a fat binary file reader that uses |reporter| to report problems. - explicit FatReader(Reporter *reporter) : reporter_(reporter) { } + explicit FatReader(Reporter* reporter) : reporter_(reporter) { } // Read the |size| bytes at |buffer| as a fat binary file. On success, // return true; on failure, report the problem to reporter_ and return @@ -110,7 +110,7 @@ class FatReader { // If the data is a plain Mach-O file, rather than a fat binary file, // then the reader behaves as if it had found a fat binary file whose // single object file is the Mach-O file. - bool Read(const uint8_t *buffer, size_t size); + bool Read(const uint8_t* buffer, size_t size); // Return an array of 'SuperFatArch' structures describing the // object files present in this fat binary file. Set |size| to the @@ -130,7 +130,7 @@ class FatReader { // possible to use the result with OS X functions like NXFindBestFatArch, // so that the symbol dumper will behave consistently with other OS X // utilities that work with fat binaries. - const SuperFatArch* object_files(size_t *count) const { + const SuperFatArch* object_files(size_t* count) const { *count = object_files_.size(); if (object_files_.size() > 0) return &object_files_[0]; @@ -139,7 +139,7 @@ class FatReader { private: // We use this to report problems parsing the file's contents. (WEAK) - Reporter *reporter_; + Reporter* reporter_; // The contents of the fat binary or Mach-O file we're parsing. We do not // own the storage it refers to. @@ -240,7 +240,7 @@ class Reader { class Reporter { public: // Create a reporter that attributes problems to |filename|. - explicit Reporter(const string &filename) : filename_(filename) { } + explicit Reporter(const string& filename) : filename_(filename) { } virtual ~Reporter() { } // Reporter functions for fatal errors return void; the reader will @@ -282,16 +282,16 @@ class Reader { // The LC_SEGMENT or LC_SEGMENT_64 load command for the segment named // |name| is too short to hold the sections that its header says it does. // (This more specific than LoadCommandTooShort.) - virtual void SectionsMissing(const string &name); + virtual void SectionsMissing(const string& name); // The segment named |name| claims that its contents lie beyond the end // of the file. - virtual void MisplacedSegmentData(const string &name); + virtual void MisplacedSegmentData(const string& name); // The section named |section| in the segment named |segment| claims that // its contents do not lie entirely within the segment. - virtual void MisplacedSectionData(const string §ion, - const string &segment); + virtual void MisplacedSectionData(const string& section, + const string& segment); // The LC_SYMTAB command claims that symbol table contents are located // beyond the end of the file. @@ -315,7 +315,7 @@ class Reader { // Called to report that the segment's section list contains |section|. // This should return true if the iteration should continue, or false // if it should stop. - virtual bool HandleSection(const Section §ion) = 0; + virtual bool HandleSection(const Section& section) = 0; }; // A handler for the load commands in a Mach-O file. @@ -341,20 +341,20 @@ class Reader { // cannot parse the command type or its size, we call // reporter_->IncompleteLoadCommand instead.) virtual bool UnknownCommand(LoadCommandType type, - const ByteBuffer &contents) { + const ByteBuffer& contents) { return true; } // The load command is LC_SEGMENT or LC_SEGMENT_64, defining a segment // with the properties given in |segment|. - virtual bool SegmentCommand(const Segment &segment) { + virtual bool SegmentCommand(const Segment& segment) { return true; } // The load command is LC_SYMTAB. |entries| holds the array of nlist // entries, and |names| holds the strings the entries refer to. - virtual bool SymtabCommand(const ByteBuffer &entries, - const ByteBuffer &names) { + virtual bool SymtabCommand(const ByteBuffer& entries, + const ByteBuffer& names) { return true; } @@ -362,7 +362,7 @@ class Reader { }; // Create a Mach-O file reader that reports problems to |reporter|. - explicit Reader(Reporter *reporter) + explicit Reader(Reporter* reporter) : reporter_(reporter) { } // Read the given data as a Mach-O file. The reader retains pointers @@ -371,11 +371,11 @@ class Reader { // // At most one of these functions should be invoked once on each Reader // instance. - bool Read(const uint8_t *buffer, + bool Read(const uint8_t* buffer, size_t size, cpu_type_t expected_cpu_type, cpu_subtype_t expected_cpu_subtype); - bool Read(const ByteBuffer &buffer, + bool Read(const ByteBuffer& buffer, cpu_type_t expected_cpu_type, cpu_subtype_t expected_cpu_subtype) { return Read(buffer.start, @@ -402,25 +402,25 @@ class Reader { // a handler function returns false. If we encounter a malformed load // command, report it via reporter_ and return false. Return true if all // load commands were parseable and all handlers returned true. - bool WalkLoadCommands(LoadCommandHandler *handler) const; + bool WalkLoadCommands(LoadCommandHandler* handler) const; // Set |segment| to describe the segment named |name|, if present. If // found, |segment|'s byte buffers refer to a subregion of the bytes // passed to Read. If we find the section, return true; otherwise, // return false. - bool FindSegment(const string &name, Segment *segment) const; + bool FindSegment(const string& name, Segment* segment) const; // Apply |handler| to each section defined in |segment|. If |handler| returns // false, stop iterating and return false. If all calls to |handler| return // true and we reach the end of the section list, return true. - bool WalkSegmentSections(const Segment &segment, SectionHandler *handler) + bool WalkSegmentSections(const Segment& segment, SectionHandler* handler) const; // Clear |section_map| and then populate it with a map of the sections // in |segment|, from section names to Section structures. // Each Section's contents refer to bytes in |segment|'s contents. // On success, return true; if a problem occurs, report it and return false. - bool MapSegmentSections(const Segment &segment, SectionMap *section_map) + bool MapSegmentSections(const Segment& segment, SectionMap* section_map) const; private: @@ -429,7 +429,7 @@ class Reader { class SectionMapper; // We use this to report problems parsing the file's contents. (WEAK) - Reporter *reporter_; + Reporter* reporter_; // The contents of the Mach-O file we're parsing. We do not own the // storage it refers to. |