summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/decodecode8
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
89disas $T 89disas $T
90cat $T.dis >> $T.aa 90cat $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)
95faultlinenum=$(( $(wc -l $T.oo | cut -d" " -f1) - \
96 $(wc -l $T.aa | cut -d" " -f1) + 3))
97
92faultline=`cat $T.dis | head -1 | cut -d":" -f2-` 98faultline=`cat $T.dis | head -1 | cut -d":" -f2-`
93faultline=`echo "$faultline" | sed -e 's/\[/\\\[/g; s/\]/\\\]/g'` 99faultline=`echo "$faultline" | sed -e 's/\[/\\\[/g; s/\]/\\\]/g'`
94 100
95cat $T.oo | sed -e "s/\($faultline\)/\*\1 <-- trapping instruction/g" 101cat $T.oo | sed -e "${faultlinenum}s/^\(.*:\)\(.*\)/\1\*\2\t\t<-- trapping instruction/"
96echo 102echo
97cat $T.aa 103cat $T.aa
98cleanup 104cleanup