Not able to set the break point - Getting error accessing memory address

1,218 views
Skip to first unread message

Aluvala Suman

unread,
Dec 7, 2011, 4:45:27 AM12/7/11
to Android NDK Google Group
Hi All,


I am trying to debug the native code in the android app, which is developed by me.
But i am not able to set the break points.

Everytime i am getting this errror.

Will anyone please help me in resolving the same.

Please find the error below
////////////////////////////////////////////////////////////////////////////////////////////////////////////
.......
......
......
Error while mapping shared library sections:
libwebcore.so: No such file or directory.
Error while mapping shared library sections:
gralloc.default.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 D:/EclipseTestWorkspace/CallbackJava/obj/local/armeabi/libc.so
(gdb) break SipApi.c:Java_com_callback_SipApi_Register
No symbol table is loaded.  Use the "file" command.
(gdb) break callbacks_java.cpp:appcallback_register
No symbol table is loaded.  Use the "file" command.
(gdb) load ./obj/local/armeabi/libcallbacks.so
Loading section .hash, size 0x34c lma 0xd4
Load failed
(gdb) file ./obj/local/armeabi/libcallbacks.so
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from D:\EclipseTestWorkspace\CallbackJava/./obj/local/armeabi/libcallbacks.so...done.
(gdb) break SipApi.c:Java_com_callback_SipApi_Register
Breakpoint 1 at 0x1ff8: file D:/EclipseTestWorkspace/CallbackJava/jni/SipApi.c, line 19.
(gdb) break callbacks_java.cpp:appcallback_register
Breakpoint 2 at 0x1a5c: file D:/EclipseTestWorkspace/CallbackJava/jni/callbacks_java.cpp, line 419.
(gdb) c
Continuing.
Warning:
Cannot insert breakpoint 1.
Error accessing memory address 0x1ff8: Input/output error.
Cannot insert breakpoint 2.
Error accessing memory address 0x1a5c: Input/output error.

(gdb)


////////////////////////////////////////////////////////////////////////////////////////////////////////////



Thanks & Regards,
SSuman185

David Turner

unread,
Dec 7, 2011, 5:25:54 AM12/7/11
to andro...@googlegroups.com
This is weird. Do you have more information about the way you build your applications (ndk-build, standalone toolchain) and debug it (ndk-gdb, or something else).
Also, is there a simple way to reproduce this?



--
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.

Aluvala Suman

unread,
Dec 7, 2011, 7:32:20 AM12/7/11
to andro...@googlegroups.com
Hi David,

I built my application with the below command 
/cygdrive/c/Android/android-ndk/ndk-build NDK_APP_APPLICATION_MK=Application_Debug.mk NDK_DEBUG=1 V=1 

I have set the 
android:debuggable=true in AndroidManifest.xml file and also
LOCAL_EXPORT_CFLAGS += -g option in Android.mk file.

This is the Application_Debug.mk file
APP_MODULES      := callbacks
APP_PLATFORM := android-9
APP_OPTIM := debug


I run the script with the following command
"ndk-gdb --force --start --verbose " from the parent of the jni folder.

If the directory structure is like this 

Project
|_ src
|_ jni
|_ obj
|_ libs....


Then command prompt is in the "Project" folder when I am executing the ndk-gdb command. I tried executing the ndk-gdb command from the libs, obj and jni folder as well.
Still getting the mentioned error. If I load the shared object file with "file" command, as the addresses are not relocated, not able to hit the break points.

I am using AVD2.3.3. API Level 10 and android-ndk-r7.

Regards,
Suman

Riasat Abir

unread,
Dec 11, 2011, 4:39:47 AM12/11/11
to andro...@googlegroups.com
I donno why people prefers working with NDK at Windows :(
Ubuntu is very much easier with NDK.

Two .so files are missing. Are you debugging at simulator?

HimHim

mingw android

unread,
Dec 11, 2011, 12:51:38 PM12/11/11
to andro...@googlegroups.com

Imho it's much the same in any os, so I'd say use what your most comfortable with.

Riasat Abir

unread,
Dec 20, 2011, 1:56:52 PM12/20/11
to andro...@googlegroups.com
I used to use Windows XP + Cygwin.
First of all, I didn't like cygwin.
Secondly, I wrote a program which had memory leakage with memcopy, which crashed at windows, but did not crash in linux though it didn't work as expected. After the memory leak was fixed it ran ok on both. 
Thirdly, Ubuntu is comfortable for shell much helpful :)
Reply all
Reply to author
Forward
0 new messages