aboutsummaryrefslogtreecommitdiffstats
path: root/java/debug.sh
diff options
context:
space:
mode:
Diffstat (limited to 'java/debug.sh')
-rwxr-xr-xjava/debug.sh17
1 files changed, 11 insertions, 6 deletions
diff --git a/java/debug.sh b/java/debug.sh
index 339b3604810..0458003fe72 100755
--- a/java/debug.sh
+++ b/java/debug.sh
@@ -19,6 +19,7 @@
19## along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. 19## along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
20 20
21set -m 21set -m
22set -x
22oldpwd=`pwd` 23oldpwd=`pwd`
23cd `dirname $0` 24cd `dirname $0`
24 25
@@ -310,22 +311,26 @@ rm -f /tmp/file-descriptor-stamp
310 311
311if [ -z "$gdbserver" ]; then 312if [ -z "$gdbserver" ]; then
312 if [ "$is_root" = "yes" ]; then 313 if [ "$is_root" = "yes" ]; then
313 adb -s $device shell $gdbserver_bin --once \ 314 adb -s $device shell $gdbserver_bin --multi \
314 "+/data/local/tmp/debug.$package.socket" --attach $pid >&5 & 315 "+/data/local/tmp/debug.$package.socket" --attach $pid >&5 &
315 gdb_socket="localfilesystem:/data/local/tmp/debug.$package.socket" 316 gdb_socket="localfilesystem:/data/local/tmp/debug.$package.socket"
316 else 317 else
317 adb -s $device shell run-as $package $gdbserver_bin --once \ 318 adb -s $device shell run-as $package $gdbserver_bin --multi \
318 "+debug.$package.socket" --attach $pid >&5 & 319 "+debug.$package.socket" --attach $pid >&5 &
319 gdb_socket="localfilesystem:$app_data_dir/debug.$package.socket" 320 gdb_socket="localfilesystem:$app_data_dir/debug.$package.socket"
320 fi 321 fi
321else 322else
322 # Normally the program cannot access $gdbserver_bin when it is 323 # Normally the program cannot access $gdbserver_bin when it is
323 # placed in /data/local/tmp. 324 # placed in /data/local/tmp.
324 adb -s $device shell run-as $package $gdbserver_cmd --once \ 325 adb -s $device shell run-as $package $gdbserver_cmd --multi \
325 "0.0.0.0:7654" --attach $pid >&5 & 326 "+debug.$package.socket" --attach $pid >&5 &
326 gdb_socket="tcp:7654" 327 gdb_socket="localfilesystem:$app_data_dir/debug.$package.socket"
327fi 328fi
328 329
330# In order to allow adb to forward to the gdbserver socket, make the
331# app data directory a+x.
332adb -s $device shell run-as $package chmod a+x $app_data_dir
333
329# Wait until gdbserver successfully runs. 334# Wait until gdbserver successfully runs.
330line= 335line=
331while read -u 5 line; do 336while read -u 5 line; do