Yegor Timoshenko | c2e4941 | 2018-10-07 01:58:27 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Rudolf Marek | 8679e52 | 2011-09-02 23:34:15 +0200 | [diff] [blame] | 2 | #Parse a log and get back the function names and line numbers |
| 3 | #Provide a log file as first argument |
| 4 | |
| 5 | #Please rewrite to something more saner ! |
| 6 | |
| 7 | cat $1 | while read line ; do |
| 8 | A=`echo $line | cut -c 1` |
| 9 | |
| 10 | if [ "$A" = '~' ] ; then |
| 11 | FROM=`echo $line | tr \~ \( | tr \) \( | awk -F\( '{print $3}'` |
| 12 | TO=`echo $line | tr \~ \( | tr \) \(|awk -F\( '{print $2}'` |
Furquan Shaikh | 20f25dd | 2014-04-22 10:41:05 -0700 | [diff] [blame] | 13 | addr2line -e ../../build/cbfs/fallback/ramstage.debug "$FROM" | tr -d "\n" |
Rudolf Marek | 8679e52 | 2011-09-02 23:34:15 +0200 | [diff] [blame] | 14 | echo -n " calls " |
Furquan Shaikh | 20f25dd | 2014-04-22 10:41:05 -0700 | [diff] [blame] | 15 | addr2line -e ../../build/cbfs/fallback/ramstage.debug "$TO" |
Rudolf Marek | 8679e52 | 2011-09-02 23:34:15 +0200 | [diff] [blame] | 16 | else |
| 17 | echo "$line" |
| 18 | fi |
| 19 | |
| 20 | done |