Skip to content

Commit

Permalink
Various fixes and improvements to printpcs
Browse files Browse the repository at this point in the history
Search for an addr2line that supports elf32-i386.  Don't print the
path of addr2line as a side-effect of which.  Don't uselessly pipe
"grep '^ '" to addr2line's stdin.  Enable as many pretty-printing and
otherwise helpful options as possible (this makes the output *much*
more pleasant on modern addr2lines).
  • Loading branch information
Austin Clements committed Aug 24, 2012
1 parent 020acb4 commit 951b77f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions printpcs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/bin/sh

# Decode the symbols from a panic stack trace on stdin
# Decode the symbols from a panic EIP list

if which addr2line
then
p="addr2line"
else
p="i386-jos-elf-addr2line"
fi
echo grep '^ ' | $p -e kernel $*
# 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 "$@"

0 comments on commit 951b77f

Please sign in to comment.