Skip to content

Commit

Permalink
Add libbacktrace support for Apple platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnColanduoni authored and kennytm committed Sep 1, 2017
1 parent f861b6e commit e8121b3
Show file tree
Hide file tree
Showing 8 changed files with 1,458 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/libbacktrace/configure
Original file line number Diff line number Diff line change
Expand Up @@ -11844,6 +11844,9 @@ elf*) FORMAT_FILE="elf.lo" ;;
pecoff) FORMAT_FILE="pecoff.lo"
backtrace_supports_data=no
;;
macho*) FORMAT_FILE="macho.lo"
backtrace_supports_data=no
;;
*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not determine output file type" >&5
$as_echo "$as_me: WARNING: could not determine output file type" >&2;}
FORMAT_FILE="unknown.lo"
Expand Down
3 changes: 3 additions & 0 deletions src/libbacktrace/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ elf*) FORMAT_FILE="elf.lo" ;;
pecoff) FORMAT_FILE="pecoff.lo"
backtrace_supports_data=no
;;
macho*) FORMAT_FILE="macho.lo"
backtrace_supports_data=no
;;
*) AC_MSG_WARN([could not determine output file type])
FORMAT_FILE="unknown.lo"
backtrace_supported=no
Expand Down
6 changes: 6 additions & 0 deletions src/libbacktrace/filetype.awk
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
/\177ELF\002/ { if (NR == 1) { print "elf64"; exit } }
/\114\001/ { if (NR == 1) { print "pecoff"; exit } }
/\144\206/ { if (NR == 1) { print "pecoff"; exit } }
/\xFE\xED\xFA\xCE/ { if (NR == 1) { print "macho32"; exit } }
/\xCE\xFA\xED\xFE/ { if (NR == 1) { print "macho32"; exit } }
/\xFE\xED\xFA\xCF/ { if (NR == 1) { print "macho64"; exit } }
/\xCF\xFA\xED\xFE/ { if (NR == 1) { print "macho64"; exit } }
/\xCA\xFE\xBA\xBE/ { if (NR == 1) { print "macho-fat"; exit } }
/\xBE\xBA\xFE\xCA/ { if (NR == 1) { print "macho-fat"; exit } }
Loading

0 comments on commit e8121b3

Please sign in to comment.