@@ -2244,11 +2244,11 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
2244
2244
LLDB_LOG (log , " Parsing symbol table for {0}" , file_name);
2245
2245
Progress progress (" Parsing symbol table" , file_name);
2246
2246
2247
- llvm::MachO::symtab_command symtab_load_command = {0 , 0 , 0 , 0 , 0 , 0 };
2248
2247
llvm::MachO::linkedit_data_command function_starts_load_command = {0 , 0 , 0 , 0 };
2249
2248
llvm::MachO::linkedit_data_command exports_trie_load_command = {0 , 0 , 0 , 0 };
2250
2249
llvm::MachO::dyld_info_command dyld_info = {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };
2251
2250
llvm::MachO::dysymtab_command dysymtab = m_dysymtab;
2251
+ SymtabCommandLargeOffsets symtab_load_command;
2252
2252
// The data element of type bool indicates that this entry is thumb
2253
2253
// code.
2254
2254
typedef AddressDataArray<lldb::addr_t , bool , 100 > FunctionStarts;
@@ -2285,12 +2285,20 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
2285
2285
// Watch for the symbol table load command
2286
2286
switch (lc.cmd ) {
2287
2287
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
+ // };
2288
2296
symtab_load_command.cmd = lc.cmd ;
2289
2297
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) ;
2294
2302
break ;
2295
2303
2296
2304
case LC_DYLD_INFO:
0 commit comments