Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdb/threading under arm-linux
@ 2002-03-05  5:39 Miah Gregory
  2002-03-05  7:35 ` Daniel Jacobowitz
  0 siblings, 1 reply; 11+ messages in thread
From: Miah Gregory @ 2002-03-05  5:39 UTC (permalink / raw)
  To: gdb

Hi,

Does anyone know whether threads are supported in the arm-linux version of
gdb. From the gdb documentation, if 'info threads' appears to no-op, and
'thread x' gives an error, threads are not supported.

I'm trying to work out whether I'm seeing a gdb problem, a kernel problem,
or both. I'm running this test on a pair of compaq ipaq's, one running
2.4.3-rmk2-np1, and the other running 2.4.16-rmk1.

gdb version | kernel version | threads seem to work?
------------|----------------|-------------------------------------
5.0         | 2.4.3-rmk2-np1 | Yes
5.1.1       | 2.4.3-rmk2-np1 | No, but lots of SIG32's are received
5.0         | 2.4.16-rmk1    | No, but lots of SIG32's are received
5.1.1       | 2.4.16-rmk1    | No, but lots of SIG32's are received

I'm happy to try and debug this, but I could do with a few pointers as to
where I should start looking, and some ideas as to what I'm looking for.

Thanks in advance.

-- 
Miah Gregory


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

* Re: gdb/threading under arm-linux
  2002-03-05  5:39 gdb/threading under arm-linux Miah Gregory
@ 2002-03-05  7:35 ` Daniel Jacobowitz
  2002-03-06  1:45   ` Miah Gregory
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2002-03-05  7:35 UTC (permalink / raw)
  To: Miah Gregory; +Cc: gdb

On Tue, Mar 05, 2002 at 01:39:31PM +0000, Miah Gregory wrote:
> Hi,
> 
> Does anyone know whether threads are supported in the arm-linux version of
> gdb. From the gdb documentation, if 'info threads' appears to no-op, and
> 'thread x' gives an error, threads are not supported.
> 
> I'm trying to work out whether I'm seeing a gdb problem, a kernel problem,
> or both. I'm running this test on a pair of compaq ipaq's, one running
> 2.4.3-rmk2-np1, and the other running 2.4.16-rmk1.
> 
> gdb version | kernel version | threads seem to work?
> ------------|----------------|-------------------------------------
> 5.0         | 2.4.3-rmk2-np1 | Yes
> 5.1.1       | 2.4.3-rmk2-np1 | No, but lots of SIG32's are received
> 5.0         | 2.4.16-rmk1    | No, but lots of SIG32's are received
> 5.1.1       | 2.4.16-rmk1    | No, but lots of SIG32's are received
> 
> I'm happy to try and debug this, but I could do with a few pointers as to
> where I should start looking, and some ideas as to what I'm looking for.
> 
> Thanks in advance.

Please try a current snapshot (see http://sources.redhat.com/gdb/).  It
should work.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: gdb/threading under arm-linux
  2002-03-05  7:35 ` Daniel Jacobowitz
@ 2002-03-06  1:45   ` Miah Gregory
  2002-03-06  1:51     ` Miah Gregory
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Miah Gregory @ 2002-03-06  1:45 UTC (permalink / raw)
  To: gdb

In message <20020305103521.A27860@nevyn.them.org>
          Daniel Jacobowitz <drow@mvista.com> wrote:

> On Tue, Mar 05, 2002 at 01:39:31PM +0000, Miah Gregory wrote:

> > Does anyone know whether threads are supported in the arm-linux version
> > of gdb. From the gdb documentation, if 'info threads' appears to no-op,
> > and 'thread x' gives an error, threads are not supported.

> > I'm trying to work out whether I'm seeing a gdb problem, a kernel
> > problem, or both. I'm running this test on a pair of compaq ipaq's, one
> > running 2.4.3-rmk2-np1, and the other running 2.4.16-rmk1.

> > gdb version | kernel version | threads seem to work?
> > ------------|----------------|-------------------------------------
> > 5.0         | 2.4.3-rmk2-np1 | Yes
> > 5.1.1       | 2.4.3-rmk2-np1 | No, but lots of SIG32's are received
> > 5.0         | 2.4.16-rmk1    | No, but lots of SIG32's are received
> > 5.1.1       | 2.4.16-rmk1    | No, but lots of SIG32's are received

> > I'm happy to try and debug this, but I could do with a few pointers as to
> > where I should start looking, and some ideas as to what I'm looking for.

> Please try a current snapshot (see http://sources.redhat.com/gdb/).  It
> should work.

No luck. Now both kernels give the SIG32 problem.
This is with snapshot 20020305. Also, as an added bonus, gdb now crashes
when you ctrl-c a running program to get to the debugger, then do
'info threads'. :-(

-- 
Miah Gregory


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

* Re: gdb/threading under arm-linux
  2002-03-06  1:45   ` Miah Gregory
@ 2002-03-06  1:51     ` Miah Gregory
  2002-03-06 17:32     ` Michael Snyder
       [not found]     ` <20020306110033.A14410@nevyn.them.org>
  2 siblings, 0 replies; 11+ messages in thread
From: Miah Gregory @ 2002-03-06  1:51 UTC (permalink / raw)
  To: gdb

In message <e3eee6124b.miah@picsel.com>
          Miah Gregory <miah@picsel.com> wrote:

> No luck. Now both kernels give the SIG32 problem.
> This is with snapshot 20020305. Also, as an added bonus, gdb now crashes
> when you ctrl-c a running program to get to the debugger, then do
> 'info threads'. :-(

Just to reply to myself, with a little more information on the above:

If a "---Type <return> to continue, or q <return> to quit---" message comes
up, and you do ctrl-c, then info threads, gdb segfaults.
If you press return at the above prompt, then info threads, you get no
output, as before.

Kinda unrelated, but shouldn't the above prompt allow you to just break
into the program, not quit it completely?

-- 
Miah Gregory


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

* Re: gdb/threading under arm-linux
  2002-03-06  1:45   ` Miah Gregory
  2002-03-06  1:51     ` Miah Gregory
@ 2002-03-06 17:32     ` Michael Snyder
  2002-03-13  5:13       ` Miah Gregory
       [not found]     ` <20020306110033.A14410@nevyn.them.org>
  2 siblings, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2002-03-06 17:32 UTC (permalink / raw)
  To: Miah Gregory; +Cc: gdb

Miah Gregory wrote:
> 
> In message <20020305103521.A27860@nevyn.them.org>
>           Daniel Jacobowitz <drow@mvista.com> wrote:
> 
> > On Tue, Mar 05, 2002 at 01:39:31PM +0000, Miah Gregory wrote:
> 
> > > Does anyone know whether threads are supported in the arm-linux version
> > > of gdb. From the gdb documentation, if 'info threads' appears to no-op,
> > > and 'thread x' gives an error, threads are not supported.
> 
> > > I'm trying to work out whether I'm seeing a gdb problem, a kernel
> > > problem, or both. I'm running this test on a pair of compaq ipaq's, one
> > > running 2.4.3-rmk2-np1, and the other running 2.4.16-rmk1.
> 
> > > gdb version | kernel version | threads seem to work?
> > > ------------|----------------|-------------------------------------
> > > 5.0         | 2.4.3-rmk2-np1 | Yes
> > > 5.1.1       | 2.4.3-rmk2-np1 | No, but lots of SIG32's are received
> > > 5.0         | 2.4.16-rmk1    | No, but lots of SIG32's are received
> > > 5.1.1       | 2.4.16-rmk1    | No, but lots of SIG32's are received
> 
> > > I'm happy to try and debug this, but I could do with a few pointers as to
> > > where I should start looking, and some ideas as to what I'm looking for.
> 
> > Please try a current snapshot (see http://sources.redhat.com/gdb/).  It
> > should work.
> 
> No luck. Now both kernels give the SIG32 problem.
> This is with snapshot 20020305. Also, as an added bonus, gdb now crashes
> when you ctrl-c a running program to get to the debugger, then do
> 'info threads'. :-(

Are you using libc 2.2?


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

* Re: gdb/threading under arm-linux
       [not found]     ` <20020306110033.A14410@nevyn.them.org>
@ 2002-03-13  5:12       ` Miah Gregory
  2002-03-13  9:09         ` Daniel Jacobowitz
  2002-03-13  9:36         ` Kevin Buettner
  0 siblings, 2 replies; 11+ messages in thread
From: Miah Gregory @ 2002-03-13  5:12 UTC (permalink / raw)
  To: gdb

In message <20020306110033.A14410@nevyn.them.org>
          Daniel Jacobowitz <dmj+@andrew.cmu.edu> wrote:

> On Wed, Mar 06, 2002 at 09:45:15AM +0000, Miah Gregory wrote:
> > In message <20020305103521.A27860@nevyn.them.org>
> >           Daniel Jacobowitz <drow@mvista.com> wrote:

-snip-

> > > Please try a current snapshot (see http://sources.redhat.com/gdb/).
> > > It should work.

> > No luck. Now both kernels give the SIG32 problem.

> You almost certainly do not have libthread_db.so.1 in /lib.  You need
> that to debug threads.

Ok, I managed to build enough of libc 2.2.3 in order to get the required
libthread_db.so.1 library, and I then installed that in /lib.

With the 20020305 snapshot, I get all the same problems. Is there a simple
way to find out whether gdb is trying to use that library?

-- 
Miah Gregory


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

* Re: gdb/threading under arm-linux
  2002-03-06 17:32     ` Michael Snyder
@ 2002-03-13  5:13       ` Miah Gregory
  0 siblings, 0 replies; 11+ messages in thread
From: Miah Gregory @ 2002-03-13  5:13 UTC (permalink / raw)
  To: gdb

In message <3C86C0E8.F2C1B502@redhat.com>
          Michael Snyder <msnyder@redhat.com> wrote:

> Miah Gregory wrote:

> > In message <20020305103521.A27860@nevyn.them.org>
> >           Daniel Jacobowitz <drow@mvista.com> wrote:

> > > Please try a current snapshot (see http://sources.redhat.com/gdb/).
> > > It should work.

> > No luck. Now both kernels give the SIG32 problem.
> > This is with snapshot 20020305. Also, as an added bonus, gdb now crashes
> > when you ctrl-c a running program to get to the debugger, then do
> > 'info threads'. :-(

> Are you using libc 2.2?

Yes. I'm using libc 2.2.3.

-- 
Miah Gregory


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

* Re: gdb/threading under arm-linux
  2002-03-13  5:12       ` Miah Gregory
@ 2002-03-13  9:09         ` Daniel Jacobowitz
  2002-03-13  9:44           ` Miah Gregory
  2002-03-13  9:36         ` Kevin Buettner
  1 sibling, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2002-03-13  9:09 UTC (permalink / raw)
  To: gdb

On Wed, Mar 13, 2002 at 01:11:57PM +0000, Miah Gregory wrote:
> In message <20020306110033.A14410@nevyn.them.org>
>           Daniel Jacobowitz <dmj+@andrew.cmu.edu> wrote:
> 
> > On Wed, Mar 06, 2002 at 09:45:15AM +0000, Miah Gregory wrote:
> > > In message <20020305103521.A27860@nevyn.them.org>
> > >           Daniel Jacobowitz <drow@mvista.com> wrote:
> 
> -snip-
> 
> > > > Please try a current snapshot (see http://sources.redhat.com/gdb/).
> > > > It should work.
> 
> > > No luck. Now both kernels give the SIG32 problem.
> 
> > You almost certainly do not have libthread_db.so.1 in /lib.  You need
> > that to debug threads.
> 
> Ok, I managed to build enough of libc 2.2.3 in order to get the required
> libthread_db.so.1 library, and I then installed that in /lib.
> 
> With the 20020305 snapshot, I get all the same problems. Is there a simple
> way to find out whether gdb is trying to use that library?

I recommend running gdb within gdb, and breakpointing on
thread_db_load.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: gdb/threading under arm-linux
  2002-03-13  5:12       ` Miah Gregory
  2002-03-13  9:09         ` Daniel Jacobowitz
@ 2002-03-13  9:36         ` Kevin Buettner
  1 sibling, 0 replies; 11+ messages in thread
From: Kevin Buettner @ 2002-03-13  9:36 UTC (permalink / raw)
  To: Miah Gregory, gdb

On Mar 13,  1:11pm, Miah Gregory wrote:

> Ok, I managed to build enough of libc 2.2.3 in order to get the required
> libthread_db.so.1 library, and I then installed that in /lib.
> 
> With the 20020305 snapshot, I get all the same problems. Is there a simple
> way to find out whether gdb is trying to use that library?

Find out the GDB's pid and then do ``cat /proc/PID/maps'' (or some such)
to see which libraries are loaded and at which addresses they reside.

Chances are that you'll end up needing to use gdb to debug itself to find
out why the necessary library is not getting loaded, but it's certainly
possible that it's being loaded, but some critical symbol is not being
found by a dlsym() call.  (See Daniel's suggestion.)

BTW, from your glibc build, you should install both libthread_db.so.1 as
well as the corresponding libpthread.so.0.  If you've only installed one
of them, it's possible that there's some mismatch which prevents gdb from
working properly.

Kevin


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

* Re: gdb/threading under arm-linux
  2002-03-13  9:09         ` Daniel Jacobowitz
@ 2002-03-13  9:44           ` Miah Gregory
  2002-03-13  9:50             ` Daniel Jacobowitz
  0 siblings, 1 reply; 11+ messages in thread
From: Miah Gregory @ 2002-03-13  9:44 UTC (permalink / raw)
  To: gdb

In message <20020313120947.A12715@nevyn.them.org>
          Daniel Jacobowitz <drow@mvista.com> wrote:

> On Wed, Mar 13, 2002 at 01:11:57PM +0000, Miah Gregory wrote:

> > In message <20020306110033.A14410@nevyn.them.org>
> >           Daniel Jacobowitz <dmj+@andrew.cmu.edu> wrote:

> > > You almost certainly do not have libthread_db.so.1 in /lib.
> > > You need that to debug threads.

> > Ok, I managed to build enough of libc 2.2.3 in order to get the
> > required libthread_db.so.1 library, and I then installed that in /lib.

> > With the 20020305 snapshot, I get all the same problems. Is there a
> > simple way to find out whether gdb is trying to use that library?

> I recommend running gdb within gdb, and breakpointing on
> thread_db_load.

Sounds reasonable.

When I do that, gdb makes its way through thread_db_init to the final
'return 1;', which I assume from the code means that it opened and
initialised libthread_db correctly.

Anything else I can break on? Which function is called when a new thread is
created?

Running gdb from start to finish, these are the only functions within
thread_db.c that are called, in order:

thread_db_load
init_thread_db_ops
thread_db_init
thread_db_new_objfile (objfile = 0x0000000)
thread_db_new_objfile (objfile = 0x2207e18)

I included the objfile argument here since it looked 'interesting'. :-)

-- 
Miah Gregory


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

* Re: gdb/threading under arm-linux
  2002-03-13  9:44           ` Miah Gregory
@ 2002-03-13  9:50             ` Daniel Jacobowitz
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Jacobowitz @ 2002-03-13  9:50 UTC (permalink / raw)
  To: Miah Gregory; +Cc: gdb

On Wed, Mar 13, 2002 at 05:43:08PM +0000, Miah Gregory wrote:
> In message <20020313120947.A12715@nevyn.them.org>
>           Daniel Jacobowitz <drow@mvista.com> wrote:
> 
> > On Wed, Mar 13, 2002 at 01:11:57PM +0000, Miah Gregory wrote:
> 
> > > In message <20020306110033.A14410@nevyn.them.org>
> > >           Daniel Jacobowitz <dmj+@andrew.cmu.edu> wrote:
> 
> > > > You almost certainly do not have libthread_db.so.1 in /lib.
> > > > You need that to debug threads.
> 
> > > Ok, I managed to build enough of libc 2.2.3 in order to get the
> > > required libthread_db.so.1 library, and I then installed that in /lib.
> 
> > > With the 20020305 snapshot, I get all the same problems. Is there a
> > > simple way to find out whether gdb is trying to use that library?
> 
> > I recommend running gdb within gdb, and breakpointing on
> > thread_db_load.
> 
> Sounds reasonable.
> 
> When I do that, gdb makes its way through thread_db_init to the final
> 'return 1;', which I assume from the code means that it opened and
> initialised libthread_db correctly.
> 
> Anything else I can break on? Which function is called when a new thread is
> created?
> 
> Running gdb from start to finish, these are the only functions within
> thread_db.c that are called, in order:
> 
> thread_db_load
> init_thread_db_ops
> thread_db_init
> thread_db_new_objfile (objfile = 0x0000000)
> thread_db_new_objfile (objfile = 0x2207e18)

Might want to step through thread_db_new_objfile.  Is something causing
it to turn off thread_db?

Wait, from that pattern of calls it looks like you are using a
statically linked binary.  Try using a dynamically linked binary, and
I'll take another look at HJ's patch to fix the static case :)

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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

end of thread, other threads:[~2002-03-13 17:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-05  5:39 gdb/threading under arm-linux Miah Gregory
2002-03-05  7:35 ` Daniel Jacobowitz
2002-03-06  1:45   ` Miah Gregory
2002-03-06  1:51     ` Miah Gregory
2002-03-06 17:32     ` Michael Snyder
2002-03-13  5:13       ` Miah Gregory
     [not found]     ` <20020306110033.A14410@nevyn.them.org>
2002-03-13  5:12       ` Miah Gregory
2002-03-13  9:09         ` Daniel Jacobowitz
2002-03-13  9:44           ` Miah Gregory
2002-03-13  9:50             ` Daniel Jacobowitz
2002-03-13  9:36         ` Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox