From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id sUkFENWZZ2o+eTAAWB0awg (envelope-from ) for ; Mon, 27 Jul 2026 13:48:05 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=yahoo.de header.i=@yahoo.de header.a=rsa-sha256 header.s=s2048 header.b=r2+1jtJv; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3D6E41E09E; Mon, 27 Jul 2026 13:48:05 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8AE491E033 for ; Mon, 27 Jul 2026 13:48:04 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5B9184BB1C07 for ; Mon, 27 Jul 2026 17:48:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B9184BB1C07 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=yahoo.de header.i=@yahoo.de header.a=rsa-sha256 header.s=s2048 header.b=r2+1jtJv Received: from sonic309-25.consmr.mail.ir2.yahoo.com (sonic309-25.consmr.mail.ir2.yahoo.com [77.238.179.83]) by sourceware.org (Postfix) with ESMTPS id A96BA4B99F60 for ; Mon, 27 Jul 2026 17:46:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A96BA4B99F60 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=yahoo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yahoo.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A96BA4B99F60 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=77.238.179.83 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785174390; cv=none; b=ReWsZcL1NhKreRCQUSYyWGzPig9vRR+HfwrsZpKiLGQ2FofdJ9ZD2v5SSGha1jj7EzR4jwjqPoMoOCjpe91f8pnQQ/lMkM0tjEPfiqF+KelAtohrchnZSG1JJPDS4Az65QXY8aJLMn85Oc4ztfMjFcQgCi/ltzDDsl1laCNw484= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785174390; c=relaxed/simple; bh=48vXdMrmY1aI0oBdF2Z/6RmF6F17hoKBq4civrJipj8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=xr+1lZYZEfKi1H0bX5ce+ZlGlFf854GhaoWNgjAQkNFY15gUUMNQ/VbHTWVEY8WQ1e26NibtvE0HvNMzSdXSRCk3sdtBopzmNF2/uGkqWX01exKbljocQjg3p6GRZxA9l3YsBo7jO9n4rmkxGmbZGxR83C0HYDedfh9lgi2ALmM= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=yahoo.de header.i=@yahoo.de header.a=rsa-sha256 header.s=s2048 header.b=r2+1jtJv DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A96BA4B99F60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1785174389; bh=1kJldi5EGnZi3m60eLdytwSpJjWFF0rh05rB9vrYTAE=; h=From:To:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=r2+1jtJvjC2weP6cT+hF0oCVnrkS7zO6m5CDomahVFkZ1JxKtAAuBNpQelS8XNVaasgoE9CyqoA23rOhSKKJK/LEb17gTQw02Le6pt/bKwhKp3zHu8gNrHnsXxVc3OCNiXAZTFjHtkm66XLQersaTV0gl7CYBUANL71FTUINnGZc6D6vUsLoepzJdQsd6ipTKrTSJ+56nxqb7Qxnny1sTogPwpn5yo9h6GojvI2kFvz5Vx5TXU/TMxBGpeLJAPjXCNtzkcVucia4Lxc6i1wwenycoEachF3ZSDW+KkBUXd0pmfZ/mD3sE8cAHfxFiztHcTQEOUlR+/xQlTDrSwitWQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1785174389; bh=1weO0dNumQ01PfPxAjDhly2jKKn5a4+oAKv0p6gDnFS=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=DMWYORt3CrEZDtqKRSRhiL34ePHq6iPoaEd6pNeeOGSksW6rq6kV4i9O9mR1LMqSxryplJ16B60xsNe0i2eyULk91ybFD1i7H6fRMz/+Pbiub/lYih/ndX+610IB1c4C13YFNIbrctmc0Sh1ULfaRZTMNKCiEtmlGyCTNCexWeDDS+D8h2ruu6mAdj9HjKzKgQ38lQM4eZpBvDMTmANyisGcOCshxUXfBU+FItU5IxBYov4O3FDbjdqVGt3mrAmLcqInwRMgCsc7mY5z5gHzCvSVIn0MbfQRZYgx79W07M1MbaGeYS97jEDrtyJI28GlKQtwsXHXER0O0vFi1VXZcg== X-YMail-OSG: VRwZrCMVM1kU8xrBJH48bcevf6ibIxU7WiskKeb.AzNqcccK96z2peh5UvIgPrn W0Uj7_aTZVeOEd_SPMP2EEAEAk4XDqAHtiHbfxBIjI7VfGKrGb6xMdwtSEG1LKcYNFE5uKhqb60k jb_WA0XX_VViJClZ_DOAPNY07yhfzClmOtExuq.Cp.GFg8Ak1SdsZ1erdvli5Bhwe7XlAVw3kHVH IIyg.h4EjLoxOmiph_eoAEXLdrPsVyinhkHUe3mmNFLLaYaUrjQQ6BhXFatOW542rzXYBDUzS_7G mzM4RiX08vV.as8WFOJvj10jNxd2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PTxKPmBrqirhqkcZ_2wxAEc Km0NUGk0Na8LLXXWk6POd.VdnmlceZdICklnDqAPH1fSOprqyXoyNZi20cOG92lmQIGJL26bsO79 iSLkwzzQhhUjPKvmcCdlRJbMNTFe4xEBC6Y87HemRsXw0JKe1JoQKfpO.56IgnaFlh5lb82Zou5W Q3bylCNOtPLZlH3xDdztA2hCRZlLTm9syOmUicq_lTtaUPqoPPjlyCoxD2eyUz8HXKYEPWAIaB_G mEQj.ILuxR_d1IKYwosO0m9DA24A.BfVr1LWjUna0axPerP3c9jUl48YTHNhFMPYwfAxxqsNCszm PnXRgwi75YC9lR0.22Vo7h2PRN38ItjhK4WjZvvkUXUEUppSC6drhuvIQLgXlC3sQUcyd5lX6nCV qFVPNZDzMwzfaYuAdpJ31Gurdq5R7Zf9_FAuv93bEJ1nuSSGtdHmUmmnhTJlkqJGuAkni.8QvKDr WZ8P2LuBCnvdVMwgpa00.PpXly6MzF5NcTJYdu4FtA7ektU2Q8kOx2_InNQgF1WzBFCjg24XTZBP C0EVlqTiLrfmpVVW.spgZA4.zuU8zRUlWbKplhDte2lnxMg2_nKyVWpWLkIDw8lr7yxAxKwDGkw3 haLuAILZvCfgZh.a.UW7RUn6zzEuVgKhfPCSfruMFWDqbwuHvwElqR3T_S.ly0Kp8J4lIVyHzQZB hC6UZUDYOPo2ZXeVLHuw0A5vnbXcvD3qqdExrp5OWkFObsHe_JvFb6.e6Xz77_bmMMCaI8jcuUWH miplZUp4uvNU25NqYFcbJjhAfT85z.Ugv6r1VJqicw81EcmwmB6.ngV6b366Icv56_92y3coNJsy yoSm3jAmCQkD0djhnPfzv X-Sonic-MF: X-Sonic-ID: d2c37049-6d20-487f-a450-aabf73337f4a Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ir2.yahoo.com with HTTP; Mon, 27 Jul 2026 17:46:29 +0000 Received: by hermes--production-ir2-676cb4d88b-rslc6 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 0669d8fa15a3c4ff66838ce4fae4c373; Mon, 27 Jul 2026 17:46:24 +0000 (UTC) From: Hannes Domani To: gdb-patches@sourceware.org Subject: [PATCH v2 3/8] Windows gdb: Remove mappings member from windows_per_inferior Date: Mon, 27 Jul 2026 19:42:27 +0200 Message-ID: <20260727174619.1089041-3-ssbssa@yahoo.de> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260727174619.1089041-1-ssbssa@yahoo.de> References: <20260727174619.1089041-1-ssbssa@yahoo.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org It's not really that useful, and simplifies later XState changes. --- gdb/aarch64-windows-nat.c | 6 ++---- gdb/windows-nat.h | 18 ------------------ gdb/x86-windows-nat.c | 34 ++++++++++++++++++++++------------ 3 files changed, 24 insertions(+), 34 deletions(-) diff --git a/gdb/aarch64-windows-nat.c b/gdb/aarch64-windows-nat.c index 630704a8caf..be900439047 100644 --- a/gdb/aarch64-windows-nat.c +++ b/gdb/aarch64-windows-nat.c @@ -168,8 +168,6 @@ aarch64_windows_nat_target::initialize_windows_arch (bool attaching) { memset (&aarch64_windows_process.dr_state, 0, sizeof (aarch64_windows_process.dr_state)); - - aarch64_windows_process.mappings = aarch64_mappings; } /* See windows-nat.h. */ @@ -264,7 +262,7 @@ aarch64_windows_nat_target::fetch_one_register (struct regcache *regcache, gdb_assert (r >= 0); char *context_ptr = (char *) th->context; - char *context_offset = context_ptr + aarch64_windows_process.mappings[r]; + char *context_offset = context_ptr + aarch64_mappings[r]; struct gdbarch *gdbarch = regcache->arch (); gdb_assert (!gdbarch_read_pc_p (gdbarch)); @@ -296,7 +294,7 @@ aarch64_windows_nat_target::store_one_register (const struct regcache *regcache, char *context_ptr = (char *) th->context; - regcache->raw_collect (r, context_ptr + aarch64_windows_process.mappings[r]); + regcache->raw_collect (r, context_ptr + aarch64_mappings[r]); } /* See windows-nat.h. */ diff --git a/gdb/windows-nat.h b/gdb/windows-nat.h index 3349755022b..d6977ff4c85 100644 --- a/gdb/windows-nat.h +++ b/gdb/windows-nat.h @@ -139,24 +139,6 @@ struct windows_per_inferior : public windows_nat::windows_process_info void *wow64_dbgbreak = nullptr; #endif - /* This vector maps GDB's idea of a register's number into an offset - in the windows exception context vector. - - It also contains the bit mask needed to load the register in question. - - The contents of this table can only be computed by the units - that provide CPU-specific support for Windows native debugging. - - One day we could read a reg, we could inspect the context we - already have loaded, if it doesn't have the bit set that we need, - we read that set of registers in using GetThreadContext. If the - context already contains what we need, we just unpack it. Then to - write a register, first we have to ensure that the context contains - the other regs of the group, and then we copy the info in and set - out bit. */ - - const int *mappings = nullptr; - std::vector solibs; #ifdef __CYGWIN__ diff --git a/gdb/x86-windows-nat.c b/gdb/x86-windows-nat.c index 2f556e47b39..b3ad8594020 100644 --- a/gdb/x86-windows-nat.c +++ b/gdb/x86-windows-nat.c @@ -85,16 +85,10 @@ x86_windows_nat_target::initialize_windows_arch (bool attaching) = !attaching && x86_windows_process.wow64_process; if (!x86_windows_process.wow64_process) - { - x86_windows_process.mappings = amd64_mappings; - x86_windows_process.segment_register_p = amd64_windows_segment_register_p; - } + x86_windows_process.segment_register_p = amd64_windows_segment_register_p; else #endif - { - x86_windows_process.mappings = i386_mappings; - x86_windows_process.segment_register_p = i386_windows_segment_register_p; - } + x86_windows_process.segment_register_p = i386_windows_segment_register_p; } /* See windows-nat.h. */ @@ -242,7 +236,15 @@ x86_windows_nat_target::fetch_one_register (struct regcache *regcache, return (char *) context; }); - char *context_offset = context_ptr + x86_windows_process.mappings[r]; + const int *mappings; +#ifdef __x86_64__ + if (!x86_windows_process.wow64_process) + mappings = amd64_mappings; + else +#endif + mappings = i386_mappings; + + char *context_offset = context_ptr + mappings[r]; struct gdbarch *gdbarch = regcache->arch (); i386_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -308,6 +310,14 @@ x86_windows_nat_target::store_one_register (const struct regcache *regcache, return (char *) context; }); + const int *mappings; +#ifdef __x86_64__ + if (!x86_windows_process.wow64_process) + mappings = amd64_mappings; + else +#endif + mappings = i386_mappings; + struct gdbarch *gdbarch = regcache->arch (); i386_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -319,7 +329,7 @@ x86_windows_nat_target::store_one_register (const struct regcache *regcache, { gdb_byte bytes[4]; regcache->raw_collect (r, bytes); - memcpy (context_ptr + x86_windows_process.mappings[r], bytes, 2); + memcpy (context_ptr + mappings[r], bytes, 2); } else if (r == I387_FOP_REGNUM (tdep)) { @@ -328,10 +338,10 @@ x86_windows_nat_target::store_one_register (const struct regcache *regcache, /* The value of FOP occupies the top two bytes in the context, so write the two low-order bytes from the cache into the appropriate spot. */ - memcpy (context_ptr + x86_windows_process.mappings[r] + 2, bytes, 2); + memcpy (context_ptr + mappings[r] + 2, bytes, 2); } else - regcache->raw_collect (r, context_ptr + x86_windows_process.mappings[r]); + regcache->raw_collect (r, context_ptr + mappings[r]); } /* See windows-nat.h. */ -- 2.54.0