summaryrefslogtreecommitdiff
path: root/3rdparty/libbacktrace/filetype.awk
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-04-05 19:36:23 +0200
committerGitHub <noreply@github.com>2020-04-05 19:36:23 +0200
commit0c7baa39ae58eaf7f823f04a57247e1cc7ab604f (patch)
tree8def48313a6f33bbc4c5e44431bd4c5a0462de01 /3rdparty/libbacktrace/filetype.awk
parentdd7f653b00239299cdecb7ca826c21e5957863da (diff)
parentc0e51f774c8c3c0ee763e166fd4534624966edcf (diff)
downloadhercules-0c7baa39ae58eaf7f823f04a57247e1cc7ab604f.tar.gz
hercules-0c7baa39ae58eaf7f823f04a57247e1cc7ab604f.tar.bz2
hercules-0c7baa39ae58eaf7f823f04a57247e1cc7ab604f.tar.xz
hercules-0c7baa39ae58eaf7f823f04a57247e1cc7ab604f.zip
Merge pull request #2581 from 4144/backtrace
Add proper backtrace logging even if functions is hidden.
Diffstat (limited to '3rdparty/libbacktrace/filetype.awk')
-rw-r--r--3rdparty/libbacktrace/filetype.awk11
1 files changed, 11 insertions, 0 deletions
diff --git a/3rdparty/libbacktrace/filetype.awk b/3rdparty/libbacktrace/filetype.awk
new file mode 100644
index 000000000..a5f6c8cc1
--- /dev/null
+++ b/3rdparty/libbacktrace/filetype.awk
@@ -0,0 +1,11 @@
+# An awk script to determine the type of a file.
+/\177ELF\001/ { if (NR == 1) { print "elf32"; exit } }
+/\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 } }