1 #!/usr/bin/bash
2 #
3 # We need to run ctfconvert on all the .o files in qemu. However, some of these
4 # .o files contain some snippets that are going to cause ctfconvert to fail. If
5 # ctfconvert is run with the -i option, it will delete the .o file. This is bad.
6 # Instead we end up using a temporary file and move over it.
7 #
8 # This file gets invoked from inside the x86-64_softmmu directory, hence the
9 # extra .. in the path below. That's kind of ugly, and I almost apologize.
10 #
11
12 sh_arg0=$(basename $0)
13 ctf_bin=$(pwd)/../../../illumos/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/ctfconvert
14
15 function fail
16 {
17 local msg="$*"
18 [[ -z "$msg" ]] && msg="failed"
19 echo "$sh_arg0: $msg" >&2
20 exit 1
21 }
22
23
24 [[ $# -eq 1 ]] || fail "missing arguments"
25
26 echo "Converting $1"
27 $ctf_bin -L VERSION -o $1.ctf $1
28 [[ $? -ne 0 ]] && exit 1
29 mv $1.ctf $1
30 exit 0
|
1 #!/usr/bin/bash
2 #
3 # We need to run ctfconvert on all the .o files in qemu. However, some of these
4 # .o files contain some snippets that are going to cause ctfconvert to fail. If
5 # ctfconvert is run with the -i option, it will delete the .o file. This is bad.
6 # Instead we end up using a temporary file and move over it.
7 #
8
9 sh_arg0=$(basename $0)
10
11 function fail
12 {
13 local msg="$*"
14 [[ -z "$msg" ]] && msg="failed"
15 echo "$sh_arg0: $msg" >&2
16 exit 1
17 }
18
19 [[ $# -eq 1 ]] || fail "missing arguments"
20
21 # CTFCONVERT may contain a wildcard, so expand it out:
22 ctfconvert=$(echo ${CTFCONVERT})
23 [[ -x ${ctfconvert} ]] || fail "could not find ctfconvert at $CTFCONVERT"
24
25 echo "Converting $1"
26 $ctfconvert -L VERSION -o $1.ctf $1
27 [[ $? -ne 0 ]] && exit 1
28 mv $1.ctf $1
29 exit 0
|