| 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 | 10 # wrapper scripts like adb_gdb_content_shell |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 fi | 540 fi |
| 541 ANDROID_TOOLCHAIN=$TOOLCHAIN | 541 ANDROID_TOOLCHAIN=$TOOLCHAIN |
| 542 fi | 542 fi |
| 543 | 543 |
| 544 # Cosmetic: Remove trailing directory separator. | 544 # Cosmetic: Remove trailing directory separator. |
| 545 ANDROID_TOOLCHAIN=${ANDROID_TOOLCHAIN%/} | 545 ANDROID_TOOLCHAIN=${ANDROID_TOOLCHAIN%/} |
| 546 | 546 |
| 547 # Find host GDB client binary | 547 # Find host GDB client binary |
| 548 if [ -z "$GDB" ]; then | 548 if [ -z "$GDB" ]; then |
| 549 GDB=$(which $ANDROID_TOOLCHAIN/*-$GDBEXEPOSTFIX 2>/dev/null | head -1) | 549 GDB=$(which $ANDROID_TOOLCHAIN/*-$GDBEXEPOSTFIX 2>/dev/null | head -1) |
| 550 if [ -z "$GDBSERVER" ]; then | 550 if [ -z "$GDB" ]; then |
| 551 panic "Can't find Android gdb client in your path, check your \ | 551 panic "Can't find Android gdb client in your path, check your \ |
| 552 --toolchain or --gdb path." | 552 --toolchain or --gdb path." |
| 553 fi | 553 fi |
| 554 log "Host gdb client: $GDB" | 554 log "Host gdb client: $GDB" |
| 555 fi | 555 fi |
| 556 | 556 |
| 557 # Find gdbserver binary, we will later push it to /data/local/tmp | 557 # Find gdbserver binary, we will later push it to /data/local/tmp |
| 558 # This ensures that both gdbserver and $GDB talk the same binary protocol, | 558 # This ensures that both gdbserver and $GDB talk the same binary protocol, |
| 559 # otherwise weird problems will appear. | 559 # otherwise weird problems will appear. |
| 560 # | 560 # |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 | 959 |
| 960 if [ "$VERBOSE" -gt 0 ]; then | 960 if [ "$VERBOSE" -gt 0 ]; then |
| 961 echo "### START $COMMANDS" | 961 echo "### START $COMMANDS" |
| 962 cat $COMMANDS | 962 cat $COMMANDS |
| 963 echo "### END $COMMANDS" | 963 echo "### END $COMMANDS" |
| 964 fi | 964 fi |
| 965 | 965 |
| 966 log "Launching gdb client: $GDB $GDBARGS -x $COMMANDS" | 966 log "Launching gdb client: $GDB $GDBARGS -x $COMMANDS" |
| 967 $GDB $GDBARGS -x $COMMANDS && | 967 $GDB $GDBARGS -x $COMMANDS && |
| 968 rm -f "$GDBSERVER_PIDFILE" | 968 rm -f "$GDBSERVER_PIDFILE" |
| OLD | NEW |