Linux MIPS Architecture development
 help / color / mirror / Atom feed
* cannot debug multi-threaded programs with gdb/gdbserver
@ 2002-09-17 17:03 Stuart Hughes
  2002-09-17 17:24 ` Steven J. Hill
  0 siblings, 1 reply; 8+ messages in thread
From: Stuart Hughes @ 2002-09-17 17:03 UTC (permalink / raw)
  To: Linux-MIPS

Hi,

I managed to get gdb to do multi-threaded debug using a gdb on the
target, after Daniel J helped with a patch to sys/procfs.h

I am now trying to do host target with gdb/gdbserver.  The program on
the target uses pthreads.

I can connect, but as soon as you try to continue (to a breakpoint) I
get:

Program received signal SIG32, Real-time event 32.
warning: Warning: GDB can't find the start of the function at
0x2abee684.
....

I know that SIG32 is used for the thread control on the target, but I'm
not sure if the host gdb is supposed to receive this.  I tried "set
handle SIG32 pass noprint nostop"
and variations, but this didn't help.
 
Does anyone know whether there is some special setup needed on
gdb/gdbserver to use the multi-threaded gdbserver ??



My environment is as follows:

CPU:		NEC VR5432
kernel: 	linux-2.4.18 + patches
glibc:		2.2.3 + patches
gdb:		5.2/3 from CVS
gcc:		3.1
binutils:	Version 2.11.90.0.25


cross-gdb configured using: 

configure --prefix=/usr --target=mipsel-linux --disable-sim
--disable-tcl --enable-threads --enable-shared

gdbserver configured using:

configure --prefix=/usr --host=mipsel-linux --target=mipsel-linux
--enable-threads --enable-shared


Regards, Stuart

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

* Re: cannot debug multi-threaded programs with gdb/gdbserver
  2002-09-17 17:03 cannot debug multi-threaded programs with gdb/gdbserver Stuart Hughes
@ 2002-09-17 17:24 ` Steven J. Hill
  2002-09-17 18:25   ` Daniel Jacobowitz
  2002-09-18 12:10   ` Johannes Stezenbach
  0 siblings, 2 replies; 8+ messages in thread
From: Steven J. Hill @ 2002-09-17 17:24 UTC (permalink / raw)
  To: Stuart Hughes; +Cc: Linux-MIPS

Stuart Hughes wrote:
> 
> Does anyone know whether there is some special setup needed on
> gdb/gdbserver to use the multi-threaded gdbserver ??
> 
Wow, there are so many things to tell you...where to start...

> My environment is as follows:
> 
> CPU:		NEC VR5432
> kernel: 	linux-2.4.18 + patches
> glibc:		2.2.3 + patches
> gdb:		5.2/3 from CVS
 >
Has to be the gdb-5.3 branch...go look at http://sources.redhat.com/gdb

> gcc:		3.1
> binutils:	Version 2.11.90.0.25
> 
Don't use H.J. Lu's binutils, use the released one. Use gcc-3.2 and
binutils-2.13 as they have fixes for the MIPS debugging symbols with
regards to DWARF.

> cross-gdb configured using: 
> 
> configure --prefix=/usr --target=mipsel-linux --disable-sim
> --disable-tcl --enable-threads --enable-shared
> 
Use '--target=mips-linux' and you'll be better off. Don't worry, it
will support both endians.

> gdbserver configured using:
> 
> configure --prefix=/usr --host=mipsel-linux --target=mipsel-linux
> --enable-threads --enable-shared
> 
I would also try 'CC=mipsel-linux-gcc configure <...>'.

-Steve

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

* Re: cannot debug multi-threaded programs with gdb/gdbserver
  2002-09-17 17:24 ` Steven J. Hill
@ 2002-09-17 18:25   ` Daniel Jacobowitz
  2002-09-17 19:46     ` Steven J. Hill
  2002-09-18  7:48     ` Stuart Hughes
  2002-09-18 12:10   ` Johannes Stezenbach
  1 sibling, 2 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2002-09-17 18:25 UTC (permalink / raw)
  To: Steven J. Hill; +Cc: Stuart Hughes, Linux-MIPS

On Tue, Sep 17, 2002 at 12:24:14PM -0500, Steven J. Hill wrote:
> Stuart Hughes wrote:
> >
> >Does anyone know whether there is some special setup needed on
> >gdb/gdbserver to use the multi-threaded gdbserver ??
> >
> Wow, there are so many things to tell you...where to start...

Steve, have you started memorizing my responses again? :)

> >My environment is as follows:
> >
> >CPU:		NEC VR5432
> >kernel: 	linux-2.4.18 + patches
> >glibc:		2.2.3 + patches
> >gdb:		5.2/3 from CVS
> >
> Has to be the gdb-5.3 branch...go look at http://sources.redhat.com/gdb
> 
> >gcc:		3.1
> >binutils:	Version 2.11.90.0.25
> >
> Don't use H.J. Lu's binutils, use the released one. Use gcc-3.2 and
> binutils-2.13 as they have fixes for the MIPS debugging symbols with
> regards to DWARF.
> 
> >cross-gdb configured using: 
> >
> >configure --prefix=/usr --target=mipsel-linux --disable-sim
> >--disable-tcl --enable-threads --enable-shared
> >
> Use '--target=mips-linux' and you'll be better off. Don't worry, it
> will support both endians.

Except for this one - where'd that come from?  It should make no
functional difference either way, at least assuming you always give GDB
a binary.

> >gdbserver configured using:
> >
> >configure --prefix=/usr --host=mipsel-linux --target=mipsel-linux
> >--enable-threads --enable-shared
> >
> I would also try 'CC=mipsel-linux-gcc configure <...>'.

Definitely.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

* Re: cannot debug multi-threaded programs with gdb/gdbserver
  2002-09-17 18:25   ` Daniel Jacobowitz
@ 2002-09-17 19:46     ` Steven J. Hill
  2002-09-17 20:47       ` Daniel Jacobowitz
  2002-09-18  7:48     ` Stuart Hughes
  1 sibling, 1 reply; 8+ messages in thread
From: Steven J. Hill @ 2002-09-17 19:46 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Stuart Hughes, Linux-MIPS

Daniel Jacobowitz wrote:
> On Tue, Sep 17, 2002 at 12:24:14PM -0500, Steven J. Hill wrote:
> 
> Steve, have you started memorizing my responses again? :)
> 
*gurgle* Yeah, I have. I apologize if it seemed I was taking
credit for anything.

>>>cross-gdb configured using: 
>>>
>>>configure --prefix=/usr --target=mipsel-linux --disable-sim
>>>--disable-tcl --enable-threads --enable-shared
>>>
>>
>>Use '--target=mips-linux' and you'll be better off. Don't worry, it
>>will support both endians.
> 
> 
> Except for this one - where'd that come from?  It should make no
> functional difference either way, at least assuming you always give GDB
> a binary.
>
I got some weird errors (unfortunately I can't remember) if I tried
using 'mipsel-linux' as the target. So you're saying that a gdb
configured for 'mipsel-linux' or 'mips-linux' should work the same?
Thanks Daniel.

-Steve

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

* Re: cannot debug multi-threaded programs with gdb/gdbserver
  2002-09-17 19:46     ` Steven J. Hill
@ 2002-09-17 20:47       ` Daniel Jacobowitz
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2002-09-17 20:47 UTC (permalink / raw)
  To: Steven J. Hill; +Cc: Stuart Hughes, Linux-MIPS

On Tue, Sep 17, 2002 at 02:46:29PM -0500, Steven J. Hill wrote:
> Daniel Jacobowitz wrote:
> >On Tue, Sep 17, 2002 at 12:24:14PM -0500, Steven J. Hill wrote:
> >
> >Steve, have you started memorizing my responses again? :)
> >
> *gurgle* Yeah, I have. I apologize if it seemed I was taking
> credit for anything.
> 
> >>>cross-gdb configured using: 
> >>>
> >>>configure --prefix=/usr --target=mipsel-linux --disable-sim
> >>>--disable-tcl --enable-threads --enable-shared
> >>>
> >>
> >>Use '--target=mips-linux' and you'll be better off. Don't worry, it
> >>will support both endians.
> >
> >
> >Except for this one - where'd that come from?  It should make no
> >functional difference either way, at least assuming you always give GDB
> >a binary.
> >
> I got some weird errors (unfortunately I can't remember) if I tried
> using 'mipsel-linux' as the target. So you're saying that a gdb
> configured for 'mipsel-linux' or 'mips-linux' should work the same?
> Thanks Daniel.

Hmm, if you can reproduce these let me know what they are.  I use a
mipsel GDB regularly.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

* Re: cannot debug multi-threaded programs with gdb/gdbserver
  2002-09-17 18:25   ` Daniel Jacobowitz
  2002-09-17 19:46     ` Steven J. Hill
@ 2002-09-18  7:48     ` Stuart Hughes
  1 sibling, 0 replies; 8+ messages in thread
From: Stuart Hughes @ 2002-09-18  7:48 UTC (permalink / raw)
  To: Linux-MIPS

Hi Steve/Daniel,

Thanks very much for your help ! I've now got a few days "homework" to
try out :-)

Regards, Stuart


Daniel Jacobowitz wrote:
> 
> On Tue, Sep 17, 2002 at 12:24:14PM -0500, Steven J. Hill wrote:
> > Stuart Hughes wrote:
> > >
> > >Does anyone know whether there is some special setup needed on
> > >gdb/gdbserver to use the multi-threaded gdbserver ??
> > >
> > Wow, there are so many things to tell you...where to start...
> 
> Steve, have you started memorizing my responses again? :)
> 
> > >My environment is as follows:
> > >
> > >CPU:         NEC VR5432
> > >kernel:      linux-2.4.18 + patches
> > >glibc:               2.2.3 + patches
> > >gdb:         5.2/3 from CVS
> > >
> > Has to be the gdb-5.3 branch...go look at http://sources.redhat.com/gdb
> >
> > >gcc:         3.1
> > >binutils:    Version 2.11.90.0.25
> > >
> > Don't use H.J. Lu's binutils, use the released one. Use gcc-3.2 and
> > binutils-2.13 as they have fixes for the MIPS debugging symbols with
> > regards to DWARF.
> >
> > >cross-gdb configured using:
> > >
> > >configure --prefix=/usr --target=mipsel-linux --disable-sim
> > >--disable-tcl --enable-threads --enable-shared
> > >
> > Use '--target=mips-linux' and you'll be better off. Don't worry, it
> > will support both endians.
> 
> Except for this one - where'd that come from?  It should make no
> functional difference either way, at least assuming you always give GDB
> a binary.
> 
> > >gdbserver configured using:
> > >
> > >configure --prefix=/usr --host=mipsel-linux --target=mipsel-linux
> > >--enable-threads --enable-shared
> > >
> > I would also try 'CC=mipsel-linux-gcc configure <...>'.
> 
> Definitely.
> 
> --
> Daniel Jacobowitz
> MontaVista Software                         Debian GNU/Linux Developer

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

* Re: cannot debug multi-threaded programs with gdb/gdbserver
  2002-09-17 17:24 ` Steven J. Hill
  2002-09-17 18:25   ` Daniel Jacobowitz
@ 2002-09-18 12:10   ` Johannes Stezenbach
  2002-09-18 13:23     ` Daniel Jacobowitz
  1 sibling, 1 reply; 8+ messages in thread
From: Johannes Stezenbach @ 2002-09-18 12:10 UTC (permalink / raw)
  To: Steven J. Hill; +Cc: Stuart Hughes, Linux-MIPS

Steven J. Hill wrote:
> Stuart Hughes wrote:
> >
> >Does anyone know whether there is some special setup needed on
> >gdb/gdbserver to use the multi-threaded gdbserver ??
...
> >binutils:	Version 2.11.90.0.25
> >
> Don't use H.J. Lu's binutils, use the released one. Use gcc-3.2 and
> binutils-2.13 as they have fixes for the MIPS debugging symbols with
> regards to DWARF.

Is this a general recommendation to avoid H.J. Lu's binutils, or do
you just favor the newer binutils version?
What about binutils 2.13.90.0.4?

I'm currently using gcc-2.95.4 with the Debian patches, and
binutils binutils-2.12.90.0.14, which seem to work well.
I planned to switch to gcc-3.2 but postponed it because I
read about the DWARF debugging problems. Are they solved
with gcc-3.2 / binutils-2.13 / gdb-5.3-CVS ?


Regards,
Johannes

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

* Re: cannot debug multi-threaded programs with gdb/gdbserver
  2002-09-18 12:10   ` Johannes Stezenbach
@ 2002-09-18 13:23     ` Daniel Jacobowitz
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2002-09-18 13:23 UTC (permalink / raw)
  To: Johannes Stezenbach; +Cc: Steven J. Hill, Stuart Hughes, Linux-MIPS

On Wed, Sep 18, 2002 at 02:10:47PM +0200, Johannes Stezenbach wrote:
> Steven J. Hill wrote:
> > Stuart Hughes wrote:
> > >
> > >Does anyone know whether there is some special setup needed on
> > >gdb/gdbserver to use the multi-threaded gdbserver ??
> ...
> > >binutils:	Version 2.11.90.0.25
> > >
> > Don't use H.J. Lu's binutils, use the released one. Use gcc-3.2 and
> > binutils-2.13 as they have fixes for the MIPS debugging symbols with
> > regards to DWARF.
> 
> Is this a general recommendation to avoid H.J. Lu's binutils, or do
> you just favor the newer binutils version?
> What about binutils 2.13.90.0.4?
> 
> I'm currently using gcc-2.95.4 with the Debian patches, and
> binutils binutils-2.12.90.0.14, which seem to work well.
> I planned to switch to gcc-3.2 but postponed it because I
> read about the DWARF debugging problems. Are they solved
> with gcc-3.2 / binutils-2.13 / gdb-5.3-CVS ?

Yes, they are fixed.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

end of thread, other threads:[~2002-09-18 13:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-17 17:03 cannot debug multi-threaded programs with gdb/gdbserver Stuart Hughes
2002-09-17 17:24 ` Steven J. Hill
2002-09-17 18:25   ` Daniel Jacobowitz
2002-09-17 19:46     ` Steven J. Hill
2002-09-17 20:47       ` Daniel Jacobowitz
2002-09-18  7:48     ` Stuart Hughes
2002-09-18 12:10   ` Johannes Stezenbach
2002-09-18 13:23     ` Daniel Jacobowitz

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