the problem is I cant' set breakpoint like:
> (gdb) b demo2.cpp:305
> No line 305 in file "jni/demo2.cpp".
but use function name is OK:
> (gdb) b appOnTouch(int, int, int)
> Breakpoint 1 at 0x809f9474: file D:/android/android-ndk-r7/sources/cxx-stl/stlport/stlport/stl/_alloc.h, line 158.
it's the same line demo2.cpp:305 and appOnTouch(). and the gdb
reply direct this breakpoint to wrong sourcefile (stl/_alloc.h)
further I try bt, the function name is right and the sourcefile is
wrong
>(gdb) bt
>#0 0x809f9474 in appOnTouch (action=40960, x=31386632, y=1)
> at D:/android/android-ndk-r7/sources/cxx-stl/stlport/stlport/stl/_alloc.h:158
>#1 0x809f9360 in Java_com_tencent_game_qqrestaurant_DemoGLSurfaceView_nativeOnTouch (action=0, >x=423, y=165)
> at D:/android/android-ndk-r7/sources/cxx-stl/stlport/stlport/stl/_alloc.h:158
and 'list' show the wrong source file and 'next' don't work.
I'm using a nexus one device running Android 2.3, not rooted.
before In ndk r5b it's all OK except some thread issue. the stl I use
is APP_STL := stlport_static
I'm attaching the whole ndk-gdb log here:
---------------------------------------------------------------------------------------------------
F:\restaurant\trunk\Client\Project\Android>D:\DEV\cygwin\bin\bash.exe
--login -c "cd /cygdrive/f/restaurant/trunk/Client/Project/A
ndroid/ && $NDK/ndk-gdb --verbose --exec=gdb_init.txt"
Android NDK installation path: /cygdrive/d/android/android-ndk-r7
Using default adb command: /cygdrive/d/android/android-sdk-windows/
platform-tools/adb
ADB version found: Android Debug Bridge version 1.0.26
Using final ADB command: '/cygdrive/d/android/android-sdk-windows/
platform-tools/adb'
Using auto-detected project path: .
Found package name: com.tencent.game.qqrestaurant
ABIs targetted by application: armeabi
Device API Level: 10
Device CPU ABIs: armeabi-v7a armeabi
Compatible device ABI: armeabi
Found debuggable flag: true
Found device gdbserver: /data/data/com.tencent.game.qqrestaurant/lib/
gdbserver
Using gdb setup init: ./libs/armeabi/gdb.setup
Using toolchain prefix: /cygdrive/d/android/android-ndk-r7/toolchains/
arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-a
ndroideabi-
Using app out directory: ./obj/local/armeabi
Found data directory: '/data/data/com.tencent.game.qqrestaurant'
Found running PID: 22960
Launched gdbserver succesfully.
Setup network redirection
## COMMAND: /cygdrive/d/android/android-sdk-windows/platform-tools/adb
forward tcp:5039 localfilesystem:/data/data/com.tencent.gam
e.qqrestaurant/debug-socket
## COMMAND: /cygdrive/d/android/android-sdk-windows/platform-tools/adb
shell run-as com.tencent.game.qqrestaurant lib/gdbserver +d
ebug-socket --attach 22960
Attached; pid = 22960
Listening on sockaddr socket debug-socket
## COMMAND: /cygdrive/d/android/android-sdk-windows/platform-tools/adb
pull /system/bin/app_process obj/local/armeabi/app_process
398 KB/s (5720 bytes in 0.014s)
Pulled app_process from device/emulator.
## COMMAND: /cygdrive/d/android/android-sdk-windows/platform-tools/adb
pull /system/lib/libc.so obj/local/armeabi/libc.so
1407 KB/s (273880 bytes in 0.190s)
Pulled libc.so from device/emulator.
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=i586-mingw32msvc --target=arm-elf-
linux".
(no debugging symbols found)
Error while mapping shared library sections:
/system/bin/linker: No such file or directory.
Error while mapping shared library sections:
libstdc++.so: No such file or directory.
Error while mapping shared library sections:
libm.so: No such file or directory.
Error while mapping shared library sections:
liblog.so: No such file or directory.
Error while mapping shared library sections:
libcutils.so: No such file or directory.
Error while mapping shared library sections:
libz.so: No such file or directory.
Error while mapping shared library sections:
libutils.so: No such file or directory.
Error while mapping shared library sections:
libbinder.so: No such file or directory.
Error while mapping shared library sections:
libexpat.so: No such file or directory.
Error while mapping shared library sections:
libcrypto.so: No such file or directory.
Error while mapping shared library sections:
libicuuc.so: No such file or directory.
Error while mapping shared library sections:
libicui18n.so: No such file or directory.
Error while mapping shared library sections:
libsqlite.so: No such file or directory.
Error while mapping shared library sections:
libssl.so: No such file or directory.
Error while mapping shared library sections:
libnativehelper.so: No such file or directory.
Error while mapping shared library sections:
libnetutils.so: No such file or directory.
Error while mapping shared library sections:
libEGL.so: No such file or directory.
Error while mapping shared library sections:
libwpa_client.so: No such file or directory.
Error while mapping shared library sections:
libhardware_legacy.so: No such file or directory.
Error while mapping shared library sections:
libpixelflinger.so: No such file or directory.
Error while mapping shared library sections:
libhardware.so: No such file or directory.
Error while mapping shared library sections:
libui.so: No such file or directory.
Error while mapping shared library sections:
libgui.so: No such file or directory.
Error while mapping shared library sections:
libsurfaceflinger_client.so: No such file or directory.
Error while mapping shared library sections:
libcamera_client.so: No such file or directory.
Error while mapping shared library sections:
libemoji.so: No such file or directory.
Error while mapping shared library sections:
libjpeg.so: No such file or directory.
Error while mapping shared library sections:
libskia.so: No such file or directory.
Error while mapping shared library sections:
libGLESv1_CM.so: No such file or directory.
Error while mapping shared library sections:
libskiagl.so: No such file or directory.
Error while mapping shared library sections:
libdvm.so: No such file or directory.
Error while mapping shared library sections:
libGLESv2.so: No such file or directory.
Error while mapping shared library sections:
libETC1.so: No such file or directory.
Error while mapping shared library sections:
libsonivox.so: No such file or directory.
Error while mapping shared library sections:
libmedia.so: No such file or directory.
Error while mapping shared library sections:
libnfc_ndef.so: No such file or directory.
Error while mapping shared library sections:
libbluedroid.so: No such file or directory.
Error while mapping shared library sections:
libdbus.so: No such file or directory.
Error while mapping shared library sections:
libandroid_runtime.so: No such file or directory.
Error while mapping shared library sections:
libvorbisidec.so: No such file or directory.
Error while mapping shared library sections:
libstagefright_amrnb_common.so: No such file or directory.
Error while mapping shared library sections:
libstagefright_enc_common.so: No such file or directory.
Error while mapping shared library sections:
libstagefright_avc_common.so: No such file or directory.
Error while mapping shared library sections:
libstagefright_foundation.so: No such file or directory.
Error while mapping shared library sections:
libstagefright_color_conversion.so: No such file or directory.
Error while mapping shared library sections:
libstagefright.so: No such file or directory.
Error while mapping shared library sections:
libmedia_jni.so: No such file or directory.
Error while mapping shared library sections:
libexif.so: No such file or directory.
Error while mapping shared library sections:
libsoundpool.so: No such file or directory.
Error while mapping shared library sections:
libacc.so: No such file or directory.
Error while mapping shared library sections:
libRS.so: No such file or directory.
Error while mapping shared library sections:
librs_jni.so: No such file or directory.
Error while mapping shared library sections:
libstlport.so: No such file or directory.
Error while mapping shared library sections:
libwebcore.so: No such file or directory.
Error while mapping shared library sections:
libAppleJuice.so: No such file or directory.
Error while mapping shared library sections:
gralloc.qsd8k.so: No such file or directory.
Error while mapping shared library sections:
libGLES_android.so: No such file or directory.
Error while mapping shared library sections:
libgsl.so: No such file or directory.
Error while mapping shared library sections:
libEGL_adreno200.so: No such file or directory.
Error while mapping shared library sections:
libGLESv1_CM_adreno200.so: No such file or directory.
Error while mapping shared library sections:
libGLESv2_adreno200.so: No such file or directory.
Error while mapping shared library sections:
libq3dtools_adreno200.so: No such file or directory.
(no debugging symbols found)
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
warning: shared library handler failed to enable breakpoint
0xafd0c51c in epoll_wait () from F:\restaurant\trunk\Client\Project
\Android/./obj/local/armeabi/libc.so
F:\restaurant\trunk\Client\Project\Android/obj/local/armeabi/gdb.setup:
7: Error in sourced command file:
No line 305 in file "jni/demo2.cpp".
(gdb) b appOnTouch(int, int, int)
Breakpoint 1 at 0x809f9474: file D:/android/android-ndk-r7/sources/cxx-
stl/stlport/stlport/stl/_alloc.h, line 158.
(gdb) c
Continuing.
[New Thread 22960]
[Switching to Thread 22960]
Breakpoint 1, 0x809f9474 in appOnTouch (action=40960, x=31386632, y=1)
at D:/android/android-ndk-r7/sources/cxx-stl/stlport/stlport/stl/
_alloc.h:158
158 { return (__n > (size_t)_MAX_BYTES) ? __stl_new(__n) :
_M_allocate(__n); }
Current language: auto; currently c++
(gdb) bt
#0 0x809f9474 in appOnTouch (action=40960, x=31386632, y=1)
at D:/android/android-ndk-r7/sources/cxx-stl/stlport/stlport/stl/
_alloc.h:158
#1 0x809f9360 in
Java_com_tencent_game_qqrestaurant_DemoGLSurfaceView_nativeOnTouch
(action=0, x=423, y=165)
at D:/android/android-ndk-r7/sources/cxx-stl/stlport/stlport/stl/
_alloc.h:158
#2 0x80017e38 in ?? ()
(gdb) l
153 public:
154 // this one is needed for proper simple_alloc wrapping
155 typedef char value_type;
156 /* __n must be > 0 */
157 static void* _STLP_CALL allocate(size_t& __n)
158 { return (__n > (size_t)_MAX_BYTES) ? __stl_new(__n) :
_M_allocate(__n); }
159 /* __p may not be 0 */
160 static void _STLP_CALL deallocate(void *__p, size_t __n)
161 { if (__n > (size_t)_MAX_BYTES) __stl_delete(__p); else
_M_deallocate(__p, __n); }
162 };
(gdb) n
0x80017e38 in ?? ()
(gdb) b demo2.cpp:305
No line 305 in file "jni/demo2.cpp".
(gdb) list
163
164 # if defined (_STLP_USE_TEMPLATE_EXPORT)
165 _STLP_EXPORT_TEMPLATE_CLASS __debug_alloc<__node_alloc>;
166 # endif
167
168 #endif
169
170 #if defined (_STLP_USE_TEMPLATE_EXPORT)
171 _STLP_EXPORT_TEMPLATE_CLASS __debug_alloc<__new_alloc>;
172 _STLP_EXPORT_TEMPLATE_CLASS __debug_alloc<__malloc_alloc>;
(gdb) n
Cannot find bounds of current function
(gdb)
I fired a bug on
http://code.google.com/p/android/issues/detail?id=22211&q=label%3APriority-Medium&sort=type&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars
hope google will fix this.
> ...
>
> 阅读更多 >>
The post you linked to from Tor had a response from me with a version
of the NDK that doesn't have this problem (unfortunately I don't have
time to upgrade to basing it on r7 yet). Though Tor was on Mac, I've
also made versions for Windows and Linux. The link for the Windows
version is:
http://mingw-and-ndk.googlecode.com/files/android-ndk-r6b-gdb-7.3.50.20110709-windows.7z
Like Google's r7, this can be used from cmd.exe, so long as you add
<INSTALLPATH>\android-ndk-r6b\cmd-exe-tools to your path, either from
within windows or from cmd.exe as:
PATH=<INSTALLPATH>\android-ndk-r6b\cmd-exe-tools:%PATH%
The GDB I've supplied with it is very recent and includes Python
pretty printing support. It's also compiled as large-address-aware (as
I've seen GDB consume more than 2GB -and promptly crash without this
change - when debugging Qt applications). Also, GCC 4.4.3 has been
recompiled with Graphite support and an experimental 4.6.2 build is
also provided. ndk-gdb has been modified to work with MSYS too (it
doesn't work from cmd.exe as porting it to be a batch file would be a
bit painful)
Almost everything has been recompiled from scratch (the only
exceptions are the tools in cmd-exe-tools) and the test suite pass
also (with 4.4.3 anyway).
2011/11/24 mrzerg <mrzer...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>
>
To overcome this i switched the debug info from DWARF ( default) to
stabs by adding -gstabs+ to LOCAL_CPPFLAGS, LOCAL_CFLAGS,
LOCAL_LDLIBS.
Chris
> ...
>
> read more »
When I swittched to NDK-r7 I've the same problem...
it seems that the debug info goes wrong, in specific case, and i was
unable to isolate the problem ( some c++ source trigger the problem in
my case but in sample case it works... ).
To overcome this i switched the debug info from DWARF ( default) to
stabs by adding -gstabs+ to LOCAL_CPPFLAGS, LOCAL_CFLAGS,
LOCAL_LDLIBS.
Anecdotal, but my version of the NDK uses binutils 2.20.1 apparently
without this issue. I suspect, if anything, that the GDB in the
official NDK is getting a bit too old and thus out of sync with the
rest of the toolchain (granted, this is not the most technical
analysis).
It should be possible (and easy) to try mixing in my GDB with the
official NDK to test this theory though (be careful to get all the
Python dependencies), here's the links:
http://mingw-and-ndk.googlecode.com/files/android-ndk-r6b-gdb-7.3.50.20110709-linux-x86.7z
http://mingw-and-ndk.googlecode.com/files/android-ndk-r6b-gdb-7.3.50.20110709-darwin-x86.7z
http://mingw-and-ndk.googlecode.com/files/android-ndk-r6b-gdb-7.3.50.20110709-windows.7z
Cheers,
Ray.
Hi David,
Anecdotal, but my version of the NDK uses binutils 2.20.1 apparently
without this issue. I suspect, if anything, that the GDB in the
official NDK is getting a bit too old and thus out of sync with the
rest of the toolchain (granted, this is not the most technical
analysis).
With regards to testing, the Necessitas Qt project have been using
GDBs from my NDK for ages now (3 alpha releases * 3 host platforms)
and the only issue we've seen is that thumb-2 debugging doesn't work
well (it doesn't on 6.6 either though). I'd like to request, if
possible, to upgrade as far as the latest release, 7.3.1 and also
include Python support.
My Python version can be found here:
https://gitorious.org/mingw-python/mingw-python
Some things are really hacky (check build-python.sh if you want to see
the worst of that) but, on the plus side, it works well.
From lurking on CPython lists, I think that efforts are being made
towards making it build on MSYS/MinGW, which would be great.
So I bundle all the Python modules up with my NDKs and the gdb.exe
uses a relative path to find the modules and the so/dylib/dll (though
I'm considering moving to it being a static version instead - will
still have to support module loading of course).
On Nov 24, 4:05 pm, mingw android <mingw.andr...@gmail.com> wrote:
> Hi David,
>
> Anecdotal, but my version of the NDK uses binutils 2.20.1 apparently
> without this issue. I suspect, if anything, that the GDB in the
> official NDK is getting a bit too old and thus out of sync with the
> rest of the toolchain (granted, this is not the most technical
> analysis).
>
> It should be possible (and easy) to try mixing in my GDB with the
> official NDK to test this theory though (be careful to get all the
> Python dependencies), here's the links:
>
Can you try from cmd.exe or msys? I have a deep rooted hatred for cygwin which prevents me from installing it!
Actually I will install it just this once! If you are wanting to use 4.6.2 then use mklink from cmd.exe to link sources/cxx-stl to sources/cxx-stl-4.6.2.
Its also worth trying my 4.4.3 as its compiled differently from the google version and I've seen ICEs that happen on google's version that cant be reproduced on mine.
Those ICEs were specifically neon related btw.
On Nov 24, 11:22 pm, mingw android <mingw.andr...@gmail.com> wrote:
> Those ICEs were specifically neon related btw.
> On Nov 24, 2011 7:21 PM, "mingw android" <mingw.andr...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Can you try from cmd.exe or msys? I have a deep rooted hatred for cygwin
> > which prevents me from installing it!
>
> > Actually I will install it just this once! If you are wanting to use 4.6.2
> > then use mklink from cmd.exe to link sources/cxx-stl to
> > sources/cxx-stl-4.6.2.
>
> > Its also worth trying my 4.4.3 as its compiled differently from the google
> > version and I've seen ICEs that happen on google's version that cant be
> > reproduced on mine.
> >>http://mingw-and-ndk.googlecode.com/files/android-ndk-r6b-gdb-7.3.50......