@@ -2244,11 +2244,11 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
22442244 LLDB_LOG (log, " Parsing symbol table for {0}" , file_name);
22452245 Progress progress (" Parsing symbol table" , file_name);
22462246
2247- llvm::MachO::symtab_command symtab_load_command = {0 , 0 , 0 , 0 , 0 , 0 };
22482247 llvm::MachO::linkedit_data_command function_starts_load_command = {0 , 0 , 0 , 0 };
22492248 llvm::MachO::linkedit_data_command exports_trie_load_command = {0 , 0 , 0 , 0 };
22502249 llvm::MachO::dyld_info_command dyld_info = {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };
22512250 llvm::MachO::dysymtab_command dysymtab = m_dysymtab;
2251+ SymtabCommandLargeOffsets symtab_load_command;
22522252 // The data element of type bool indicates that this entry is thumb
22532253 // code.
22542254 typedef AddressDataArray<lldb::addr_t , bool , 100 > FunctionStarts;
@@ -2285,12 +2285,20 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
22852285 // Watch for the symbol table load command
22862286 switch (lc.cmd ) {
22872287 case LC_SYMTAB:
2288+ // struct symtab_command {
2289+ // uint32_t cmd; /* LC_SYMTAB */
2290+ // uint32_t cmdsize; /* sizeof(struct symtab_command) */
2291+ // uint32_t symoff; /* symbol table offset */
2292+ // uint32_t nsyms; /* number of symbol table entries */
2293+ // uint32_t stroff; /* string table offset */
2294+ // uint32_t strsize; /* string table size in bytes */
2295+ // };
22882296 symtab_load_command.cmd = lc.cmd ;
22892297 symtab_load_command.cmdsize = lc.cmdsize ;
2290- // Read in the rest of the symtab load command
2291- if ( m_data.GetU32 (&offset, &symtab_load_command. symoff , 4 ) ==
2292- nullptr ) // fill in symoff, nsyms, stroff, strsize fields
2293- return ;
2298+ symtab_load_command. symoff = m_data. GetU32 (&offset);
2299+ symtab_load_command. nsyms = m_data.GetU32 (&offset);
2300+ symtab_load_command. stroff = m_data. GetU32 (&offset);
2301+ symtab_load_command. strsize = m_data. GetU32 (&offset) ;
22942302 break ;
22952303
22962304 case LC_DYLD_INFO:
0 commit comments