LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-05-2009, 03:56 PM   #1
Hachaso
Member
 
Registered: May 2001
Posts: 42

Rep: Reputation: 15
Debug using gdb and gdbserver


Hi!

I'm trying to debug a shared lib (.so file) on Android.
The shared lib holds the JNI code. So in other words, a Java function calls my function implemented in my shared lib.

I have managed to attach the gdbserver to the process loading my shared lib. Also connecting the gdb to the gdbserver with, "target remote localhost:1234". I'm running the application on the Android emulator.
I even manage to load the symbol file for the lib. The problem starts when I try to set a breakpoint and type "continue" on the gdb terminal.
I get this error message.

Error accessing memory address 0x5d3: Input/output error

Seems like the breakpoint is set at the address 0x5d3.
Looking at the start and end address in memory where the library is loaded I can verify that the breakpoint is not set between those addresses. I guess that this is why I get this error.
I looked up the address space using "cat /proc/<PID of Process>/maps"

If this is the case, how can I make sure that the breakpoint is set inside the address space of the loaded library??
Maybe with some offset? But how ?

Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot debug with gdb ufmale Programming 9 04-27-2009 05:21 PM
thread debugging gdbserver gdb 256Doofus Linux - Embedded & Single-board computer 6 04-13-2009 06:13 AM
LXer: Remote cross-target debugging with GDB and GDBserver LXer Syndicated Linux News 0 11-28-2007 03:20 PM
Using gdb to debug different arhitectures george_mercury Linux - Software 1 01-07-2005 06:19 PM
how to debug multithread using GDB? ryanux Programming 1 05-11-2004 12:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration