]> git.ipfire.org Git - thirdparty/qemu.git/commit
linux-user/elfload: Fix pr_pid values in core files
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 1 Aug 2024 20:23:22 +0000 (22:23 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 28 Aug 2024 05:37:28 +0000 (08:37 +0300)
commitce15d843f11a89ac9f025a7c5b61b3157f72117f
tree8b1a334192493f12296523b01c9e5c3e2b0baf05
parent986e253afd885af0d727d8e38b568d581f489fbe
linux-user/elfload: Fix pr_pid values in core files

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")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240801202340.21845-1-iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
(cherry picked from commit 5b0c2742c839376b7e03c4654914aaec6a8a7b09)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
linux-user/elfload.c