This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch+7.8?] Fix 'gcore' with exited threads
- From: Pedro Alves <palves at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 21 Aug 2014 12:32:57 +0100
- Subject: Re: [patch+7.8?] Fix 'gcore' with exited threads
- Authentication-results: sourceware.org; auth=none
- References: <20140609203020 dot GA22447 at host2 dot jankratochvil dot net> <53A8427D dot 6070902 at redhat dot com> <20140817211647 dot GA17152 at host2 dot jankratochvil dot net>
On 08/17/2014 10:16 PM, Jan Kratochvil wrote:
> On Mon, 23 Jun 2014 17:06:37 +0200, Pedro Alves wrote:
>> > On 06/09/2014 09:30 PM, Jan Kratochvil wrote:
>
>>> > > Without the TRY_CATCH protection testsuite FAILs for:
>>> > > FAIL: gdb.threads/gcore-thread.exp: save a zeroed-threads corefile
>>> > > FAIL: gdb.threads/gcore-thread.exp: core0file: re-load generated corefile (bad file format)
>> >
>> > What does the log show ?
> gcore .../gdb/testsuite/gdb.threads/gcore-thread0.test^M
> Cannot find new threads: debugger service failed^M
> (gdb) FAIL: gdb.threads/gcore-thread.exp: save a zeroed-threads corefile
> +
> core .../gdb/testsuite/gdb.threads/gcore-thread0.test^M
> ".../gdb/testsuite/gdb.threads/gcore-thread0.test" is not a core dump: File format not recognized^M
> (gdb) FAIL: gdb.threads/gcore-thread.exp: core0file: re-load generated corefile (bad file format)
Thanks. It'd be good to have this in the commit log.
> gdb/
> 2014-08-17 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * linux-tdep.c (linux_corefile_thread_callback): Ignore THREAD_EXITED.
> (linux_make_corefile_notes): call update_thread_list, protected against
> exceptions.
>
> gdb/testsuite/
> 2014-08-17 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * gdb.threads/gcore-stale-thread.c: New file.
> * gdb.threads/gcore-stale-thread.exp: New file.
>
> diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
> index d0f1106..875f32e 100644
> --- a/gdb/linux-tdep.c
> +++ b/gdb/linux-tdep.c
> @@ -1194,6 +1194,11 @@ linux_corefile_thread_callback (struct thread_info *info, void *data)
> {
> struct linux_corefile_thread_data *args = data;
>
> + /* It can be current thread in non-stop mode
> + which cannot be removed by update_thread_list. */
Please remove the "in non-stop mode" bit. The predicate GDB
currently chooses to decide whether to switch to another thread
or not is "non-stop", but that's bogus and will change (it should
be foreground vs background command), and then this comment will
most likely end up stale.
> +# This file was written by Michael Snyder (msnyder@redhat.com)
> +# This is a test for the gdb command "generate-core-file".
This paragraph is stale.
Otherwise OK.
Thanks!
IMO, this is good for 7.8.
Pedro Alves