Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(735)

Side by Side Diff: build/android/adb_gdb

Issue 1473303003: adb_gdb allows ctrl-c for interrupting the debuggee (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 # Start gdbserver in the background 976 # Start gdbserver in the background
977 # Note that using run-as requires the package to be debuggable. 977 # Note that using run-as requires the package to be debuggable.
978 # 978 #
979 # If not, this will fail horribly. The alternative is to run the 979 # If not, this will fail horribly. The alternative is to run the
980 # program as root, which requires of course root privileges. 980 # program as root, which requires of course root privileges.
981 # Maybe we should add a --root option to enable this? 981 # Maybe we should add a --root option to enable this?
982 # 982 #
983 log "Starting gdbserver in the background:" 983 log "Starting gdbserver in the background:"
984 GDBSERVER_LOG=$TMPDIR/gdbserver-$TMP_ID.log 984 GDBSERVER_LOG=$TMPDIR/gdbserver-$TMP_ID.log
985 log "adb shell $COMMAND_PREFIX $TARGET_GDBSERVER :$TARGET_PORT \ 985 log "adb shell $COMMAND_PREFIX $TARGET_GDBSERVER :$TARGET_PORT \
986 --attach $PID $COMMAND_SUFFIX" 986 --attach $PID $COMMAND_SUFFIX"
987 ("$ADB" shell $COMMAND_PREFIX $TARGET_GDBSERVER :$TARGET_PORT \ 987 "$ADB" shell $COMMAND_PREFIX $TARGET_GDBSERVER :$TARGET_PORT \
988 --attach $PID $COMMAND_SUFFIX > $GDBSERVER_LOG 2>&1) & 988 --attach $PID $COMMAND_SUFFIX > $GDBSERVER_LOG 2>&1 &
989 GDBSERVER_PID=$! 989 GDBSERVER_PID=$!
990 echo "$GDBSERVER_PID" > $GDBSERVER_PIDFILE 990 echo "$GDBSERVER_PID" > $GDBSERVER_PIDFILE
991 log "background job pid: $GDBSERVER_PID" 991 log "background job pid: $GDBSERVER_PID"
992 992
993 # Check that it is still running after a few seconds. If not, this means we 993 # Check that it is still running after a few seconds. If not, this means we
994 # could not properly attach to it 994 # could not properly attach to it
995 sleep 2 995 sleep 2
996 log "Job control: $(jobs -l)" 996 log "Job control: $(jobs -l)"
997 STATE=$(jobs -l | awk '$2 == "'$GDBSERVER_PID'" { print $3; }') 997 STATE=$(jobs -l | awk '$2 == "'$GDBSERVER_PID'" { print $3; }')
998 if [ "$STATE" != "Running" ]; then 998 if [ "$STATE" != "Running" ]; then
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 1041
1042 if [ "$VERBOSE" -gt 0 ]; then 1042 if [ "$VERBOSE" -gt 0 ]; then
1043 echo "### START $COMMANDS" 1043 echo "### START $COMMANDS"
1044 cat $COMMANDS 1044 cat $COMMANDS
1045 echo "### END $COMMANDS" 1045 echo "### END $COMMANDS"
1046 fi 1046 fi
1047 1047
1048 log "Launching gdb client: $GDB $GDB_ARGS -x $COMMANDS" 1048 log "Launching gdb client: $GDB $GDB_ARGS -x $COMMANDS"
1049 $GDB $GDB_ARGS -x $COMMANDS && 1049 $GDB $GDB_ARGS -x $COMMANDS &&
1050 rm -f "$GDBSERVER_PIDFILE" 1050 rm -f "$GDBSERVER_PIDFILE"
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698