Created
December 11, 2012 08:00
-
-
Save myamamic/4256684 to your computer and use it in GitHub Desktop.
[Android][Tips] gdbでデバッグ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gdbでデバッグ | |
# 1.セットアップ | |
cd mydroid | |
source build/envsetup.sh | |
chooseproduct <product> // or lunch XX | |
setpaths | |
# 2.端末上でデバッグするプロセスを起動 | |
# 例として、ブラウザ(com.android.browser)を起動する | |
# 3.gdb起動 | |
cd mydroid | |
gdbclient app_process :5039 com.android.browser // パッケージ名ではなく、app_10などでもよい | |
# ->アタッチが完了し、ブラウザがbreak状態になる | |
# ここでbreakpointを設定したり、いろいろできる | |
# SIGSEGVが発生したらbreakするには:gdb上でSIGSEGVのhandleを変更 | |
(gdb) handle SIGSEGV nopass | |
# ->SIGSEGV発生時にブラウザプロセスにシグナルをパスしなくなる | |
# 5.SIGSEGVが発生したらいろいろする | |
(gdb) info thread | |
(gdb) bt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment