summaryrefslogtreecommitdiff
path: root/printpcs
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2012-08-28 12:57:13 -0400
committerRobert Morris <[email protected]>2012-08-28 12:57:13 -0400
commitc1ee7eb4d31bd17e48857479fec8f4c2065d4b7d (patch)
treee54d9304b6f5d90bdf7a926808fd7d5923d39526 /printpcs
parent8960f60b30b69a1f45ffa9d8b2b204714725f1fa (diff)
parent951b77f7eced2165312d5c12d6256e874dba10f8 (diff)
downloadxv6-labs-c1ee7eb4d31bd17e48857479fec8f4c2065d4b7d.tar.gz
xv6-labs-c1ee7eb4d31bd17e48857479fec8f4c2065d4b7d.tar.bz2
xv6-labs-c1ee7eb4d31bd17e48857479fec8f4c2065d4b7d.zip
Merge branch 'master' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6
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 "$@"