日本亚洲欧美日韩中文字幕_精品欧美一区二区三区久久久_久久av高潮av无码av_成在人线av无码免费_亚洲中文字幕无码久久精品1

4008508622

全國統(tǒng)一學(xué)習(xí)專線 8:30-21:00

gdb在Android開發(fā)中的使用相信很多開發(fā)人員都很想掌握,今天我們就用gdb在Android Emulator中進行調(diào)試,讓大家學(xué)習(xí)gdb調(diào)試。在Android手機開發(fā)平臺的emulator里,有兩種方式可以做Gdb調(diào)試:直接使用GdbServer或利用Gdb調(diào)試進行調(diào)試。
1、利用Gdb Server進行調(diào)試:
A、從下面的鏈接中下載針對Android的Gdb Server http://www.billrocks.org/android_libs/bin/
B、把下載的Gdb Server安裝到你的emulator 中
1)、 啟動emulator
2)、下載Gdb Server到你的emulator
打開一個終端,運行:
$ adb shell
#cd data
#mkdir bin
在另外一個終端里運行:
$ adb push gdbserver /data/bin
這樣通過Android自己的adb,把gdbserver 下載到emulator 中了。
C、運行g(shù)dbserver :
# /data/bin/gdbserver 10.0.2.2:1234 [args…]
D、回到另一終端,映射端口:
$telnet localhost 5554
telnet到emulator 中,運行下面的命令:
redir add tcp:1234:1234
E、在第三個終端中運行 gdb:
$gdb test
test 是你要調(diào)試的程序,然后在gdb命令行運行:
(gdb) target remote localhost:1234
然后你就可以像以前用gdb那樣進行程序調(diào)試了。
2、直接用本地Gdb進行調(diào)試
A、從下面的鏈接中下載Android調(diào)試包,它是用Android的toolchain編譯好的二進制文件:
http://ortegaalfredo.googlepages.com/android-debug.tbz
B、解壓調(diào)試包,然后把gdb下載到你的emulator 中,當(dāng)然如果你有真的手機,也可以這樣調(diào)試:
$adb push gdb /data/bin
C、利用adb連接到emulator
$adb shell
運行g(shù)db,會出現(xiàn)下面的信息:
# /data/bin/gdb
dlopen failed on 'libthread_db.so.1' - libthread_db.so.1: cannot open shared object file: No such file or directory
GDB will not be able to debug pthreads.
GNU gdb 6.7
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later < http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=arm-none-linux-gnueabi --target=".
(gdb)
D、 然后你就可以像以前用gdb那樣對程序進行調(diào)試了。
 

溫馨提示:為不影響您的學(xué)業(yè),來校區(qū)前請先電話咨詢,方便我校安排相關(guān)的專業(yè)老師為您解答
  • 熱門課程
  • 作者最新文章
  • 在線報名
申請試聽課程

只要一個電話
我們免費為您回電

姓名不能為空
手機號格式錯誤