[RFA/commit] Add support for DEC threads on alpha-osf

Pedro Alves pedro@codesourcery.com
Tue Oct 7 15:19:00 GMT 2008


On Tuesday 07 October 2008 16:01:54, Joel Brobecker wrote:
> Thanks for the quick feedback!
> 
> > Hmmm, procfs.c.  It looks weird that LWP 3 and the main process are
> > the same thing.  If they are the same, and I haven't messed something up,
> > you should only see one of them.  IIRC, I don't get that on solaris.
> 
> How does it work (to determine whether the process and the LWP are
> the same)? I could probably take a look. Not sure whether I could
> help much, though.

Maybe here:

procfs_init_inferior:
...
  /* We now have have access to the lwpid of the main thread/lwp.  */
  lwpid = proc_get_current_thread (pi);

  /* Create a procinfo for the main lwp.  */
  create_procinfo (pid, lwpid);

  /* We already have a main thread registered in the thread table at
     this point, but it didn't have any lwp info yet.  Notify the core
     about it.  This changes inferior_ptid as well.  */
  thread_change_ptid (pid_to_ptid (pid),
		      MERGEPID (pid, lwpid));

... maybe proc_get_current_thread returns 0, and then later on in
procfs_wait we're adding the main thread again, but then with an
lwp id already.  But what sounded very strange is that the LWP is
number 3, not 1.

> I don't mind having a quick 
> look if it's not too time-consuming.  What do you think?

It's certainly fine the way it is to me, just an annoyance.  I'm happy
to find out that we don't crash in this situation, so thanks
for that.  :-)

-- 
Pedro Alves



More information about the Gdb-patches mailing list