bornintelligent / google-breakpad

Automatically exported from code.google.com/p/google-breakpad
0 stars 0 forks source link

DWARF support in dump_syms on Mac OS X crashes for 64-bit binaries #289

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a 64-bit binary with external DWARF symbols
2. use dump_syms to dump the DWARF dSYM file for the 64-bit architecture

-> this will crash

attached is a patch that fixes the handling of DWARF symbols for 64-bit 
binaries. It does duplicate 
one function that looks like quite a bit of it could be shared, but it's a 
starting point, I think...

Original issue reported on code.google.com by j...@mac.com on 11 Dec 2008 at 4:34

Attachments:

GoogleCodeExporter commented 9 years ago
Ah sorry, that patch is based on rev 303.

Original comment by j...@mac.com on 11 Dec 2008 at 4:35

GoogleCodeExporter commented 9 years ago
Here's a new version of the patch that fixes problems with reading 64-bit DWARF 
symbols of the opposed 
endianness. Based on rev 303, too.

Original comment by j...@mac.com on 15 Dec 2008 at 4:04

Attachments:

GoogleCodeExporter commented 9 years ago
Hi
Thanks a lot for the patch. I'm in the middle of reviewing it, hope to get 
through it next week.

Thanks again!

Original comment by neal...@gmail.com on 22 Feb 2009 at 1:34

GoogleCodeExporter commented 9 years ago
Is this bug still open?  The dump_syms code to support 64-bit executables is 
pretty
strange: it only calls generateSectionDictionary from loadHeader:offset:, not
loadHeader64:offset:; it only calls loadDwarfSymbolInfo:offset: from
loadSymbolInfo:offset:, not loadSymbolInfo64:offset:; and probably more.

$ cat hello.c
#include <stdio.h>

int main(int argc, char **argv) {
  printf("Hello, world!\n");
  return 0;
}
$ gcc -g3 hello.c -o hello
$ file hello
hello: Mach-O 64-bit executable x86_64
$ breakpad/src/tools/mac/dump_syms/build/Debug/dump_syms -a x86_64 hello
Unable to calculate UUID of mach-o binary!
$ 

Original comment by jimbla...@gmail.com on 16 Feb 2010 at 9:37

GoogleCodeExporter commented 9 years ago
> Unable to calculate UUID of mach-o binary!

A patch "Fix dump_syms for x86_64.patch" to fix this and other bugs when 
dumping 
symbols from x86_64 is attached (complete versions of modified files are also 
attached).

Original comment by amordo...@gmail.com on 22 Feb 2010 at 3:58

Attachments:

GoogleCodeExporter commented 9 years ago
jimb is hacking on dump_syms for OS X.

Original comment by ted.mielczarek on 27 Apr 2010 at 5:23

GoogleCodeExporter commented 9 years ago
> jimb is hacking on dump_syms for OS X.

Revision 607. dump_syms still returns "Unable to calculate UUID of mach-o 
binary" on x86_64 binary

Original comment by amordo...@gmail.com on 16 Jun 2010 at 5:21

GoogleCodeExporter commented 9 years ago
Fixed in r614 or earlier.

Original comment by ted.mielczarek on 29 Jun 2010 at 4:45