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

Unified Diff: build/android/adb_gdb

Issue 855943002: Fixed running gdb on rooted device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/adb_gdb
diff --git a/build/android/adb_gdb b/build/android/adb_gdb
index ec0bb7e59d01558c6998045541bc5eeb6d5272b2..150eb5eba4adee17da7ee376ef9c5b197ab2c853 100755
--- a/build/android/adb_gdb
+++ b/build/android/adb_gdb
@@ -841,7 +841,7 @@ fi
if [ "$SU_PREFIX" ]; then
# Need to check that this works properly.
SU_PREFIX_TEST_LOG=$TMPDIR/su-prefix.log
- adb_shell $SU_PREFIX echo "foo" > $SU_PREFIX_TEST_LOG 2>&1
+ adb_shell $SU_PREFIX \"echo "foo"\" > $SU_PREFIX_TEST_LOG 2>&1
if [ $? != 0 -o "$(cat $SU_PREFIX_TEST_LOG)" != "foo" ]; then
echo "ERROR: Cannot use '$SU_PREFIX' as a valid su prefix:"
echo "$ adb shell $SU_PREFIX echo foo"
@@ -867,7 +867,7 @@ log "Command prefix: '$COMMAND_PREFIX'"
if [ "$PULL_LIBS" -a -z "$NO_PULL_LIBS" ]; then
echo "Extracting system libraries into: $PULL_LIBS_DIR"
rm -f $PULL_LIBS_DIR/build.prop
- MAPPINGS=$(adb_shell $COMMAND_PREFIX cat /proc/$PID/maps)
+ MAPPINGS=$(adb_shell $COMMAND_PREFIX \"cat /proc/$PID/maps\")
if [ $? != 0 ]; then
echo "ERROR: Could not list process's memory mappings."
if [ "$SU_PREFIX" ]; then
@@ -944,10 +944,10 @@ 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"
-("$ADB" shell $COMMAND_PREFIX $TARGET_GDBSERVER :$TARGET_PORT \
- --attach $PID > $GDBSERVER_LOG 2>&1) &
+log "adb shell $COMMAND_PREFIX \"$TARGET_GDBSERVER :$TARGET_PORT \
+--attach $PID"\"
+("$ADB" shell $COMMAND_PREFIX \"$TARGET_GDBSERVER :$TARGET_PORT \
+ --attach $PID\" > $GDBSERVER_LOG 2>&1) &
GDBSERVER_PID=$!
echo "$GDBSERVER_PID" > $GDBSERVER_PIDFILE
log "background job pid: $GDBSERVER_PID"
« 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