1
我有一個原本應該在Android設備上運行的C++應用程序。應用程序在啓動時崩潰,很可能在從鏈接庫調用函數時崩潰。我正在嘗試使用gdb進行調試,但我無法成功。在Android上使用GDB調試本機應用程序
我開始在Android設備上gdbserver的一些隨機選取的端口(2000)上:
[email protected]: gdbserver :2000 my_app
Process my_app created; pid = 3420
Listening on port 2000
現在我要附加到這個過程,得到了GDB我的主機系統(Windows 7)在Android-NDK中。
C:\> gdb
(gdb) attach 3420
Can't attach to process.
(gdb) target remote :2000
:2000: The system tried to join a drive to a directory on a joined drive.
什麼問題?
編輯: 此前運行GDB我使用亞行轉發的端口2000:
adb forward tcp:2000 tcp:2000
這至少幫助我建立一些溝通,但:
(gdb) target remote :2000
Remote debugging using :2000
warning: Architecture rejected target-supplied description
Remote 'g' packet reply is too long: 00000000000000000000000000000...
在設備方:
Listening on port 2000
Remote debugging from host 127.0.0.1
readchar: Got EOF
Remote side has terminated connection. GDBserver will reopen the connection.
Listening on port 2000