From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yWZ4MN7zkmrKshAAWB0awg (envelope-from ) for ; Sat, 29 Aug 2026 10:59: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=ZDV31/Q8; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BCABD1E033; Sat, 29 Aug 2026 10:59: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 779471E033 for ; Sat, 29 Aug 2026 10:59:40 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F3A144B9DB6D for ; Sat, 29 Aug 2026 14:59:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3A144B9DB6D 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=ZDV31/Q8 Received: from sonic.asd.mail.yahoo.com (sonic-euwe4-0022.asd.mail.yahoo.com [34.2.86.21]) by sourceware.org (Postfix) with ESMTPS id 47A724BA23EA for ; Sat, 29 Aug 2026 14:59:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 47A724BA23EA 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 47A724BA23EA Authentication-Results: sourceware.org; arc=none smtp.remote-ip=34.2.86.21 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788015544; cv=none; b=MaAltqSlx6CtTRYoIJuhA64ieuUtagV7Sch0NrrbaVPotapmbXmf7uTKqbk1iLGgkLzm6atgXaTrxaORLwxAW/eAHUWGMTsmQIDqmQyhw9gR18ln4ZnW5VDJ0nVcxemrtYhgf8XZlyCycfEFVqQsjMA0qewjWkfXQWdck2bDfM4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788015544; c=relaxed/simple; bh=vKlP/3UkpQ9YlzkKZGMN/lBYoXYRDP//pauU5qmZkMI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=hliH/qAofApBi1Yz0S/x72Se8nQi5arQPkjKvVaIkUzo9fFSl1C2ocWRe2/XJ8U75Pxhivh5KP6gCEEKf+lhaMetxu9WLPMc9QOxpmyBVhL1iSU8u/x5OwQnqX3x/9JG290zXiHLlz0UgHZqebS2Zz/ymTUgO9CUm+chi4wxSfY= 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=ZDV31/Q8 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47A724BA23EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1788015543; bh=c7FgZIU75WTpmBIGVgAIe+iK5JtAMDobzAXRo0sZOmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=ZDV31/Q8LOSdbzhrrl96PuIj3e9pk/t1gxswb28Bdm4yQgUvEa7a9OjbPyNrWDytrMyr/j/F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k38T.81C0x_nHQauM1z7UV3V05o8yax3i_7YzgVP5oh7NFedH_qH1LON oXToGNEdEPsaSphvNEq99PPgTu8yO0Au1JK3pHrCuAmcUb679raRdbU7.tVjgxFNqil25FJO9qZB _OLnkjaZwi6O0Icp5xlY0kqg0ID9NGMr75XBCI2r.tvntd6T0ipxR4TfMggCV6akMM.NZrkfLzQD _vPHgNb_UlbTgjfIf4k5exJju5WjgeyJJh6AzeS3SvJ2kgE9qty0aF_.LbZgxDjv0cJUCach15O4 lNQS9k1oQreQ9Mwogncrdzd6qoukdB0CI1V6SOHwLhgNTcgLzi0f5xC37ElcStcECpZoMSh8VOdk H2U0YX2oF1PJsfJnOLiLOTuqwBVtVECynTdKKTIjviN7IApecCN6vQyWYeIQz5Ysu69tyjoLtM7J iKuI6B8fuZOmuDU1JaAZa1W.WO1f..RswWzJPcVRvZ5QoOvMMGCQ_a2aUDroaB88zx2mO08pm_YF y0XEPp9VKw4ebIzSh90A8Ucx.vq5r1nsXYwrUI79v98499IYiIjsHIA7yUdNe7UJiEk9buNMgPZ5 UmIhzuD6ifCklNb_4o8glFeJtz7BVxnhwbePOi.Wf8d.rauoTyhedbmofA8kWQeTqSTLx0EQcL6Z VxV63bbarsXyc7PcB X-Sonic-MF: X-Sonic-ID: 4a0ccc37-d4ea-4662-82ff-7597c02c421c Received: from sonic.gate.mail.ne1.yahoo.com by mail-asdoutdeli-p-cin-euwe4-prod-sonicconsumer-svc-101 with HTTP; Sat, 29 Aug 2026 14:59:03 +0000 Received: from dip114.lsn.ir2.yahoo.com ([87.248.99.123]) by hello (SMTP) with SMTP ID 13fd5a24ca42336c08dbbc03a4401a1b; Sat, 29 Aug 2026 14:58:58 +0000 (UTC) From: Hannes Domani To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v3 3/8] Windows gdb: Remove mappings member from windows_per_inferior Date: Sat, 29 Aug 2026 16:49:00 +0200 Message-ID: <20260829145823.1034821-3-ssbssa@yahoo.de> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260829145823.1034821-1-ssbssa@yahoo.de> References: <20260829145823.1034821-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. Approved-By: Tom Tromey --- v3: no 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