| 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 # Location of Chromium-top-level sources. | 18 # Location of Chromium-top-level sources. |
| 19 CHROMIUM_SRC=$(cd "$PROGDIR"/../.. && pwd 2>/dev/null) | 19 CHROMIUM_SRC=$(cd "$PROGDIR"/../.. >/dev/null && pwd 2>/dev/null) |
| 20 | 20 |
| 21 # Location of Chromium out/ directory. | 21 # Location of Chromium out/ directory. |
| 22 if [ -z "$CHROMIUM_OUT_DIR" ]; then | 22 if [ -z "$CHROMIUM_OUT_DIR" ]; then |
| 23 CHROMIUM_OUT_DIR=out | 23 CHROMIUM_OUT_DIR=out |
| 24 fi | 24 fi |
| 25 | 25 |
| 26 TMPDIR= | 26 TMPDIR= |
| 27 GDBSERVER_PIDFILE= | 27 GDBSERVER_PIDFILE= |
| 28 TARGET_GDBSERVER= | 28 TARGET_GDBSERVER= |
| 29 | 29 |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 if [ "$GDBINIT" ]; then | 984 if [ "$GDBINIT" ]; then |
| 985 cat "$GDBINIT" >> $COMMANDS | 985 cat "$GDBINIT" >> $COMMANDS |
| 986 fi | 986 fi |
| 987 | 987 |
| 988 if [ "$VERBOSE" -gt 0 ]; then | 988 if [ "$VERBOSE" -gt 0 ]; then |
| 989 echo "### START $COMMANDS" | 989 echo "### START $COMMANDS" |
| 990 cat $COMMANDS | 990 cat $COMMANDS |
| 991 echo "### END $COMMANDS" | 991 echo "### END $COMMANDS" |
| 992 fi | 992 fi |
| 993 | 993 |
| 994 log "Launching gdb client: $GDB $GDBARGS -x $COMMANDS" | 994 log "Launching gdb client: $GDB $GDB_ARGS -x $COMMANDS" |
| 995 $GDB $GDBARGS -x $COMMANDS && | 995 $GDB $GDB_ARGS -x $COMMANDS && |
| 996 rm -f "$GDBSERVER_PIDFILE" | 996 rm -f "$GDBSERVER_PIDFILE" |
| OLD | NEW |