| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 set -o nounset | 6 set -o nounset |
| 7 set -o errexit | 7 set -o errexit |
| 8 | 8 |
| 9 #@ Various commands to emulate mips32 code using qemu | 9 #@ Various commands to emulate mips32 code using qemu |
| 10 #@ | 10 #@ |
| 11 #@ Note: this script is not meant to be run as | 11 #@ Note: this script is not meant to be run as |
| 12 #@ tools/llvm/qemu_tool.sh | 12 #@ tools/llvm/qemu_tool.sh |
| 13 #@ but rather as: | 13 #@ but rather as: |
| 14 #@ toolchain/linux_x86/mips_trusted/qemu-mips32 | 14 #@ toolchain/linux_x86/mips_trusted/qemu-mips32 |
| 15 | 15 |
| 16 # From a qemu build based on qemu-0.12.5.tar.gz | |
| 17 readonly SDK_ROOT=$(dirname $0) | 16 readonly SDK_ROOT=$(dirname $0) |
| 18 readonly QEMU=${SDK_ROOT}/qemu-mips32 | 17 readonly QEMU=${SDK_ROOT}/qemu-mips32 |
| 19 readonly QEMU_JAIL=${SDK_ROOT}/sysroot | 18 readonly QEMU_JAIL=${SDK_ROOT}/sysroot |
| 20 # NOTE: some useful debugging options for qemu: | 19 # NOTE: some useful debugging options for qemu: |
| 21 # env vars: | 20 # env vars: |
| 22 # QEMU_STRACE=1 | 21 # QEMU_STRACE=1 |
| 23 # args: | 22 # args: |
| 24 # -strace | 23 # -strace |
| 25 # -d out_asm,in_asm,op,int,exec,cpu | 24 # -d out_asm,in_asm,op,int,exec,cpu |
| 26 # c.f. cpu_log_items in qemu-XXX/exec.c | 25 # c.f. cpu_log_items in qemu-XXX/exec.c |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 Usage | 105 Usage |
| 107 exit -1 | 106 exit -1 |
| 108 elif [[ "$(type -t $1)" != "function" ]]; then | 107 elif [[ "$(type -t $1)" != "function" ]]; then |
| 109 echo "ERROR: unknown function '$1'." >&2 | 108 echo "ERROR: unknown function '$1'." >&2 |
| 110 echo "For help, try:" | 109 echo "For help, try:" |
| 111 echo " $0 help" | 110 echo " $0 help" |
| 112 exit 1 | 111 exit 1 |
| 113 else | 112 else |
| 114 "$@" | 113 "$@" |
| 115 fi | 114 fi |
| OLD | NEW |