OLD | NEW |
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 # Attach gdb to a running android application. Similar to ndk-gdb. | 7 # Attach gdb to a running android application. Similar to ndk-gdb. |
8 # Run with --annotate=3 if running under emacs (M-x gdb). | 8 # Run with --annotate=3 if running under emacs (M-x gdb). |
9 # | 9 # |
10 # By default it is used to debug content shell, if it is used to | 10 # By default it is used to debug content shell, if it is used to |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 eval echo "Unexpected command line argument: \${${OPTIND}}" | 90 eval echo "Unexpected command line argument: \${${OPTIND}}" |
91 usage | 91 usage |
92 exit 1 | 92 exit 1 |
93 fi | 93 fi |
94 } | 94 } |
95 | 95 |
96 rooted_phone=0 | 96 rooted_phone=0 |
97 | 97 |
98 root=$(dirname $0)/../.. | 98 root=$(dirname $0)/../.. |
99 package_name=org.chromium.content_shell | 99 package_name=org.chromium.content_shell |
100 shared_lib_dir=$root/out/${BUILDTYPE:-Release}/lib.target | 100 shared_lib_dir=$root/out/${BUILDTYPE:-Debug}/lib.target |
101 gdb_args='' | 101 gdb_args='' |
102 | 102 |
103 #process options | 103 #process options |
104 process_options "$@" | 104 process_options "$@" |
105 echo "Debug package $package_name" | 105 echo "Debug package $package_name" |
106 echo "Assume native shared library is under $shared_lib_dir" | 106 echo "Assume native shared library is under $shared_lib_dir" |
107 | 107 |
108 data_dir=/data/data/$package_name | 108 data_dir=/data/data/$package_name |
109 gdb_server_on_device=$data_dir/lib/gdbserver | 109 gdb_server_on_device=$data_dir/lib/gdbserver |
110 | 110 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 if [[ ! -f ${gdb} ]] ; then | 162 if [[ ! -f ${gdb} ]] ; then |
163 echo "Wow no gdb in env var ANDROID_TOOLCHAIN which is $ANDROID_TOOLCHAIN" | 163 echo "Wow no gdb in env var ANDROID_TOOLCHAIN which is $ANDROID_TOOLCHAIN" |
164 exit 4 | 164 exit 4 |
165 else | 165 else |
166 echo Using $gdb | 166 echo Using $gdb |
167 fi | 167 fi |
168 | 168 |
169 # ${gdb} -x $cmdfile $* $app_process | 169 # ${gdb} -x $cmdfile $* $app_process |
170 ${gdb} -x $cmdfile $gdb_args | 170 ${gdb} -x $cmdfile $gdb_args |
171 rm $cmdfile | 171 rm $cmdfile |
OLD | NEW |