summaryrefslogtreecommitdiff
path: root/printpcs
diff options
context:
space:
mode:
Diffstat (limited to 'printpcs')
-rwxr-xr-xprintpcs14
1 files changed, 14 insertions, 0 deletions
diff --git a/printpcs b/printpcs
new file mode 100755
index 0000000..81d039b
--- /dev/null
+++ b/printpcs
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Decode the symbols from a panic EIP list
+
+# Find a working addr2line
+for p in i386-jos-elf-addr2line addr2line; do
+ if which $p 2>&1 >/dev/null && \
+ $p -h 2>&1 | grep -q '\belf32-i386\b'; then
+ break
+ fi
+done
+
+# Enable as much pretty-printing as this addr2line can do
+$p $($p -h | grep ' -[aipsf] ' | awk '{print $1}') -e kernel "$@"