aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/decodecode17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/decodecode b/scripts/decodecode
index 1e1a8f620c47..235d3938529d 100644
--- a/scripts/decodecode
+++ b/scripts/decodecode
@@ -6,7 +6,19 @@
6# e.g., to decode an i386 oops on an x86_64 system, use: 6# e.g., to decode an i386 oops on an x86_64 system, use:
7# AFLAGS=--32 decodecode < 386.oops 7# AFLAGS=--32 decodecode < 386.oops
8 8
9T=`mktemp` 9cleanup() {
10 rm -f $T $T.s $T.o
11 exit 1
12}
13
14die() {
15 echo "$@"
16 exit 1
17}
18
19trap cleanup EXIT
20
21T=`mktemp` || die "cannot create temp file"
10code= 22code=
11 23
12while read i ; do 24while read i ; do
@@ -20,6 +32,7 @@ esac
20done 32done
21 33
22if [ -z "$code" ]; then 34if [ -z "$code" ]; then
35 rm $T
23 exit 36 exit
24fi 37fi
25 38
@@ -48,4 +61,4 @@ echo -n " .byte 0x" > $T.s
48echo $code >> $T.s 61echo $code >> $T.s
49as $AFLAGS -o $T.o $T.s 62as $AFLAGS -o $T.o $T.s
50objdump -S $T.o 63objdump -S $T.o
51rm $T.o $T.s 64rm $T $T.s $T.o