qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] elf2dmp: Don't abandon when Prcb is set to 0
@ 2023-06-11  3:34 Akihiko Odaki
  2023-06-12 10:42 ` Viktor Prutyanov
  0 siblings, 1 reply; 6+ messages in thread
From: Akihiko Odaki @ 2023-06-11  3:34 UTC (permalink / raw)
  Cc: qemu-devel, Viktor Prutyanov, Akihiko Odaki

Prcb may be set to 0 for some CPUs if the dump was taken before they
start. The dump may still contain valuable information for started CPUs
so don't abandon conversion in such a case.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 contrib/elf2dmp/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c
index d77b8f98f7..91c58e4424 100644
--- a/contrib/elf2dmp/main.c
+++ b/contrib/elf2dmp/main.c
@@ -312,6 +312,11 @@ static int fill_context(KDDEBUGGER_DATA64 *kdbg,
             return 1;
         }
 
+        if (!Prcb) {
+            eprintf("Context for CPU #%d is missing\n", i);
+            continue;
+        }
+
         if (va_space_rw(vs, Prcb + kdbg->OffsetPrcbContext,
                     &Context, sizeof(Context), 0)) {
             eprintf("Failed to read CPU #%d ContextFrame location\n", i);
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-31 10:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-11  3:34 [PATCH] elf2dmp: Don't abandon when Prcb is set to 0 Akihiko Odaki
2023-06-12 10:42 ` Viktor Prutyanov
2023-06-13  0:39   ` Akihiko Odaki
2023-06-16 12:05     ` Viktor Prutyanov
2023-07-30 19:52       ` Viktor Prutyanov
2023-07-31 10:21         ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).