From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4eP8DLVK62o0eBkAWB0awg (envelope-from ) for ; Wed, 04 Nov 2026 10:09:41 -0500 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=s6UTH+p0; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 30FE4378002; Wed, 04 Nov 2026 10:09:41 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED 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 941B71E052 for ; Wed, 04 Nov 2026 10:09:40 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 18C124BA23C3 for ; Wed, 4 Nov 2026 15:09:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 18C124BA23C3 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=s6UTH+p0 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 5DFC54BA23C7 for ; Wed, 4 Nov 2026 15:08:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DFC54BA23C7 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 5DFC54BA23C7 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=1793804889; cv=none; b=am5S29NizLeUPAoID66uohuqkOP/kMXMKOtwdwwahjJ83WgH6yfp04rR8JigY/ohl9lxNv7RgX7JW0iIJoHuhH87OsyTQ38B3gPr1rTMOm18ukphT7Sz8JVUJodGuEWVIYGofcD0RRvvvW7Eftm41kJohZvyulLRZw6JnqjrhWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793804889; c=relaxed/simple; bh=Mjkp/3jZ4ukwRWfwO5iU6cOnJQH/TaPipUYJ7+mta1c=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=bEMew6qbVwjcQYsKo9MAzo+N+yDIkhHEuCofMha5zcWAeKD3zWlxCMJevSHnGACqsxYLOxmqIbrU5OyxcqEPcG2Mok3mI2VZ3CB5KnNyOElZYYQZS2QGh1xCdZEd4lsLW5tF6Aiy4uMQZrBILHTYFF6LzG4tB00PJ0m+7vX1Xss= 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=s6UTH+p0 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DFC54BA23C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1793804888; bh=zMaFDvuf33DQ6rqDj0x/OgaJfG4P6kXXyB6uv4TXe+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=s6UTH+p0tn9EUWQcRFABpUerkfk/mjpSHfnctFF2qy7Agb81xpmmF4rba/TvByydXJEkPDUrq6HFPR7kGyfnlPJttKLcuxMYU4wcklptamNAFL+YOi/uifudGRfJNlzZUyXCPJR/zDYD3WIVkdlJFvxP0Wj+brn6RUDeHjIV1g6+n50bHdU1AawYskYz29TXfiBII8mvsDuLzMLi3qSS+lPSHi20+V+QJajWxx2WqNSdRlsFKP0WInreAuMUKlBEIdkoBeF/B4rzdKE4xx/PwJhJw440exlxinlDDzcw2xi/VbBRA8s9eTl8WgnFxbLEUG7kSBEjwncRLDWyk6bNOg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1793804888; bh=b00OcdlCXpAcBmNdIrZqcpbMG+14SMXKIerkX2H473m=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=P//384S+4B4/xsktW6SHxNkZBRQlHYRCPgkQWvEs8fdR5lwQ/Un41zRtSlkwtPBceks416nJV4x4ikJaHqKFDQWPAnUv2lXtqJA2HvjuovRpICZsjlY3Vcl4Chn+iMTIS0z1XlTCl6yJRtvnkWQGR0ySldDqk34vzmVqBGGtVth++TiPPOozX5Lr07wctZ9hWNxFmSuUef+vynbyDQin8fCvU6lAIX/T5FORUcje7p9mZf7/gtsYxonpEU5rFXgvOLHt4mJrcIzvvaJtVvGt8PEqp61WPrMceIkGVUUWE41WvGuSLzRsb0DTvQyTch1OC4audDLL3HsdLYOdjv9USQ== X-YMail-OSG: IFjPx2oVM1lhHdDqzSCqWDZeaY.GPp9yqzWSpHV00yUQfddO_JW.AM2sdtMWQdm _I440gbPwPsskzgt0HbRWDwr.NnDi0UGAx9EgMPPxRSFiN_teqF3FTEhZFUIWIDmFA_Q4jItpk1a 1tiBIFjPOpivw8anDhQNJ.Ty28_NcDDD3gNmphr0GUsshHfZWRxCnUlokcg3MPRz4ETqy9jFY1cm .OoyWDQUdx_JAiB.fnhlZE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f8GbK_i_ZjaGSCLDkR5OIp9AQZwcORC9gFM1N61QhitldL5SVzHrNsYaaQL5 Xef2_W4UAB7VJXMkmqjSWiWJWvUSh_uZjRZklgVBv2YRynqxDxFbe27g9RzgEdYA8KuY0Jq.PJug RZRBpGpwZySl_gkttZf0Gvap35tTFdR65KpW2deV.q9nKo4m9M_ZQb_exbaiJZccAy29vs2vCXeT jr6MY0zZcMzT62MHeDxaQ0KsclJo8iKPrQ.O83sLst.RS.3YylPBEEfeER4YD5HmAEMjeOkpuvlv bGwusYHvJrtg3Nd3rjtaha2M2ps4VjQ0Fll3qnP5GD77cQgUCKvQXneHKbP5GaT1aztb8emq1Iwa 60kF5h9uZugWD4rs0RMIl9qi2Ivvm.89NetVO.eui5KlITdknaGta0rnQ3eQ3_rRKVrdIrfKFJ4B DmG7YU87rhsb4xjXNdsW2UVm4_A.4bA1ObpKkKtEbjAo_GNQsveMTDtlppVxPArYqSiAc7yoiOkQ aaR1m9sZglV2YeOQWmT5nD9nNu_j5JZIcBlJXgCvKjagRqaDaEXIINOVM_eKeVqazuV6IdTSVFAt X9BPZiQCGMvFMOpMfu7aiFh1zabE2skddAsQdNJq8IJtHrclSHfQNvh0iRia_7.2ZKtl_Ce0wD5D ouevkFcAMoQM5L1dSXYIStp.59MgbuUiICHsuO3Jvwjy0Ml4SZSOrp0darf0dNoRWjpOSiy9Py6m UrI7X9rnhMf9LDdQAwFpi X-Sonic-MF: X-Sonic-ID: b61c743d-1856-4fc3-9f98-1f814b8cffa2 Received: from sonic.gate.mail.ne1.yahoo.com by mail-asdoutdeli-p-cin-euwe4-prod-sonicconsumer-svc-103 with HTTP; Wed, 4 Nov 2026 15:08:08 +0000 Received: from dip4.lsn.ir2.yahoo.com ([87.248.99.13]) by hello (SMTP) with SMTP ID 905c62627fd4dfd5cb1c8e2fbeeb9831; Wed, 04 Nov 2026 15:08:04 +0000 (UTC) From: Hannes Domani To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v5 3/9] Windows gdb: Remove mappings member from windows_per_inferior Date: Wed, 4 Nov 2026 16:05:19 +0100 Message-ID: <20261104150749.3118853-3-ssbssa@yahoo.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261104150749.3118853-1-ssbssa@yahoo.de> References: <20261104150749.3118853-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 v4: no changes v5: 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 77834db1388..e0e147856fb 100644 --- a/gdb/windows-nat.h +++ b/gdb/windows-nat.h @@ -142,24 +142,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.55.0