Fix for http://breakpad.appspot.com/18009 - run dump_syms on both PPC & i386 machines correctly, and process STABS/DWARF information in the same binary

R=stuart morgan
A=nealsid



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@359 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
nealsid 2009-07-17 20:32:08 +00:00
parent f4f249e544
commit 23c364a2b4

View File

@ -321,13 +321,16 @@ void DumpFunctionMap(const dwarf2reader::FunctionMap function_map) {
//=============================================================================
- (BOOL)loadSymbolInfo:(void *)base offset:(uint32_t)offset {
BOOL loadedStabs = [self loadSTABSSymbolInfo:base offset:offset];
NSMutableDictionary *archSections = [sectionData_ objectForKey:architecture_];
BOOL loadedDWARF = NO;
if ([archSections objectForKey:@"__DWARF__debug_info"]) {
// Treat this this as debug information
return [self loadDWARFSymbolInfo:base offset:offset];
loadedDWARF = [self loadDWARFSymbolInfo:base offset:offset];
}
return [self loadSTABSSymbolInfo:base offset:offset];
return loadedDWARF || loadedStabs;
}
//=============================================================================
@ -342,11 +345,15 @@ void DumpFunctionMap(const dwarf2reader::FunctionMap function_map) {
section *dbgInfoSection = [[archSections objectForKey:@"__DWARF__debug_info"] sectionPointer];
uint32_t debugInfoSize = SwapLongIfNeeded(dbgInfoSection->size);
// i think this will break if run on a big-endian machine
#if __BIG_ENDIAN__
dwarf2reader::ByteReader byte_reader(swap ?
dwarf2reader::ENDIANNESS_LITTLE :
dwarf2reader::ENDIANNESS_BIG);
#elif __LITTLE_ENDIAN__
dwarf2reader::ByteReader byte_reader(swap ?
dwarf2reader::ENDIANNESS_BIG :
dwarf2reader::ENDIANNESS_LITTLE);
#endif
uint64_t dbgOffset = 0;
dwarf2reader::SectionMap* oneArchitectureSectionMap = [self getSectionMapForArchitecture:architecture_];