Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "John Hughes" <john@Calva.COM>
To: "Kevin Buettner" <kevinb@cygnus.com>, <gdb@sourceware.cygnus.com>
Subject: RE: When is a tid a lwp and vice versa?
Date: Wed, 04 Jul 2001 01:54:00 -0000	[thread overview]
Message-ID: <CDENKKMHIFMALMCCKPCFAEEMCAAA.john@Calva.COM> (raw)
In-Reply-To: <1010703175044.ZM25944@ocotillo.lan>

> When I first read your message, it seemed to me that perhaps some code
> somewhere was getting these confused.  I've looked over
> config/i386/tm-i386v42mp.h but don't see a problem though.

Yeah, my fault, I misunderstood what was going on.

> Anyway...  it would be a tremendous help if you could figure out why
> (and how) the lwp component of inferior_ptid is getting set to 1.
> Also, it would be useful to know what the tid value is in this
> circumstance.

Ok, here we go...

In procfs_init_inferior we have:

  if ((pi = create_procinfo (pid, 0)) == NULL)
    perror ("procfs: out of memory in 'init_inferior'");

so we make a procinfo with pid = pid and tid = 0

but later on we say:

  /* The 'process ID' we return to GDB is composed of
     the actual process ID plus the lwp ID. */
  inferior_ptid = MERGEPID (pi->pid, proc_get_current_thread (pi));

and proc_get_current_thread has:

  if (!pi->status_valid)
    if (!proc_get_status (pi))
      return 0;
  return pi->prstatus.pr_lwp.pr_lwpid;

The lwpid is 1, not zero, of course.

so the "lwp" field in inferior_ptid is now 1.  (tid is zero).

eventualy we call procfs_resume with inferior_ptid and then we do:

     if (PIDGET (ptid) != -1)
       {
         /* Resume a specific thread, presumably suppressing the others. */
         thread = find_procinfo (PIDGET (ptid), TIDGET (ptid));
         if (thread == NULL)
           warning ("procfs: resume can't find thread %ld -- resuming all.",
                    TIDGET (ptid));

Which prints the ugly message.


       reply	other threads:[~2001-07-04  1:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1010703175044.ZM25944@ocotillo.lan>
2001-07-04  1:54 ` John Hughes [this message]
2001-07-06  8:50   ` Kevin Buettner
2001-07-06 14:23     ` Michael Snyder
2001-07-08  2:22     ` John Hughes
2001-06-29  1:52 John Hughes
2001-06-29  3:33 ` John Hughes

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=CDENKKMHIFMALMCCKPCFAEEMCAAA.john@Calva.COM \
    --to=john@calva.com \
    --cc=gdb@sourceware.cygnus.com \
    --cc=kevinb@cygnus.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