From 23c364a2b4ded86287caf325aa533a3c24020348 Mon Sep 17 00:00:00 2001 From: nealsid Date: Fri, 17 Jul 2009 20:32:08 +0000 Subject: 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 --- src/common/mac/dump_syms.mm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/common/mac/dump_syms.mm b/src/common/mac/dump_syms.mm index 88f1f4f1..73e4f76a 100644 --- a/src/common/mac/dump_syms.mm +++ b/src/common/mac/dump_syms.mm @@ -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_]; -- cgit v1.2.1