From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4Q+nJ5Z7U2pdNQQAWB0awg (envelope-from ) for ; Sun, 12 Jul 2026 07:33:42 -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=gpqkGs+n; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9EE8D1E070; Sun, 12 Jul 2026 07:33:42 -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 [IPv6:2620:52:6:3111::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 1294A1E070 for ; Sun, 12 Jul 2026 07:33:42 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 447314BA2E27 for ; Sun, 12 Jul 2026 11:33:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 447314BA2E27 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=gpqkGs+n Received: from sonic309-24.consmr.mail.ir2.yahoo.com (sonic309-24.consmr.mail.ir2.yahoo.com [77.238.179.82]) by sourceware.org (Postfix) with ESMTPS id 0BF134BA2E19 for ; Sun, 12 Jul 2026 11:32:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0BF134BA2E19 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 0BF134BA2E19 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=77.238.179.82 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783855967; cv=none; b=rlL0ZEsH9k1i8+mFi7PyPEgP2+Awk+91z8RhOl2vVu6CP7DN3nWS8vhJmhvyjYSbKLwL83H67HE7YdiXzbaRa6lQ7ArggxWOJFzYz7FbmA5feiCtIafVHjnBg+11B+L68wm1FB1MY7rmfdOvI+YDXLNAOA9RbHnawtP8uEBsqnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783855967; c=relaxed/simple; bh=/VOuVimIa9pclJXpVqO7rDRKVDCfexbhabFv45AkFik=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=f5MgkNUlLCYDdC9e+vqBCzVrYmbyTpYmf9sO2FN+wI9KwQP/ly4gg9eoJIlZuArU7aCU+CvhF17kfmFj74Zj7NFCTua+5FVX3mHo57f4G4sCacPV2lrjhpQCRtDpgMjplyB3zJ6rN5RgS0iDsnNHmYjyncwHvv/+ota+C5w7nks= 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=gpqkGs+n DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BF134BA2E19 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1783855959; bh=2PtxZF0Wd/4VXiETRJ3BmC074mKAeYZWblQ2bBOD+Tk=; h=From:To:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=gpqkGs+nUrJ13Md16WZIxzvv7PhpjOYfH/l7MMP7WH8ey3enT/d9iGMHPKRdDZl218of0htL8YtgOPM8pP96wOOFPrF4clahax3ByQzG+NiL2Wj46LSPg0xBv9i4J9cBWumaS8h14KVN5DPW31/0jtzWHUMS83JuydJe92lwHW+DNVANzzgO6ka9vWpfiGqXBeGFK/uj6zqYFqRHHI5wVDKJ9tv1BkA07AuxTMN4kDiDFDmGeJ4lpGIM5yUT0oHHv3giLwQKtvZX3t2FkG19Blso+tCXnyk4atIc6dXT3vQMDMn0ASvhVP1c3r/Hfm+1+fBOItUqHfW3FSPewF0S1A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783855959; bh=LsTjR6viEpC/Wd/u0B8qY/tP+MpTSLcVkIXo11+9HBg=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=sBcjYgSbBcGiZZ4ZSxt41Sps2JFiH+QgU0VDbfEm9+MVyO71LONugfiCX46ZODxE4RAXBNbkgZgrgpljp6w4v6Bxoge3FFDiZQSxScvu4NuHvZ8Ve4QmE+t7jHZVafMfqfK9ZFXknHZrqUFlGk+7VXTKZMoDMcCHcR9RveAVufYBbuUJo+TscIbnqc69yq1ID4UTvVuX7oNuwUVNS+u3w97XfR0U2Do4XUPK0SpkL501C2SQm2DCcmxqBzo5wiVknm5z/nTEyFMfrubA129C2eTP9qeJI196a9EkZrPeFReLH8XqIDkrURvR7fzLhPFB/UM0Qvn+eTB5oT10M1FcEg== X-YMail-OSG: XyJGGu8VM1lZkvXoo7Ru3wdVsIK_daQhrExwT53cGSfZSOFJb_9fsG.28D5TWza H8oK1pwWz69VBkjApFXN5SKL1Gz9x5umCE03HEoz1LZYBcwsxvDMzGiTRQiwZWGzKSu00WxO5Gjl 9EHWC6tU6h1q6iXE4j45Sud6uRN8l5ZbITkWEP0SBBfZnSYAcGK0ibhTOd_OfRgdgxU2.iWZTzGc jeJ7YoQ8Zna3TxnM0Y88hNnveoApXZL82YV7nftCCZeAcE0DsG1Wekd54EgCDYu6IsOlwC20OcIv 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zfYEqpPZZy8L7LDKG7XUSgaOHNGbXPanSvstUmKLbAYG_gYDcj5Nn0iZbeezcRu4O9W0 fiO0ywVeefIp5LIVZEiwUsdqNuYxPbFffgHxd0W_CAwzr9cXEIDYrz.Lv8RydCDq4Cu5dt__4G4Y efWciK9BXrGG4TSrLwGPvZk00WYi30cb0S8cGrbSIbm6OcnlqgY4b4dzMhUmYhZKCLQE2ljPEVOG QLc99Y18IuPHHbCTJ9CjRSMHEp.L8z4BtUqtizbH5_VYDRkLvW1EcFR_2hoeuBMtg0XRMJJdPf5a m0V4aREarj7fkTA7jlS5Zs2zigg2x5ixPayfqp42aAC0BWqI8Of1VJ6TjR1yRweCceoJ7MP3HXUR GEOztF44.5lmKQdt35SaDdKxZsZ9ryYE1KdLokBis3xP1cqBM05B_6OfhM.Esd17Wh09totPYR7e YVl11m1dNmEcy9Rjdipi1nJm8X0MiKJ884SNcw1xiof71QcH0FIp_M.dRDXoUgAeMuYI4VoS0HTL MLlU6zBN5ekV67nuk3gQQnEY_ajp06GRgSP2v_Escn6RKgq14pbbpTRtKo4We3.S6Oj80FdJEgB9 bFAhnM4xiVYevAz1PysdyrGA064J7WtwOJedG2GN6OJsBAGZ6WhBTFLhXJtZCHPVcvA7xdIK1fsm PpoRW_qKLuVCKbUe_6thixzGzCRFtL1mnl.DsqiLIBAn43TwAHI5zogWFhN7aebUapuAI7ruAeBk 6zcEpthyIqaCDd5fmSFCr2iUl.MB5fdPNbtDVmB5XbiOFk6dvgOONuMjMjfM9apa8qy7T3i3b7XW e9IQ72Zj6dq_B__vQzR7Tx00FtPwqRhhOjTKDE3T5ZX.ovlMhNbnxEcHAbgN8S90S7yRRGr3fGZd .8aVEIgTUoX9hdHPPlVG7VQ-- X-Sonic-MF: X-Sonic-ID: 82e210b2-2fb5-4e7d-a0c3-bd6937a87e29 Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ir2.yahoo.com with HTTP; Sun, 12 Jul 2026 11:32:39 +0000 Received: by hermes--production-ir2-7b48fcd765-7kk6w (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 8f842386f7843a8cccfcf644a1266621; Sun, 12 Jul 2026 11:32:39 +0000 (UTC) From: Hannes Domani To: gdb-patches@sourceware.org Subject: [PATCH 3/8] Windows gdb: Remove mappings member from windows_per_inferior Date: Sun, 12 Jul 2026 13:32:24 +0200 Message-ID: <20260712113229.3695246-3-ssbssa@yahoo.de> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260712113229.3695246-1-ssbssa@yahoo.de> References: <20260712113229.3695246-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 cbe5429fd84..d52d82c422e 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 3368814ed96..45f3872add6 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