| 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 |
| 11 # | 11 # |
| 12 # Use --help to print full usage instructions. | 12 # Use --help to print full usage instructions. |
| 13 # | 13 # |
| 14 | 14 |
| 15 PROGNAME=$(basename "$0") | 15 PROGNAME=$(basename "$0") |
| 16 PROGDIR=$(dirname "$0") | 16 PROGDIR=$(dirname "$0") |
| 17 | 17 |
| 18 # Force locale to C to allow recognizing output from subprocesses. |
| 19 LC_ALL=C |
| 20 |
| 18 # Location of Chromium-top-level sources. | 21 # Location of Chromium-top-level sources. |
| 19 CHROMIUM_SRC=$(cd "$PROGDIR"/../.. >/dev/null && pwd 2>/dev/null) | 22 CHROMIUM_SRC=$(cd "$PROGDIR"/../.. >/dev/null && pwd 2>/dev/null) |
| 20 | 23 |
| 21 # Location of Chromium out/ directory. | 24 # Location of Chromium out/ directory. |
| 22 if [ -z "$CHROMIUM_OUT_DIR" ]; then | 25 if [ -z "$CHROMIUM_OUT_DIR" ]; then |
| 23 CHROMIUM_OUT_DIR=out | 26 CHROMIUM_OUT_DIR=out |
| 24 fi | 27 fi |
| 25 | 28 |
| 26 TMPDIR= | 29 TMPDIR= |
| 27 GDBSERVER_PIDFILE= | 30 GDBSERVER_PIDFILE= |
| (...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 | 1050 |
| 1048 if [ "$VERBOSE" -gt 0 ]; then | 1051 if [ "$VERBOSE" -gt 0 ]; then |
| 1049 echo "### START $COMMANDS" | 1052 echo "### START $COMMANDS" |
| 1050 cat $COMMANDS | 1053 cat $COMMANDS |
| 1051 echo "### END $COMMANDS" | 1054 echo "### END $COMMANDS" |
| 1052 fi | 1055 fi |
| 1053 | 1056 |
| 1054 log "Launching gdb client: $GDB $GDB_ARGS -x $COMMANDS" | 1057 log "Launching gdb client: $GDB $GDB_ARGS -x $COMMANDS" |
| 1055 $GDB $GDB_ARGS -x $COMMANDS && | 1058 $GDB $GDB_ARGS -x $COMMANDS && |
| 1056 rm -f "$GDBSERVER_PIDFILE" | 1059 rm -f "$GDBSERVER_PIDFILE" |
| OLD | NEW |