提交 951b77f7 创建 作者: Austin Clements's avatar Austin Clements

Various fixes and improvements to printpcs

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).
上级 020acb4f
#!/bin/sh #!/bin/sh
# Decode the symbols from a panic stack trace on stdin # Decode the symbols from a panic EIP list
if which addr2line # Find a working addr2line
then for p in i386-jos-elf-addr2line addr2line; do
p="addr2line" if which $p 2>&1 >/dev/null && \
else $p -h 2>&1 | grep -q '\belf32-i386\b'; then
p="i386-jos-elf-addr2line" break
fi fi
echo grep '^ ' | $p -e kernel $* done
# Enable as much pretty-printing as this addr2line can do
$p $($p -h | grep ' -[aipsf] ' | awk '{print $1}') -e kernel "$@"
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论