Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: Joel Brobecker <brobecker@gnat.com>
Cc: "Nathan J. Williams" <nathanw@wasabisystems.com>,
	gdb-patches@sources.redhat.com
Subject: Re: thread ptids when debugging from core file (x86-linux)
Date: Fri, 06 Aug 2004 19:18:00 -0000	[thread overview]
Message-ID: <4113D980.7040102@gnu.org> (raw)
In-Reply-To: <20040806175818.GR1192@gnat.com>

>>Joel, this observation of yours is the key:
>>> 
>>
>>>> >Unfortunately, that doesn't work when debugging from a core file,
>>>> >because the PTID of the threads are not the same as when debugging
>>>> >live. 
>>
>>> 
>>> The best way to appreciate this is to consider:
>>> 
>>> (gdb) attach program
>>> (gdb) info threads
>>> thread output #1
>>> (gdb) info lwp -- yes ok, that cmd doesn't exist :-)
>>> lwp output #1 (different to the thread output)
>>> (gdb) gcore program.gcore
>>> (gdb) detach
>>> Segmentation fault core dumped to program.core
>>> (gdb) corefile program.core
>>> (gdb) info threads
>>> identical thread output #2
>>> (gdb) info lwp
>>> identical lwp output #2
>>> (gdb) corefile program.gcore
>>> (gdb) info threads
>>> also identical output #3
>>> (gdb) info lwp
>>> also identical lwp output #3
> 
> 
> I am sorry, I don't understand what you are saying. What do you
> mean by "identical output #n"? What is it identical to? to output
> #1? (right now, it is not).

Yes.  ``thread output'' #1, #2, an #3 should be identical.  Similarly 
``lwp output'' 1-3 should also be identical.

The're not, its a bug (and one everyone has been trying to sweep under 
the carpet).  The corefile code should be loading libthread_db so that 
GDB can use the .reg/<LWPID> along with memory information to re-create 
the thread list.  At one stage it even did that but it was then disabled 
because it caused a core dump and ...

Andrew



      parent reply	other threads:[~2004-08-06 19:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-06  4:10 Joel Brobecker
2004-08-06  4:40 ` Nathan J. Williams
2004-08-06  5:39   ` Andrew Cagney
2004-08-06 17:58     ` Joel Brobecker
2004-08-06 18:08       ` Marcel Moolenaar
2004-08-06 18:35         ` Joel Brobecker
2004-08-06 19:10         ` Nathan J. Williams
2004-08-06 20:53           ` Marcel Moolenaar
2004-08-06 19:18       ` Andrew Cagney [this message]

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=4113D980.7040102@gnu.org \
    --to=cagney@gnu.org \
    --cc=brobecker@gnat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=nathanw@wasabisystems.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