diff options
Diffstat (limited to 'src/common/mac/dump_syms.h')
-rw-r--r-- | src/common/mac/dump_syms.h | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/src/common/mac/dump_syms.h b/src/common/mac/dump_syms.h index c2e1b40b..5ccf49e3 100644 --- a/src/common/mac/dump_syms.h +++ b/src/common/mac/dump_syms.h @@ -43,6 +43,8 @@ #include <vector> #include "common/byte_cursor.h" +#include "common/dwarf/dwarf2reader.h" +#include "common/mac/arch_utilities.h" #include "common/mac/macho_reader.h" #include "common/mac/super_fat_arch.h" #include "common/module.h" @@ -55,7 +57,9 @@ class DumpSymbols { public: DumpSymbols(SymbolData symbol_data, bool handle_inter_cu_refs, - bool enable_multiple = false) + bool enable_multiple = false, + const std::string& module_name = "", + bool prefer_extern_name = false) : symbol_data_(symbol_data), handle_inter_cu_refs_(handle_inter_cu_refs), object_filename_(), @@ -65,12 +69,19 @@ class DumpSymbols { object_files_(), selected_object_file_(), selected_object_name_(), - enable_multiple_(enable_multiple) {} + enable_multiple_(enable_multiple), + module_name_(module_name), + prefer_extern_name_(prefer_extern_name) {} ~DumpSymbols() = default; // Prepare to read debugging information from |filename|. |filename| may be // the name of a fat file, a Mach-O file, or a dSYM bundle containing either - // of the above. On success, return true; if there is a problem reading + // of the above. + // + // If |module_name_| is empty, uses the basename of |filename| as the module + // name. Otherwise, uses |module_name_| as the module name. + // + // On success, return true; if there is a problem reading // |filename|, report it and return false. bool Read(const std::string& filename); @@ -82,26 +93,15 @@ class DumpSymbols { // problem reading |contents|, report it and return false. bool ReadData(uint8_t* contents, size_t size, const std::string& filename); - // If this dumper's file includes an object file for |cpu_type| and - // |cpu_subtype|, then select that object file for dumping, and return - // true. Otherwise, return false, and leave this dumper's selected - // architecture unchanged. - // - // By default, if this dumper's file contains only one object file, then - // the dumper will dump those symbols; and if it contains more than one - // object file, then the dumper will dump the object file whose - // architecture matches that of this dumper program. - bool SetArchitecture(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype); - - // If this dumper's file includes an object file for |arch_name|, then select - // that object file for dumping, and return true. Otherwise, return false, - // and leave this dumper's selected architecture unchanged. + // If this dumper's file includes an object file for `info`, then select that + // object file for dumping, and return true. Otherwise, return false, and + // leave this dumper's selected architecture unchanged. // // By default, if this dumper's file contains only one object file, then // the dumper will dump those symbols; and if it contains more than one // object file, then the dumper will dump the object file whose // architecture matches that of this dumper program. - bool SetArchitecture(const std::string& arch_name); + bool SetArchitecture(const ArchInfo& info); // Return a pointer to an array of SuperFatArch structures describing the // object files contained in this dumper's file. Set *|count| to the number @@ -144,6 +144,13 @@ class DumpSymbols { // Creates an empty module object. bool CreateEmptyModule(scoped_ptr<Module>& module); + // Process the split dwarf file referenced by reader. + void StartProcessSplitDwarf(google_breakpad::CompilationUnit* reader, + Module* module, + google_breakpad::Endianness endianness, + bool handle_inter_cu_refs, + bool handle_inline) const; + // Read debugging information from |dwarf_sections|, which was taken from // |macho_reader|, and add it to |module|. void ReadDwarf(google_breakpad::Module* module, @@ -204,6 +211,19 @@ class DumpSymbols { // See: https://crbug.com/google-breakpad/751 and docs at // docs/symbol_files.md#records-3 bool enable_multiple_; + + // If non-empty, used as the module name. Otherwise, the basename of + // |object_filename_| is used as the module name. + const std::string module_name_; + + // If a Function and an Extern share the same address but have a different + // name, prefer the name of the Extern. + // + // Use this when dumping Mach-O .dSYMs built with -gmlt (Minimum Line Tables), + // as the Function's fully-qualified name will only be present in the STABS + // (which are placed in the Extern), not in the DWARF symbols (which are + // placed in the Function). + bool prefer_extern_name_; }; } // namespace google_breakpad |