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

Issue 11187027: Android: Add new debugging scripts (adb_gdb_xxx) (Closed)

Created:
8 years, 2 months ago by digit1
Modified:
8 years, 2 months ago
CC:
chromium-reviews, peter+watch_chromium.org, bulach+watch_chromium.org, yfriedman+watch_chromium.org, ilevy+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Android: Add new debugging scripts (adb_gdb_xxx) This patch adds several new scripts to help debug Chromium programs on Android devices. The old "gdb_apk" and "gdb_content_shell" are now *deprecated* and will be removed shortly. The new scripts are significantly more sophisticated than the previous ones: - They pull the system libraries from the device into a temporary directory. This allows you to have much more symbol information in back traces. The scripts will not re-download the libraries if you use the same device again. However, they will automatically detect they're connected to a new device a download new versions of the system libraries. You can control this behaviour with several options (--pull-libs, --no-pull-libs and --pull-libs-dir) - The --verbose option can be used to dump useful information about what's going on in case of problems. - The --script=<file> option can be used to pass GDB initialization commands that will be run after the program has been properly attached (handy to set breakpoints, signal handlers and printers). - Works for both ARM and x86 devices. Should work automatically for MIPS ones (provided a Chromium build exists for this architecture). - Works properly on all production devices. I.e. you don't need to run ADB as root. - Supports attaching to renderer processes with the --sandboxed and --sandboxed=<num> option. Special note: starting from JellyBean (4.1), you *need* to run ADB as root to be able to attach to sandboxed renderer processes. This is a platform limitation. - Automatically detects the most recent build directory. This means there is no need to set BUILDTYPE in your environment, and both Make-based and ninja-based builds are supported (they don't place target libraries at the same location). - Generally speaking, much better handling of edge cases, and proper cleanup when the script terminates (either normally or through exceptions like Ctrl-C). For complete details, use the --help option of each script. By default, each script tries to attach to a running instance of the program, but you can use the --start option to start it automatically. Note that 'adb_gdb' script is generic and can be used to debug any Chromium Android application, as long as you know its package name and activity name. 'adb_gdb_content_shell' et al at just convenience scripts around 'adb_gdb' that hard-code these values for you. Its trivial to write other wrapper scripts for other packages if you wish so. BUG= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=162704

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+945 lines, -1 line) Patch
A build/android/adb_gdb View 1 1 chunk +895 lines, -0 lines 0 comments Download
A build/android/adb_gdb_chromium_test_shell View 1 chunk +16 lines, -0 lines 0 comments Download
A build/android/adb_gdb_content_shell View 1 chunk +16 lines, -0 lines 0 comments Download
A build/android/adb_gdb_drt View 1 chunk +16 lines, -0 lines 0 comments Download
M build/android/gdb_content_shell View 1 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
digit1
For the record, this is just upstreaming the internal scripts we're using for Chrome on ...
8 years, 2 months ago (2012-10-17 13:23:20 UTC) #1
bulach
lgtm, thanks digit! just a few nits I didn't see downstream https://chromiumcodereview.appspot.com/11187027/diff/1/build/android/adb_gdb File build/android/adb_gdb (right): ...
8 years, 2 months ago (2012-10-17 14:20:04 UTC) #2
Yaron
lgtm
8 years, 2 months ago (2012-10-17 17:44:22 UTC) #3
digit1
https://chromiumcodereview.appspot.com/11187027/diff/1/build/android/adb_gdb File build/android/adb_gdb (right): https://chromiumcodereview.appspot.com/11187027/diff/1/build/android/adb_gdb#newcode25 build/android/adb_gdb:25: clean_exit () { On 2012/10/17 14:20:04, bulach wrote: > ...
8 years, 2 months ago (2012-10-18 12:33:26 UTC) #4
digit1
https://chromiumcodereview.appspot.com/11187027/diff/1/build/android/gdb_content_shell File build/android/gdb_content_shell (right): https://chromiumcodereview.appspot.com/11187027/diff/1/build/android/gdb_content_shell#newcode10 build/android/gdb_content_shell:10: echo "WARNING: This script is deprecated, consider using adb_gdb_content_shell ...
8 years, 2 months ago (2012-10-18 13:02:57 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/digit@chromium.org/11187027/6001
8 years, 2 months ago (2012-10-18 13:03:16 UTC) #6
commit-bot: I haz the power
8 years, 2 months ago (2012-10-18 14:53:31 UTC) #7
Change committed as 162704

Powered by Google App Engine
This is Rietveld 408576698