diff options
Diffstat (limited to '3rdParty/Breakpad/src/common/mac/dump_syms.h')
-rw-r--r-- | 3rdParty/Breakpad/src/common/mac/dump_syms.h | 76 |
1 files changed, 50 insertions, 26 deletions
diff --git a/3rdParty/Breakpad/src/common/mac/dump_syms.h b/3rdParty/Breakpad/src/common/mac/dump_syms.h index 0e2f464..9463f7d 100644 --- a/3rdParty/Breakpad/src/common/mac/dump_syms.h +++ b/3rdParty/Breakpad/src/common/mac/dump_syms.h @@ -37,3 +37,2 @@ -#include <Foundation/Foundation.h> #include <mach-o/loader.h> @@ -48,3 +47,6 @@ #include "common/mac/macho_reader.h" +#include "common/mac/super_fat_arch.h" #include "common/module.h" +#include "common/scoped_ptr.h" +#include "common/symbol_data.h" @@ -54,6 +56,9 @@ class DumpSymbols { public: - DumpSymbols() - : input_pathname_(), + DumpSymbols(SymbolData symbol_data, bool handle_inter_cu_refs) + : symbol_data_(symbol_data), + handle_inter_cu_refs_(handle_inter_cu_refs), + input_pathname_(), object_filename_(), contents_(), + object_files_(), selected_object_file_(), @@ -61,5 +66,2 @@ class DumpSymbols { ~DumpSymbols() { - [input_pathname_ release]; - [object_filename_ release]; - [contents_ release]; } @@ -70,7 +72,3 @@ class DumpSymbols { // problem reading |filename|, report it and return false. - // - // (This class uses NSString for filenames and related values, - // because the Mac Foundation framework seems to support - // filename-related operations more fully on NSString values.) - bool Read(NSString *filename); + bool Read(const std::string &filename); @@ -97,6 +95,6 @@ class DumpSymbols { - // Return a pointer to an array of 'struct fat_arch' structures, - // describing the object files contained in this dumper's file. Set - // *|count| to the number of elements in the array. The returned array is - // owned by this DumpSymbols instance. + // Return a pointer to an array of SuperFatArch structures describing the + // object files contained in this dumper's file. Set *|count| to the number + // of elements in the array. The returned array is owned by this DumpSymbols + // instance. // @@ -104,3 +102,3 @@ class DumpSymbols { // may return NULL. - const struct fat_arch *AvailableArchitectures(size_t *count) { + const SuperFatArch* AvailableArchitectures(size_t *count) { *count = object_files_.size(); @@ -112,5 +110,15 @@ class DumpSymbols { // Read the selected object file's debugging information, and write it out to - // |stream|. Write the CFI section if |cfi| is true. Return true on success; - // if an error occurs, report it and return false. - bool WriteSymbolFile(std::ostream &stream, bool cfi); + // |stream|. Return true on success; if an error occurs, report it and + // return false. + bool 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 WriteSymbolFileHeader(std::ostream &stream); + + // As above, but simply return the debugging information in module + // instead of writing it to a stream. The caller owns the resulting + // module object and must delete it when finished. + bool ReadSymbolData(Module** module); @@ -121,2 +129,7 @@ class DumpSymbols { + // This method behaves similarly to NXFindBestFatArch, but it supports + // SuperFatArch. + SuperFatArch* FindBestMatchForArchitecture( + cpu_type_t cpu_type, cpu_subtype_t cpu_subtype); + // Return an identifier string for the file this DumpSymbols is dumping. @@ -124,2 +137,6 @@ class DumpSymbols { + + // Creates an empty module object. + bool CreateEmptyModule(scoped_ptr<Module>& module); + // Read debugging information from |dwarf_sections|, which was taken from @@ -129,3 +146,4 @@ class DumpSymbols { const mach_o::Reader &macho_reader, - const mach_o::SectionMap &dwarf_sections) const; + const mach_o::SectionMap &dwarf_sections, + bool handle_inter_cu_refs) const; @@ -141,5 +159,11 @@ class DumpSymbols { + // The selection of what type of symbol data to read/write. + const SymbolData symbol_data_; + + // Whether to handle references between compilation units. + const bool handle_inter_cu_refs_; + // The name of the file or bundle whose symbols this will dump. // This is the path given to Read, for use in error messages. - NSString *input_pathname_; + std::string input_pathname_; @@ -149,8 +173,8 @@ class DumpSymbols { // within that bundle. - NSString *object_filename_; + std::string object_filename_; // The complete contents of object_filename_, mapped into memory. - NSData *contents_; + scoped_array<uint8_t> contents_; - // A vector of fat_arch structures describing the object files + // A vector of SuperFatArch structures describing the object files // object_filename_ contains. If object_filename_ refers to a fat binary, @@ -158,3 +182,3 @@ class DumpSymbols { // has exactly one element. - vector<struct fat_arch> object_files_; + vector<SuperFatArch> object_files_; @@ -162,3 +186,3 @@ class DumpSymbols { // SetArchitecture hasn't been called yet. - const struct fat_arch *selected_object_file_; + const SuperFatArch *selected_object_file_; |