Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* how can I dump out thread informations in gdb
@ 2008-10-22 20:02 ying lcs
  2008-10-22 20:05 ` Paul Pluzhnikov
  2008-10-22 20:06 ` Joel Brobecker
  0 siblings, 2 replies; 5+ messages in thread
From: ying lcs @ 2008-10-22 20:02 UTC (permalink / raw)
  To: gdb

Hi,

Can you please tell me how can I print out what are all the existing
threads in my programs (while I hit a breakpoint)?
And what are the stack trace of each of those threads?

Thank you.


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

* Re: how can I dump out thread informations in gdb
  2008-10-22 20:02 how can I dump out thread informations in gdb ying lcs
@ 2008-10-22 20:05 ` Paul Pluzhnikov
  2008-10-22 20:14   ` Bradshaw, James
  2008-10-22 20:06 ` Joel Brobecker
  1 sibling, 1 reply; 5+ messages in thread
From: Paul Pluzhnikov @ 2008-10-22 20:05 UTC (permalink / raw)
  To: ying lcs; +Cc: gdb

On Wed, Oct 22, 2008 at 1:01 PM, ying lcs <yinglcs@gmail.com> wrote:

> Can you please tell me how can I print out what are all the existing
> threads in my programs (while I hit a breakpoint)?
> And what are the stack trace of each of those threads?

RTFM?

info threads
thread apply all where

-- 
Paul Pluzhnikov


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

* Re: how can I dump out thread informations in gdb
  2008-10-22 20:02 how can I dump out thread informations in gdb ying lcs
  2008-10-22 20:05 ` Paul Pluzhnikov
@ 2008-10-22 20:06 ` Joel Brobecker
  1 sibling, 0 replies; 5+ messages in thread
From: Joel Brobecker @ 2008-10-22 20:06 UTC (permalink / raw)
  To: ying lcs; +Cc: gdb

> Can you please tell me how can I print out what are all the existing
> threads in my programs (while I hit a breakpoint)?
> And what are the stack trace of each of those threads?

I really recommend that you take a look at the GDB documentation:
http://sourceware.org/gdb/current/onlinedocs/gdb_toc.html

There is a section about debugging programs with multiple threads:
http://sourceware.org/gdb/current/onlinedocs/gdb_5.html#SEC28

and also a section about how to get a backtrace:
http://sourceware.org/gdb/current/onlinedocs/gdb_8.html#SEC54

-- 
Joel


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

* RE: how can I dump out thread informations in gdb
  2008-10-22 20:05 ` Paul Pluzhnikov
@ 2008-10-22 20:14   ` Bradshaw, James
  2008-10-23  2:30     ` Paul Pluzhnikov
  0 siblings, 1 reply; 5+ messages in thread
From: Bradshaw, James @ 2008-10-22 20:14 UTC (permalink / raw)
  To: Paul Pluzhnikov, ying lcs; +Cc: gdb

And when "info threads" gives the incorrect information, how exactly do we address that problem? I gather from earlier posts, libthread_db on the target must not be stripped in order to correctly view threads--at least on linux targets that have nptl support. Is that the only requirement?

-----Original Message-----
From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On Behalf Of Paul Pluzhnikov
Sent: Wednesday, October 22, 2008 4:04 PM
To: ying lcs
Cc: gdb@sourceware.org
Subject: Re: how can I dump out thread informations in gdb

On Wed, Oct 22, 2008 at 1:01 PM, ying lcs <yinglcs@gmail.com> wrote:

> Can you please tell me how can I print out what are all the existing
> threads in my programs (while I hit a breakpoint)?
> And what are the stack trace of each of those threads?

RTFM?

info threads
thread apply all where

--
Paul Pluzhnikov


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

* Re: how can I dump out thread informations in gdb
  2008-10-22 20:14   ` Bradshaw, James
@ 2008-10-23  2:30     ` Paul Pluzhnikov
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Pluzhnikov @ 2008-10-23  2:30 UTC (permalink / raw)
  To: Bradshaw, James; +Cc: ying lcs, gdb

On Wed, Oct 22, 2008 at 1:13 PM, Bradshaw, James <jbradsha@enterasys.com> wrote:

> And when "info threads" gives the incorrect information, how exactly
> do we address that problem?

OP gave no indication that he gets incorrect information.

> I gather from earlier posts, libthread_db
> on the target must not be stripped in order to correctly view threads

That is incorrect. AFAICT, libthread_db may be stripped
(it must have dynamic symbol table intact; but strip normally
doesn't touch dynamic symbol table anyway).

However, on Linux libpthread.so.0 itself must not be stripped,
or libthread_db will refuse to work with it.

> at least on linux targets that have nptl support.

Same applies to LinuxThreads.

> Is that the only requirement?

No: libthread_db.so.1 must match libpthread.so.0 (both must
come from the same version of glibc).

-- 
Paul Pluzhnikov


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

end of thread, other threads:[~2008-10-23  2:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-22 20:02 how can I dump out thread informations in gdb ying lcs
2008-10-22 20:05 ` Paul Pluzhnikov
2008-10-22 20:14   ` Bradshaw, James
2008-10-23  2:30     ` Paul Pluzhnikov
2008-10-22 20:06 ` Joel Brobecker

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