diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/decodecode | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/decodecode b/scripts/decodecode index 4f8248d5a11f..d8824f37acce 100755 --- a/scripts/decodecode +++ b/scripts/decodecode | |||
@@ -89,10 +89,16 @@ echo $code >> $T.s | |||
89 | disas $T | 89 | disas $T |
90 | cat $T.dis >> $T.aa | 90 | cat $T.dis >> $T.aa |
91 | 91 | ||
92 | # (lines of whole $T.oo) - (lines of $T.aa, i.e. "Code starting") + 3, | ||
93 | # i.e. the title + the "===..=" line (sed is counting from 1, 0 address is | ||
94 | # special) | ||
95 | faultlinenum=$(( $(wc -l $T.oo | cut -d" " -f1) - \ | ||
96 | $(wc -l $T.aa | cut -d" " -f1) + 3)) | ||
97 | |||
92 | faultline=`cat $T.dis | head -1 | cut -d":" -f2-` | 98 | faultline=`cat $T.dis | head -1 | cut -d":" -f2-` |
93 | faultline=`echo "$faultline" | sed -e 's/\[/\\\[/g; s/\]/\\\]/g'` | 99 | faultline=`echo "$faultline" | sed -e 's/\[/\\\[/g; s/\]/\\\]/g'` |
94 | 100 | ||
95 | cat $T.oo | sed -e "s/\($faultline\)/\*\1 <-- trapping instruction/g" | 101 | cat $T.oo | sed -e "${faultlinenum}s/^\(.*:\)\(.*\)/\1\*\2\t\t<-- trapping instruction/" |
96 | echo | 102 | echo |
97 | cat $T.aa | 103 | cat $T.aa |
98 | cleanup | 104 | cleanup |