From nobody Tue Nov 26 08:43:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1709463136; cv=none; d=zohomail.com; s=zohoarc; b=G/6JWGZgvAGB25SFHbqIxkKz2VpgLX2EYatYsRc2eFXCapFXkAu/oHXvWefR0DxeqfuoXocI6fPrTEh82WW30UFXgwfcqr+QZTtLAyJvYGawBZCch6g9KNkD7bw3WuTCz3JiEEp5EDxXQ+utDt6vVeNWXjbjf1ti+qc0P6X3dUc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709463136; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ItPC9lAeHcpFUfTU9c6xUSLUEP8u71tkDj/Uzspnk/A=; b=Lou+UTqVSAMmhxYcwImKQ8QxrsVzlosR+AT0qaNrXxycHcmZ51IMwtZ3NjGsb8Qw32QbzVdHst2U1H+OxV531/M9+3JilGoyv0cXRpV9s+YxbBaNIr0F42sEQIvMRnB5SmYqr8jwEHwo9PJmhld/Okgb5iJQkXqaU0+kZbV9zU4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709463136891722.8615195192748; Sun, 3 Mar 2024 02:52:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgjRZ-0002Mi-Mo; Sun, 03 Mar 2024 05:51:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rgjRY-0002MX-H5 for qemu-devel@nongnu.org; Sun, 03 Mar 2024 05:51:44 -0500 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgjRJ-0001yy-2T for qemu-devel@nongnu.org; Sun, 03 Mar 2024 05:51:44 -0500 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5cddfe0cb64so2608113a12.0 for ; Sun, 03 Mar 2024 02:51:28 -0800 (PST) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id t18-20020a170902d21200b001dca6d1d574sm6425979ply.302.2024.03.03.02.51.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Mar 2024 02:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1709463088; x=1710067888; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ItPC9lAeHcpFUfTU9c6xUSLUEP8u71tkDj/Uzspnk/A=; b=WSa1u5dpR4aT63L6lq6kSm3K46aBpx3G7zSak+RGE7Bd5Zpqa86d3B/cGBszjee5HX M55PyXbV6sOT5iKMoOxeFsZ0dQsLeEydA/5bFTohXuPHu2wONWqNkz6nbrtNgNZJbysb oYrc2QOcRFnH425+OxjA9rhxAs0mdTKf8PbRsTDNY3XtbkpfGcNiuEtYqcfORUvhyoiv xaqwW6S1TVXW4MxEKIax0HNtPqjj3aXCu1uOkNUL1JLYOiBun/5XNJI360S7lNuhsbNB 2AEtxPpq74JQrwTnD/O4qlyiffUGbogvzheHWyhwa+FMJkaoAMvb2Qy+O0VlUS8d9/zg HzqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709463088; x=1710067888; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ItPC9lAeHcpFUfTU9c6xUSLUEP8u71tkDj/Uzspnk/A=; b=SMCX2FYxvrVaj/sehw6fyhz8FCh1KJuwXYuOx8scMnzmLnB9ivfhY65ZTMtZs0ewip eCRyPkBuC6ATpsNT+cMi+s25i9dl7qQaBga4jSXGEI6wSV1n77WKtSFRludvTgGimPOs E1M07o564cpHREL9YODxu3OBumNiIPglCwtIFpJcckhXFyd4ssMLaET0KfHTTby34bTU DEdaeIX9gKQ2UalvO9iyjqgFAnONmbLNP/6iZ8YQ8Zi0TBk07OJsZgOJw95zM70uxfV6 Lhx1OMoLnxzvLpWUAfmxTlC5QfW3syL7iPecBNpRC+OjUKc3SgniaKR5VsMKWMf0pVqG rkmw== X-Gm-Message-State: AOJu0Yy1LzHOU742SfiJomHyWS2GLUCD88WOl9sy+IEXnd9XP0h7Bpbt vHsOyq8O8xwwwyY88Nip0eLsBs4PjzYjA/arzOewfZdbEzRto4PFk+XP9cqRZUh3XtVZdQYf/6S i X-Google-Smtp-Source: AGHT+IFC3GSWO77KFoKsE5qQ3U/0awI71A/bNluNpt6+9YHligzjb40Lr5A+1BCyiEfRysXy7N6WXQ== X-Received: by 2002:a17:903:124a:b0:1dc:63b2:7c2e with SMTP id u10-20020a170903124a00b001dc63b27c2emr7382395plh.31.1709463087802; Sun, 03 Mar 2024 02:51:27 -0800 (PST) From: Akihiko Odaki Date: Sun, 03 Mar 2024 19:50:40 +0900 Subject: [PATCH 6/7] contrib/elf2dmp: Continue even contexts are lacking MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240303-elf2dmp-v1-6-bea6649fe3e6@daynix.com> References: <20240303-elf2dmp-v1-0-bea6649fe3e6@daynix.com> In-Reply-To: <20240303-elf2dmp-v1-0-bea6649fe3e6@daynix.com> To: Viktor Prutyanov Cc: qemu-devel@nongnu.org, Akihiko Odaki X-Mailer: b4 0.12.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::52a; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52a.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1709463137619100003 Contexts of some CPUs may be lacking or corrupted due to premature boot, but the output may still contain valuable information of other CPUs and memory. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell --- contrib/elf2dmp/main.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c index 432f8629f321..33066310b9fa 100644 --- a/contrib/elf2dmp/main.c +++ b/contrib/elf2dmp/main.c @@ -332,7 +332,7 @@ static int fill_header(WinDumpHeader64 *hdr, struct pa_= space *ps, return 0; } =20 -static int fill_context(KDDEBUGGER_DATA64 *kdbg, +static void fill_context(KDDEBUGGER_DATA64 *kdbg, struct va_space *vs, QEMU_Elf *qe) { int i; @@ -346,7 +346,7 @@ static int fill_context(KDDEBUGGER_DATA64 *kdbg, if (va_space_rw(vs, kdbg->KiProcessorBlock + sizeof(Prcb) * i, &Prcb, sizeof(Prcb), 0)) { eprintf("Failed to read CPU #%d PRCB location\n", i); - return 1; + continue; } =20 if (!Prcb) { @@ -357,7 +357,7 @@ static int fill_context(KDDEBUGGER_DATA64 *kdbg, if (va_space_rw(vs, Prcb + kdbg->OffsetPrcbContext, &Context, sizeof(Context), 0)) { eprintf("Failed to read CPU #%d ContextFrame location\n", i); - return 1; + continue; } =20 printf("Filling context for CPU #%d...\n", i); @@ -365,11 +365,9 @@ static int fill_context(KDDEBUGGER_DATA64 *kdbg, =20 if (va_space_rw(vs, Context, &ctx, sizeof(ctx), 1)) { eprintf("Failed to fill CPU #%d context\n", i); - return 1; + continue; } } - - return 0; } =20 static int pe_get_data_dir_entry(uint64_t base, void *start_addr, int idx, @@ -624,10 +622,7 @@ int main(int argc, char *argv[]) goto out_kdbg; } =20 - if (fill_context(kdbg, &vs, &qemu_elf)) { - err =3D 1; - goto out_kdbg; - } + fill_context(kdbg, &vs, &qemu_elf); =20 if (write_dump(&ps, &header, argv[2])) { eprintf("Failed to save dump\n"); --=20 2.44.0