DescriptionUnder i386 Darwin, DWARF eh_frame sections use a slightly different register numbering from the standard Linux (and debug section) numbering. %esp and %ebp are swapped relative to this standard ordering. Prior to this patch, running dump_syms on a Mach-O binary without debug info would produce garbage unwind instructions because these registers were swapped. Comparing the unwind instructions in Breakpad and dwarfdump revealed the apparent numbering issue. As well, http://llvm.org/docs/WritingAnLLVMBackend.html "Defining a Register" alludes to this strange difference with eh_frames under i386. The following definitions are used by LLVM for their register numbering (from X86RegisterInfo.td): def EBP : RegisterWithSubRegs<"ebp", [BP]>, DwarfRegNum<[-2, 4, 5]>; def ESP : RegisterWithSubRegs<"esp", [SP]>, DwarfRegNum<[-2, 5, 4]>; This patch addresses the above issue. When we are reading an i386 eh_frame section in the OS X version of dump_syms, we now use the proper register numbers with %esp = 5 and %ebp = 4. Patch Set 1 #Patch Set 2 : Replaced some tabs with spaces. #
Total comments: 1
MessagesTotal messages: 3
|