From: Daniel Jacobowitz <drow@mvista.com>
To: ramana@codito.com
Cc: gdb@sources.redhat.com
Subject: Re: Problem with multiple threads using gdbserver on x86.
Date: Mon, 23 Jun 2003 14:08:00 -0000 [thread overview]
Message-ID: <20030623124618.GA24330@nevyn.them.org> (raw)
In-Reply-To: <1056365816.1389.20.camel@numenor.codito.co.in>
On Mon, Jun 23, 2003 at 04:26:56PM +0530, Ramana Radhakrishnan wrote:
> hi,
>
> this is regarding debugging multi-threaded applications using gdbserver.
> I am facing a weird situation with respect to the same. When i try and
> run gdbserver on a multi-threaded application and try to debug the same,
> gdb is unable to stop all the threads on hitting a breakpoint in one of
> the threads.
>
> the steps i followed are the following.
> $>gdbserver localhost:1234 thr
> $>gdb thr
>
> (gdb) target remote localhost:1234
> Remote debugging using localhost:1234
> 0x40000be0 in ?? ()
>
> (gdb) set remotelogfile logfile
> (gdb) b main
> Breakpoint 1 at 0x80484b0: file thr.c, line 11.
> (gdb) c
> Continuing.
> Ignoring packet error, continuing...
> Ignoring packet error, continuing...
> Ignoring packet error, continuing...
>
> Breakpoint 1, main (argc=1, argv=0xbffff144) at thr.c:11
> 11 printf("Creating...\n");
> (gdb) n
> 12 pthread_create( &id, NULL, work2, ((void*) 0) );
> (gdb) n
> 13 printf("Created thread.\n"); fflush(stdout);
> (gdb) n
> 15 printf("Waiting...\n");
>
>
> At this point in time if i do an info threads the only thread it shows
> me is the main thread though in gdb it shows me both the threads.
> At the same point of time when the main thread is stopped at this
> position the thread which has just been created runs away. !
> and on doing an info threads i do not get the information about the
> newly created thread.
>
> Is this a limitation of gdbserver with respect to kernel space threads.
> I saw the comment in thread-db.c in the function
> thread_db_find_new_threads. which says "iterate" over user space threads
> ??
> The foll. is the information regarding my machine / environment.
>
> RedHat linux 9.0 . gdb v 5.3 gcc version 3.2.2 20030222
> GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
>
>
> I wonder if anyone else is getting a similar problem ..I am attaching
> the 2 files that were used for this purpose.
It works perfectly fine for me. I recommend you ask Red Hat; I know
that gdbserver does not yet support NPTL so it's possible that they
have disabled threading.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-06-23 14:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-23 12:15 Ramana Radhakrishnan
2003-06-23 14:08 ` Daniel Jacobowitz [this message]
2003-06-23 14:10 ` Ramana Radhakrishnan
2003-06-23 14:13 ` Daniel Jacobowitz
[not found] ` <oprq72f1mrocv5ka@mail.codito.co.in>
[not found] ` <20030623132811.GA30502@nevyn.them.org>
2003-06-23 15:13 ` Ramana Radhakrishnan
2003-06-23 15:20 ` Daniel Jacobowitz
2003-06-23 16:03 ` Ramana Radhakrishnan
2003-06-23 16:21 ` Ramana Radhakrishnan
2003-06-23 16:25 ` Daniel Jacobowitz
2003-06-23 16:30 ` Ramana Radhakrishnan
2003-06-23 18:35 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030623124618.GA24330@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb@sources.redhat.com \
--cc=ramana@codito.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox