| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # | 2 # |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 # | 6 # |
| 7 | 7 |
| 8 # A generic script used to attach to a running Chromium process and | 8 # A generic script used to attach to a running Chromium process and |
| 9 # debug it. Most users should not use this directly, but one of the | 9 # debug it. Most users should not use this directly, but one of the |
| 10 # wrapper scripts like adb_gdb_content_shell, or adb_gdb_drt | 10 # wrapper scripts like adb_gdb_content_shell, or adb_gdb_drt |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 # Nit: accept Chromium's 'ia32' as a valid target architecture. This | 352 # Nit: accept Chromium's 'ia32' as a valid target architecture. This |
| 353 # script prefers the NDK 'x86' name instead because it uses it to find | 353 # script prefers the NDK 'x86' name instead because it uses it to find |
| 354 # NDK-specific files (host gdb) with it. | 354 # NDK-specific files (host gdb) with it. |
| 355 if [ "$TARGET_ARCH" = "ia32" ]; then | 355 if [ "$TARGET_ARCH" = "ia32" ]; then |
| 356 TARGET_ARCH=x86 | 356 TARGET_ARCH=x86 |
| 357 log "Auto-config: --arch=$TARGET_ARCH (equivalent to ia32)" | 357 log "Auto-config: --arch=$TARGET_ARCH (equivalent to ia32)" |
| 358 fi | 358 fi |
| 359 fi | 359 fi |
| 360 | 360 |
| 361 # Detect the NDK system tag, i.e. the name used to identify the host. | 361 # Detect the NDK system tag, i.e. the name used to identify the host. |
| 362 # out: NDK system tag (e.g. 'linux-x86'). | 362 # out: NDK system tag (e.g. 'linux-x86_64'). |
| 363 get_ndk_host_tag () { | 363 get_ndk_host_tag () { |
| 364 if [ -z "$NDK_HOST_TAG" ]; then | 364 if [ -z "$NDK_HOST_TAG" ]; then |
| 365 case $(uname -s) in | 365 case $(uname -s) in |
| 366 Linux) NDK_HOST_TAG=linux-x86;; | 366 Linux) NDK_HOST_TAG=linux-x86_64;; |
| 367 Darwin) NDK_HOST_TAG=darwin-x86;; | 367 Darwin) NDK_HOST_TAG=darwin-x86;; |
| 368 *) panic "You can't run this script on this system: $uname -a";; | 368 *) panic "You can't run this script on this system: $uname -a";; |
| 369 esac | 369 esac |
| 370 fi | 370 fi |
| 371 echo "$NDK_HOST_TAG" | 371 echo "$NDK_HOST_TAG" |
| 372 } | 372 } |
| 373 | 373 |
| 374 # Convert an NDK architecture name into a GNU configure triplet. | 374 # Convert an NDK architecture name into a GNU configure triplet. |
| 375 # $1: NDK architecture name (e.g. 'arm') | 375 # $1: NDK architecture name (e.g. 'arm') |
| 376 # Out: Android GNU configure triplet (e.g. 'arm-linux-androideabi') | 376 # Out: Android GNU configure triplet (e.g. 'arm-linux-androideabi') |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 echo "### START $COMMANDS" | 886 echo "### START $COMMANDS" |
| 887 cat $COMMANDS | 887 cat $COMMANDS |
| 888 echo "### END $COMMANDS" | 888 echo "### END $COMMANDS" |
| 889 fi | 889 fi |
| 890 | 890 |
| 891 log "Launching gdb client: $GDB $GDBARGS -x $COMMANDS" | 891 log "Launching gdb client: $GDB $GDBARGS -x $COMMANDS" |
| 892 $GDB $GDBARGS -x $COMMANDS && | 892 $GDB $GDBARGS -x $COMMANDS && |
| 893 rm -f "$GDBSERVER_PIDFILE" | 893 rm -f "$GDBSERVER_PIDFILE" |
| 894 | 894 |
| 895 clean_exit $? | 895 clean_exit $? |
| OLD | NEW |