From: Pedro Alves <pedro@codesourcery.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org, Doug Evans <dje@google.com>
Subject: Re: [patch] Workaround for 10970, 12702, avoid calling waitpid
Date: Wed, 18 May 2011 19:53:00 -0000 [thread overview]
Message-ID: <201105182052.57287.pedro@codesourcery.com> (raw)
In-Reply-To: <20110518193226.GA14601@host1.jankratochvil.net>
On Wednesday 18 May 2011 20:32:26, Jan Kratochvil wrote:
> On Wed, 18 May 2011 21:17:21 +0200, Pedro Alves wrote:
> > When the last lwp exits, we'll report it's exit code as the
> > inferior exit code to infrun, instead of the leader's exit
> > code.
>
> Which is correct, isn't it?
>
> $ ./groupexit; echo $?
> 5
Ah, good. I didn't think of _exit... Thanks.
>
> (gdb) run
> Starting program: /home/jkratoch/t/groupexit
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib64/libthread_db.so.1".
> [New Thread 0x7ffff7822700 (LWP 18087)]
> [Thread 0x7ffff7822700 (LWP 18087) exited]
> [Inferior 1 (process 18084) exited with code 05]
>
>
> Thanks,
> Jan
>
>
> #include <pthread.h>
> #include <assert.h>
> #include <unistd.h>
> static void *start (void *arg)
> {
> sleep (1);
> _exit (5);
> return arg;
> }
> int main (void)
> {
> pthread_t thread1;
> int i;
> i = pthread_create (&thread1, NULL, start, NULL);
> assert (i == 0);
> pthread_exit (NULL);
> assert (0);
> return 0;
> }
>
--
Pedro Alves
next prev parent reply other threads:[~2011-05-18 19:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 18:19 Doug Evans
2011-05-17 22:08 ` Jan Kratochvil
2011-05-18 17:13 ` Jan Kratochvil
2011-05-18 18:17 ` Pedro Alves
2011-05-18 18:53 ` Jan Kratochvil
2011-05-18 19:17 ` Pedro Alves
2011-05-18 19:32 ` Jan Kratochvil
2011-05-18 19:53 ` Pedro Alves [this message]
2011-05-18 22:21 ` Doug Evans
2011-05-27 17:04 ` Jan Kratochvil
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=201105182052.57287.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.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