LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-22-2011, 06:21 PM   #1
Ajay Kumar
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Rep: Reputation: 0
Problem debugging a multi threaded program using gdb


I am debugging a multi-threaded program remotely on the target from another host, using 'gdbserver' on the target and 'gdb' on the host. I do the following:

target# gdbserver localhost:4567 ./my_prog
Process ./my_prog created; pid = 934
Listening on port 4567

host# arm-none-linux-gnueabi-gdb /home/asabat/targetfs/home/my_prog
(gdb) set sysroot /home/asabat/targetfs/
(gdb) set solib-search-path /home/asabat/targetfs/lib/
(gdb) target remote 10.101.24.118:4567
Remote debugging using 10.101.24.77:4567
(gdb) continue

When I stop it using a breakpoint and check the thread details using the command 'info threads', it shows only one thread. However, there are three threads running on the target for this program being debugged.
host#
(gdb) info threads
[New Thread 1061]
2 Thread 1061 main (argc=1, argv=0xbeefadd4) at ./src/um_main.c:103
* 1 Thread <main> main (argc=1, argv=0xbeefadd4) at ./src/um_main.c:103

target# ps -eLf
root 1051 918 1051 0 1 23:32 ttyS2 00:00:00 gdbserver localhost:4567 ./my_prog
root 1052 1051 1052 0 3 23:32 ttyS2 00:00:00 ./my_prog
root 1052 1051 1053 0 3 23:33 ttyS2 00:00:00 ./my_prog
root 1052 1051 1054 0 3 23:33 ttyS2 00:00:00 ./my_prog

root 1055 939 1055 0 1 23:37 pts/0 00:00:00 /usr/bin/ps -eLf

Previously I have done debugging of multi threaded programs using gdb and it used to work fine. I don't have any clue what I am missing here. I went through the gdb manual and couldn't find anything related.

Last edited by Ajay Kumar; 12-29-2011 at 09:29 AM. Reason: wrong title line
 
Old 12-28-2011, 03:00 PM   #2
Ajay Kumar
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Original Poster
Rep: Reputation: 0
I found that thread debugging was not working because of incompatible libthread_db library. After replacing the library it worked fine.
For more details refer my post on the discussion http://e2e.ti.com/support/embedded/l...10.aspx#562324.

Last edited by Ajay Kumar; 12-29-2011 at 09:16 AM.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gdb - Cannot find new threads: generic error tashtego Programming 3 10-27-2010 06:05 PM
gdb remote debugging problem unev_21 Linux - Software 1 10-26-2009 09:14 AM
using gdb/gdbserver with threads Hachaso Programming 0 06-25-2009 09:37 AM
Making use of debugging info in gdb? CoderMan Programming 3 05-14-2009 05:48 PM
debugging remote process in gdb arunachalam Linux - Software 2 02-18-2008 10:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:29 PM.

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