[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] linux-user/elfload: Fix pr_pid values in core files
|
From: |
Ilya Leoshkevich |
|
Subject: |
Re: [PATCH] linux-user/elfload: Fix pr_pid values in core files |
|
Date: |
Fri, 02 Aug 2024 15:23:29 +0200 |
|
User-agent: |
Evolution 3.50.4 (3.50.4-1.fc39) |
On Fri, 2024-08-02 at 15:20 +0200, Philippe Mathieu-Daudé wrote:
> On 1/8/24 22:23, Ilya Leoshkevich wrote:
> > Analyzing qemu-produced core dumps of multi-threaded apps runs
> > into:
> >
> > (gdb) info threads
> > [...]
> > 21 Thread 0x3ff83cc0740 (LWP 9295) warning: Couldn't find
> > general-purpose registers in core file.
> > <unavailable> in ?? ()
> >
> > The reason is that all pr_pid values are the same, because the same
> > TaskState is used for all CPUs when generating NT_PRSTATUS notes.
> >
> > Fix by using TaskStates associated with individual CPUs.
> >
> > Cc: qemu-stable@nongnu.org
> > Fixes: 243c47066253 ("linux-user/elfload: Write corefile elf header
> > in one block")
>
> Isn't it
>
> Fixes: edf8e2af14 ("linux-user: implemented ELF coredump")
>
> ?
I haven't tested it, but this looks correct:
static void fill_thread_info(struct elf_note_info *info, const CPUState
*env)
{
TaskState *ts = (TaskState *)env->opaque;
> > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> > ---
> > linux-user/elfload.c | 8 +++-----
> > 1 file changed, 3 insertions(+), 5 deletions(-)
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>