From: Akihiko Odaki Date: Sun, 11 Jun 2023 03:34:34 +0000 (+0900) Subject: elf2dmp: Don't abandon when Prcb is set to 0 X-Git-Tag: qemu-xen-4.20.0~609^2~4 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=548b8edc6d9a5d6e1aab932f0ffcf43235c33a67;p=qemu-xen.git elf2dmp: Don't abandon when Prcb is set to 0 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 Reviewed-by: Viktor Prutyanov Message-id: 20230611033434.14659-1-akihiko.odaki@daynix.com Signed-off-by: Peter Maydell --- diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c index 89f0c69ab0..6d4d18501a 100644 --- a/contrib/elf2dmp/main.c +++ b/contrib/elf2dmp/main.c @@ -316,6 +316,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);