linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* GDB server and threaded application
@ 2003-03-26  3:58 Kalpesh Jasapara
  2003-03-26  4:05 ` Daniel Jacobowitz
  2003-03-26  5:39 ` Vladimir Gurevich
  0 siblings, 2 replies; 7+ messages in thread
From: Kalpesh Jasapara @ 2003-03-26  3:58 UTC (permalink / raw)
  To: gdb; +Cc: linuxppc-dev


Hello,

I am having a problem with remote gdb debugging
using gdbserver to work with multi threads.
The command "info threads" shows only one thread.

I am using glibc 2.1.3, powerpc-linux-gdb 5.3,
powerpc-linux-gcc 2.9.5

Observed that qfThreadInfo packet response contains
only
one thread, not a list of all the threads in our
application.

How does the all_threads list get populated with the
other
threads?

Is this feature supported with the versions that we
are using?

-Kalpesh


Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GDB server and threaded application
  2003-03-26  3:58 GDB server and threaded application Kalpesh Jasapara
@ 2003-03-26  4:05 ` Daniel Jacobowitz
  2003-03-26  5:39 ` Vladimir Gurevich
  1 sibling, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-03-26  4:05 UTC (permalink / raw)
  To: Kalpesh Jasapara; +Cc: gdb, linuxppc-dev


On Tue, Mar 25, 2003 at 07:58:30PM -0800, Kalpesh Jasapara wrote:
> Hello,
>
> I am having a problem with remote gdb debugging
> using gdbserver to work with multi threads.
> The command "info threads" shows only one thread.
>
> I am using glibc 2.1.3, powerpc-linux-gdb 5.3,
> powerpc-linux-gcc 2.9.5
>
> Observed that qfThreadInfo packet response contains
> only
> one thread, not a list of all the threads in our
> application.
>
> How does the all_threads list get populated with the
> other
> threads?
>
> Is this feature supported with the versions that we
> are using?

I recommend you search the archives for this mailing list.  I've
still not written a good FAQ about this but I've answered the question
five or six times.

In short, probably your target libraries are not properly available to
the host GDB.

--
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GDB server and threaded application
  2003-03-26  3:58 GDB server and threaded application Kalpesh Jasapara
  2003-03-26  4:05 ` Daniel Jacobowitz
@ 2003-03-26  5:39 ` Vladimir Gurevich
  2003-03-26 13:41   ` Daniel Jacobowitz
  1 sibling, 1 reply; 7+ messages in thread
From: Vladimir Gurevich @ 2003-03-26  5:39 UTC (permalink / raw)
  To: Kalpesh Jasapara; +Cc: gdb, linuxppc-dev


Hi Kalpesh!

Kalpesh Jasapara wrote:
> I am having a problem with remote gdb debugging
> using gdbserver to work with multi threads.
> The command "info threads" shows only one thread.

Here is a relevant excerpt from Wolfgang Denk's
posting from ppc-embedded:

> Dear Owen,
>
> in message <20020820144703.16442.qmail@web20107.mail.yahoo.com> you wrote:
>
>>
>> I`m trying to debug a multi-threaded application using
>> gdbserver on the remote/target side and I`m having
>> some problems, the output I got is depicted below:
>
>
> I'm not surprised. This is broken in most versions of GDB / gdbserver
> floating around.
>
>
>> I`m using gdbserver5.2.1 (I tried the one from HHL-2.0
>> Journeyman and didn`t worked too) compiled by myself
>> using Mvista HHL 2.0 tools and gdb 5.2.1 on my i386.
>> Am I doing something wrong or remote thread debugging
>> is not supported by gdb? I have read something about
>
>
> Let's say the support is incomplete :-)
>
>> problems with multi-thread application debugging but I
>> thought that it may be OK at this time...
>> Could someone explain to me what`s happening?
>
>
> Check out our ELDK  (see  http://www.denx.de/ELDK);  it  contains  an
> extended  /  bug  fixed  version  of  GDB  / gdbserver; remote target
> debugging of MT applications was one of the areas where we spend some
> work.
>
> If you're just looking for the patches: these can be found on our FTP
> server; the README including description of the test procedure is at
> ftp://ftp.denx.de/pub/ppc/patches/README-GDB-MT-Support
>

I hope this helps.

Cheers,
Vladimir


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GDB server and threaded application
  2003-03-26  5:39 ` Vladimir Gurevich
@ 2003-03-26 13:41   ` Daniel Jacobowitz
  2003-03-26 16:13     ` Wolfgang Denk
  2003-03-27  0:00     ` Kalpesh Jasapara
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-03-26 13:41 UTC (permalink / raw)
  To: Vladimir Gurevich; +Cc: Kalpesh Jasapara, gdb, linuxppc-dev, linuxppc-embedded


On Tue, Mar 25, 2003 at 09:39:01PM -0800, Vladimir Gurevich wrote:
>
> Kalpesh Jasapara wrote:
> >I am having a problem with remote gdb debugging
> >using gdbserver to work with multi threads.
> >The command "info threads" shows only one thread.
>
> Here is a relevant excerpt from Wolfgang Denk's
> posting from ppc-embedded:

As usual, Wolfgang's answer is somewhat biased.  GDB 5.3's
multithreaded debug support is complete, and works very well once you
have it set up.  The only thing missing in the FSF tree is the little
"[New thread 21211]" messages, which are purely cosmetic; I never came
to an agreement about how to implement them in the current protocol.

Neither the version originally in HHL 2.0 nor gdb 5.2.1 supported it
however.  Kalpesh said he was trying gdb 5.3, which does.

I would also like to offer Wolfgang a BIG KICK IN THE HEAD.  I have
looked at the relevant path on his FTP site that you referenced below;
despite his name as the only name on the "ChangeLog entry" in the
README and the claim of "we spend some work", it is my work.  I wrote
just about every line of that patch.

As usual proper credit would be appreciated.

> >in message <20020820144703.16442.qmail@web20107.mail.yahoo.com> you wrote:
> >
> >>I'm trying to debug a multi-threaded application using
> >>gdbserver on the remote/target side and I`m having
> >>some problems, the output I got is depicted below:
> >
> >I'm not surprised. This is broken in most versions of GDB / gdbserver
> >floating around.
> >
> >>I'm using gdbserver5.2.1 (I tried the one from HHL-2.0
> >>Journeyman and didn`t worked too) compiled by myself
> >>using Mvista HHL 2.0 tools and gdb 5.2.1 on my i386.
> >>Am I doing something wrong or remote thread debugging
> >>is not supported by gdb? I have read something about
> >
> >Let's say the support is incomplete :-)
> >
> >>problems with multi-thread application debugging but I
> >>thought that it may be OK at this time...
> >>Could someone explain to me what`s happening?
> >
> >Check out our ELDK  (see  http://www.denx.de/ELDK);  it  contains  an
> >extended  /  bug  fixed  version  of  GDB  / gdbserver; remote target
> >debugging of MT applications was one of the areas where we spend some
> >work.
> >
> >If you're just looking for the patches: these can be found on our FTP
> >server; the README including description of the test procedure is at
> >ftp://ftp.denx.de/pub/ppc/patches/README-GDB-MT-Support

--
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GDB server and threaded application
  2003-03-26 13:41   ` Daniel Jacobowitz
@ 2003-03-26 16:13     ` Wolfgang Denk
  2003-03-27  0:00     ` Kalpesh Jasapara
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2003-03-26 16:13 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Vladimir Gurevich, Kalpesh Jasapara, gdb, linuxppc-dev


Daniel,

in message <20030326134141.GA32522@nevyn.them.org> you wrote:
>
> As usual, Wolfgang's answer is somewhat biased.  GDB 5.3's

As usual? C'me on!

> Neither the version originally in HHL 2.0 nor gdb 5.2.1 supported it
> however.  Kalpesh said he was trying gdb 5.3, which does.

It was not me who pointed to "our" version of the patch.

In my original posting which Vladimir quotet I  answered  a  question
which  was  exactly  about the GDB version in HHL 2.0 and gdb[server]
5.2.1.

> I would also like to offer Wolfgang a BIG KICK IN THE HEAD.  I have
> looked at the relevant path on his FTP site that you referenced below;
> despite his name as the only name on the "ChangeLog entry" in the
> README and the claim of "we spend some work", it is my work.  I wrote
> just about every line of that patch.

It is based on your patch, right. But your patch was against the  (by
then)  TOT  of  the GDB CVS. It was not very hard to back port to GDB
version 5.2 and even to 5.1.1. But yes, we _did_ spend some  work  on
this.  Basic  functionality  of remote multi-thread debugging (namely
things  as  thread  selection,  stack  backtraces,  thread  variables
printouts)  worked  okay.  But  if  I  remember right there were some
features though that were not working yet. Most notably,  these  were
asynchronous  thread  notification  (that  is, when gdbserver receive
signals upon creation of a new thread or death of an existing thread,
etc.), and single-stepping within a thread.  Again,  "we  spend  some
work".

> As usual proper credit would be appreciated.

Of course. Added to the README. Is this  OK  for  you  now?  If  not,
please send me a diff containing the text you want to see added.

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
 The software required `Windows 95 or better', so I installed Linux.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GDB server and threaded application
  2003-03-26 13:41   ` Daniel Jacobowitz
  2003-03-26 16:13     ` Wolfgang Denk
@ 2003-03-27  0:00     ` Kalpesh Jasapara
  2003-03-27  1:55       ` Daniel Jacobowitz
  1 sibling, 1 reply; 7+ messages in thread
From: Kalpesh Jasapara @ 2003-03-27  0:00 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb, linuxppc-dev


Hello Daniel,

I believe I have the solib path set correctly and
all the symbols are being loaded when I connect
to the remote target.

BTW I am able to debug core files correctly and the
core files show all the threads. Its an issue if
I try to attach to a running multithreaded process.

gdbserver :12345 --attach <PID>, I just pick up one
of the PID's of the multithreaded process. I guess
this is supported.

Thanks for all the information.
-Kalpesh

--- Daniel Jacobowitz <drow@mvista.com> wrote:
> On Tue, Mar 25, 2003 at 09:39:01PM -0800, Vladimir
> Gurevich wrote:
> >
> > Kalpesh Jasapara wrote:
> > >I am having a problem with remote gdb debugging using gdbserver to
> > >work with multi threads. The command "info threads" shows only one
> > >thread.
> >
> > Here is a relevant excerpt from Wolfgang Denk's posting from
> > ppc-embedded:
>
> As usual, Wolfgang's answer is somewhat biased. GDB 5.3's
> multithreaded debug support is complete, and works very well once you
> have it set up. The only thing missing in the FSF tree is the little
> "[New thread 21211]" messages, which are purely cosmetic; I never came
> to an agreement about how to implement them in the current protocol.
>
> Neither the version originally in HHL 2.0 nor gdb 5.2.1 supported it
> however. Kalpesh said he was trying gdb 5.3, which does.
>
> I would also like to offer Wolfgang a BIG KICK IN THE HEAD. I have
> looked at the relevant path on his FTP site that you referenced below;
> despite his name as the only name on the "ChangeLog entry" in the
> README and the claim of "we spend some work", it is my work. I wrote
> just about every line of that patch.
>
> As usual proper credit would be appreciated.
>
> > >in message <20020820144703.16442.qmail@web20107.mail.yahoo.com> you wrote:
> > >
> > >>I`m trying to debug a multi-threaded application using gdbserver
> > >>on the remote/target side and I`m having some problems, the output
> > >>I got is depicted below:
> > >
> > >I'm not surprised. This is broken in most versions of GDB /
> > >gdbserver floating around.
> > >
> > >>I`m using gdbserver5.2.1 (I tried the one from HHL-2.0 Journeyman
> > >>and didn`t worked too) compiled by myself using Mvista HHL 2.0
> > >>tools and gdb 5.2.1 on my i386. Am I doing something wrong or
> > >>remote thread debugging is not supported by gdb? I have read
> > >>something about
> > >
> > >Let's say the support is incomplete :-)
> > >
> > >>problems with multi-thread application debugging but I thought
> > >>that it may be OK at this time... Could someone explain to me
> > >>what`s happening?
> > >
> > >Check out our ELDK (see http://www.denx.de/ELDK); it contains an
> > >extended / bug fixed version of GDB / gdbserver; remote target
> > >debugging of MT applications was one of the areas where we spend
> > >some work.
> > >
> > >If you're just looking for the patches: these can be found on our
> > >FTP server; the README including description of the test procedure
> > >is at ftp://ftp.denx.de/pub/ppc/patches/README-GDB-MT-Support

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GDB server and threaded application
  2003-03-27  0:00     ` Kalpesh Jasapara
@ 2003-03-27  1:55       ` Daniel Jacobowitz
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-03-27  1:55 UTC (permalink / raw)
  To: Kalpesh Jasapara; +Cc: gdb, linuxppc-dev, linuxppc-embedded


No, --attach to a threaded application is _not_ currently supported.

On Wed, Mar 26, 2003 at 04:00:11PM -0800, Kalpesh Jasapara wrote:
>
> I believe I have the solib path set correctly and all the symbols are
> being loaded when I connect to the remote target.
>
> BTW I am able to debug core files correctly and the core files
> show all the threads. Its an issue if I try to attach to a running
> multithreaded process.
>
> gdbserver :12345 --attach <PID>, I just pick up one of the PID's of
> the multithreaded process. I guess this is supported.
>
> --- Daniel Jacobowitz <drow@mvista.com> wrote:
> > On Tue, Mar 25, 2003 at 09:39:01PM -0800, Vladimir
> > Gurevich wrote:
> > >
> > > Kalpesh Jasapara wrote:
> > > >I am having a problem with remote gdb debugging using gdbserver
> > > >to work with multi threads. The command "info threads" shows only
> > > >one thread.
> > >
> > > Here is a relevant excerpt from Wolfgang Denk's posting from
> > > ppc-embedded:
> >
> > As usual, Wolfgang's answer is somewhat biased. GDB 5.3's
> > multithreaded debug support is complete, and works very well once
> > you have it set up. The only thing missing in the FSF tree is the
> > little "[New thread 21211]" messages, which are purely cosmetic;
> > I never came to an agreement about how to implement them in the
> > current protocol.
> >
> > Neither the version originally in HHL 2.0 nor gdb 5.2.1 supported it
> > however. Kalpesh said he was trying gdb 5.3, which does.
> >
> > I would also like to offer Wolfgang a BIG KICK IN THE HEAD. I have
> > looked at the relevant path on his FTP site that you referenced
> > below; despite his name as the only name on the "ChangeLog entry" in
> > the README and the claim of "we spend some work", it is my work. I
> > wrote just about every line of that patch.
> >
> > As usual proper credit would be appreciated.
> >
> > > >in message <20020820144703.16442.qmail@web20107.mail.yahoo.com> you wrote:
> > > >
> > > >>I'm trying to debug a multi-threaded application using gdbserver
> > > >>on the remote/target side and I`m having some problems, the
> > > >>output I got is depicted below:
> > > >
> > > >
> > > >I'm not surprised. This is broken in most versions of GDB /
> > > >gdbserver floating around.
> > > >
> > > >
> > > >>I`m using gdbserver5.2.1 (I tried the one from HHL-2.0
> > > >>Journeyman and didn`t worked too) compiled by myself using
> > > >>Mvista HHL 2.0 tools and gdb 5.2.1 on my i386. Am I doing
> > > >>something wrong or remote thread debugging is not supported by
> > > >>gdb? I have read something about
> > > >
> > > >Let's say the support is incomplete :-)
> > > >
> > > >>problems with multi-thread application debugging but I thought
> > > >>that it may be OK at this time... Could someone explain to me
> > > >>what`s happening?
> > > >
> > > >Check out our ELDK (see http://www.denx.de/ELDK); it contains an
> > > >extended / bug fixed version of GDB / gdbserver; remote target
> > > >debugging of MT applications was one of the areas where we spend
> > > >some work.
> > > >
> > > >If you're just looking for the patches: these
> > > >can be found on our FTP server; the README
> > > >including description of the test procedure is at
> > > >ftp://ftp.denx.de/pub/ppc/patches/README-GDB-MT-Support

--
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-03-27  1:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-26  3:58 GDB server and threaded application Kalpesh Jasapara
2003-03-26  4:05 ` Daniel Jacobowitz
2003-03-26  5:39 ` Vladimir Gurevich
2003-03-26 13:41   ` Daniel Jacobowitz
2003-03-26 16:13     ` Wolfgang Denk
2003-03-27  0:00     ` Kalpesh Jasapara
2003-03-27  1:55       ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).