Add native debugging support for no-root mode

BUG=
TEST=


Review URL: https://chromiumcodereview.appspot.com/10448096

git-svn-id: http://src.chromium.org/svn/trunk/src/build@139767 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
haitao.feng@intel.com 2012-05-31 09:47:23 +00:00
Родитель 1579ccd4ab
Коммит 5af193827b
1 изменённых файлов: 6 добавлений и 9 удалений

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

@ -17,12 +17,12 @@ if [[ "$adb" = "" ]] ; then
exit 1
fi
# TODO(jrg): non-rooted path speculative and untested.
rooted_phone=1
rooted_phone=0
root=$(dirname $0)/../..
package_name=org.chromium.content_shell
gdb_server_on_device=/data/data/$package_name/lib/gdbserver
data_dir=/data/data/$package_name
gdb_server_on_device=$data_dir/lib/gdbserver
shared_lib_dir=$root/out/Release/lib.target
# Kill any running gdbserver
@ -50,15 +50,12 @@ if [[ "$no_gdb_server" != "" ]] ; then
exit 3
fi
adb forward tcp:4321 tcp:4321
# TODO(jrg): Consider a closer match to ndk-gdb which uses subtly
# different semantics for both port forwarding and launching
# gdbserver.
if [[ $rooted_phone -eq 1 ]] ; then
adb shell $gdb_server_on_device :4321 --attach $pid &
adb forward tcp:4321 tcp:4321
else
adb shell run-as $package_name $gdb_server_on_device :4321 --attach $pid &
adb shell run-as $package_name lib/gdbserver +debug-socket --attach $pid &
adb forward tcp:4321 localfilesystem:$data_dir/debug-socket
fi
sleep 2