天天看點

android gdb 遠端調試工具,gdb輸入/輸出錯誤遠端調試到Android

我試圖調試一個調用本地代碼來執行一些GL渲染的android應用程式。本機代碼是我試圖移植的現有代碼(并且我不太清楚)。我已經有了正确編譯,連結和正确安裝的代碼,并且我有一些原生函數調用了從我的Java代碼正确調用的代碼。我收到了一個段錯誤,我試圖追蹤,并且遇到了一些問題,讓gdb在程式中設定斷點。這是與Cygwin的Windows XP - 我應該提到我還在學習gdb。gdb輸入/輸出錯誤遠端調試到Android

在模拟器中啟動應用程式。

在指令提示符:

> adb forward tcp:1234 tcp:1234

> adb shell

# gdbserver localhost:1234 --attach 2120

gdbserver localhost:1234 --attach 2120

Attached; pid = 2120

Listening on port 1234

在cygwin外殼:

arm-eabi-4.2.1/bin/arm-eabi-gdb.exe out/apps/app-android/libDM.so

GNU gdb 6.6

Copyright (C) 2006 Free Software Foundation, Inc.

GDB is free software, covered by the GNU General Public License, and you are

welcome to change it and/or distribute copies of it under certain conditions.

Type "show copying" to see the conditions.

There is absolutely no warranty for GDB. Type "show warranty" for details.

This GDB was configured as "--host=i686-pc-cygwin --target=arm-elf-linux"...

(gdb) target remote localhost:1234

Remote debugging using localhost:1234

warning: shared library handler failed to enable breakpoint

0xafe0da04 in AppRefCounted::unref() at ../../stlport/stl/_iosfwd.h:39

39 class basic_ostream;

Current language: auto; currently c++

(gdb) b Java_com_app_AppRenderer_onCreate

Breakpoint 1 at 0xafff1b1a: file apps/app-android/../../../app-Android/jni/DMJNI/DMInterface.cpp, line 75.

(gdb) c

Continuing.

Warning:

Cannot insert breakpoint 1.

Error accessing memory address 0xafff1b1a: Input/Output error.

是以它看起來像斷點被設定好了,并且這些符号都OK,但也許位址是當它試圖插入斷點時錯誤。我已經嘗試過上面引用的網頁中的幾個不同指令的變體,但到目前為止,沒有運氣。

任何想法發生了什麼?

感謝