adb_gdb allows ctrl-c for interrupting the debuggee

Previously adb_gdb started the gdbserver in a backgrounded bash
subprocess. As a result, it was receiving SIGINTs when you used
ctrl-c to to interrupt the debuggee in gdb. Now it's started
backgrounded, but not in a subshell, which means it will be set
to ignore SIGINT. (This behavior is under the "SIGNALS" heading
in the bash man page.) It will still get killed by the EXIT
trap, so it doesn't leak.

BUG=

Review URL: https://codereview.chromium.org/1473303003

Cr-Original-Commit-Position: refs/heads/master@{#361713}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 458e26c62669faec41db97e60ae050dc60775e82
This commit is contained in:
watk 2015-11-25 11:00:14 -08:00 коммит произвёл Commit bot
Родитель 4e948ef7df
Коммит b300d134d8
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -983,9 +983,9 @@ host:localhost:$HOST_PORT to device:localhost:$TARGET_PORT!"
log "Starting gdbserver in the background:"
GDBSERVER_LOG=$TMPDIR/gdbserver-$TMP_ID.log
log "adb shell $COMMAND_PREFIX $TARGET_GDBSERVER :$TARGET_PORT \
--attach $PID $COMMAND_SUFFIX"
("$ADB" shell $COMMAND_PREFIX $TARGET_GDBSERVER :$TARGET_PORT \
--attach $PID $COMMAND_SUFFIX > $GDBSERVER_LOG 2>&1) &
--attach $PID $COMMAND_SUFFIX"
"$ADB" shell $COMMAND_PREFIX $TARGET_GDBSERVER :$TARGET_PORT \
--attach $PID $COMMAND_SUFFIX > $GDBSERVER_LOG 2>&1 &
GDBSERVER_PID=$!
echo "$GDBSERVER_PID" > $GDBSERVER_PIDFILE
log "background job pid: $GDBSERVER_PID"