From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id jUnDBr+GVWoA6QYAWB0awg (envelope-from ) for ; Mon, 13 Jul 2026 20:45:51 -0400 Received: by simark.ca (Postfix, from userid 112) id 0BBB31E099; Mon, 13 Jul 2026 20:45:51 -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.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 CD2A61E099 for ; Mon, 13 Jul 2026 20:45:49 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7BA814BA2E16 for ; Tue, 14 Jul 2026 00:45:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BA814BA2E16 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by sourceware.org (Postfix) with ESMTPS id 37E694BA2E07 for ; Tue, 14 Jul 2026 00:45:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 37E694BA2E07 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 37E694BA2E07 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783989923; cv=none; b=m2NhU1gDZku7vVXmHDc+2Vs/OEwqWSBfSFAeMZ1d+yiTOazcPw2rqBiES3yY6t2I7FggnXdPY9pgqq7GM6xQqalNyjUpvZZF/PtlM6b249Ol18hukCB+haY6pNpQY8cevqOzD7eAlXmYs7AvqvJGs7vg8S04lTm3bbbDlZ6sO78= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783989923; c=relaxed/simple; bh=RyUvmmbi51ViLV/ss1SGQ5k8BhLZRZ60JUupnvkwamU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=N6CCoMrjMIjoq7T1IfhVkEdPLXXAKGYcw7nyhGQ93T4i6jc0s+2NjQXkWRLK911TzXlDkKCks30Wxw5VDWNnh9algfY2bSjfH6uGukrQA9911CtTk6YC+1rz5Y3TzN5YQI2+yrwTG4DKdT4ri886rJI7Al5FuxOCDBp4kaEjFpg= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37E694BA2E07 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-47122683cf3so2031430f8f.0 for ; Mon, 13 Jul 2026 17:45:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783989922; x=1784594722; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=AMZPMytujk2ORJwpUfuabQx4rMFxi0sKpQwAnKfxhNU=; b=DTIFMUSaVBAs8pajwJSVEUHSaWIlzZlvSozfKN0zTPM2z7tLtVthR0foXSR6cDVWJi xkz+2RvIG3jwKJ5YBTRdfA2tYtLm3nsv2te+C5bNdZPRta3iWpctJt/YebPd66l3Dra6 pqK1EQb3qnUvu4iPE3cL/PfztmKF8LjpG1U1JfUVtZr/3nhfn9uXCEWparkCvkqNt0T1 jXBNquQIVtXa4ZFxMgjqfhAOkutMmJbcSTHaSGY9V1P21wIt8/54Ieob+AOkY090eUSj mx/DnD9KKfJuC1eM+F4/s3NeTMAIgXdhdy7GezZsm+onNLnu6qiDMr65QVoBOA5jVsQv yIPA== X-Gm-Message-State: AOJu0YwJfoex9ZTF3jTaEQREATJpBkN4XR3SCkUDjIclQQHYBWrrkwVv BrNKabeVBLHNqhg4N/b/dMmb6Sy5AjXFk3NHVfiJBJSP/lYHSNZuX4UOCJqWTFyEOKc= X-Gm-Gg: AfdE7clHSd6wtYnx8nDbUDN8DKXdlXEFlHDpWvF3d/9wuQDbVaCWB/vX/jCV1eUnZVi eoQHZbJdqJvHnVDA09IguBcR4yzATnkyM8WBUjYr+4qs2nzi6nPFAls/yd5J5G/NsLyNBJfmeUU TioIgP4t1jmjeRfIzfh9ZbV1GBSWA5DjTPZFGQROLMMVqpFsR833k6sadC4Hs9Z65HRbQzuoMmb s6xU7EmXkDZUoZVzlP0PriiVOdDSjzLDxfyvIhDhRdw4/QGUnswjRNvwZ3kE1P53V07R/Tlk7Lc loMlwVBC/ICD4EXa5b7WgCjYuZ6GdGObPBjOwu9iaPnpw7blhcq2AuyF2e/HKe5vjea10bg5D6k m5ZXU6x0VSGJ4TQa50EpsIu7nWeA9YXOBTTnJAPehBPE3tWeSWQblxwal4+Dw9PFiDeQsZcGbJB x/djxw/azi1P5z5tJ4getjhg== X-Received: by 2002:adf:f392:0:b0:475:f0f0:9eed with SMTP id ffacd0b85a97d-47f4639886bmr1245967f8f.50.1783989921964; Mon, 13 Jul 2026 17:45:21 -0700 (PDT) Received: from localhost ([2001:8a0:fae3:3700:e20e:b691:1f0e:d301]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-47f4634e5c3sm3441961f8f.1.2026.07.13.17.45.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Jul 2026 17:45:20 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 0/4] Support the Windows/MSVC target in GDB Date: Tue, 14 Jul 2026 01:45:03 +0100 Message-ID: <20260714004507.1323332-1-pedro@palves.net> X-Mailer: git-send-email 2.54.0 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 This series teaches GDB about Windows targets whose triplet uses the "windows" OS, as produced by Clang (e.g. x86_64-pc-windows-msvc), and about the MSVC ABI those targets use. The motivation is to be able to build a MinGW-hosted GDB that defaults to debugging MSVC-ABI binaries, and to run the testsuite with such a GDB and a matching Clang. IOW, to build GDB with: --host=x86_64-w64-mingw32 --target=x86_64-pc-windows-msvc To be clear, this does _not_ propose making it possible to build GDB with --host=x86_64-pc-windows-msvc. That's a different can of worms. This will let us use "istarget *-*-windows-msvc" in the testsuite where we need to distinguish MinGW and MSVC environments. The MSVC ABI is not the same as the GNU (MinGW) ABI -- they differ in long double, in the C++ ABI, and in other details. So the series also splits GDB's single "Windows" OS ABI into two flavors, GNU and MSVC, picks the right default based on how GDB was configured, and fixes a concrete ABI difference (long double) as simple example. Another way to handle the ABI split would be to keep the single "Windows" osabi, and add a new "set windows-abi gnu/msvc" switch, similar to "set cp-abi", and also, arch-specific abi settings like "set arm abi auto/APCS/AAPCS", and "set powerpc vector-abi", etc. I didn't go for that approach because the MSVC/GNU ABI split is a lot deeper than those other ABI switches: affects C ABI (long double), calling conventions, headers and libraries linked with, C++ ABI, mangling scheme, and on and on, basically almost like a separate target. While OTOH, "set arm abi" etc. are more about multilibs for a single target, they normally come from the same sources (I mean, toolchain/runtime project), just compiled differently, with some compiler option. OTOH, it is possible to mix GNU and MSVC code in the same binary (and it happens all the time, given system DLLs are built with MSVC), so maybe that distinction isn't that important. OTOOH, what would this mean for the Cygwin osabi? The first two patches (recognize *-*-windows* and treat as native) are independent of this, and could go in even if the design of this part changes. So I figured I'd send what I have right now for comments. This series depends on the BFD patch: bfd: recognize *-*-windows* Windows targets which was sent separately to the binutils list, here: https://inbox.sourceware.org/binutils/20260713231552.1303239-1-pedro@palves.net/T/ I have a follow-up series that starts teaching the testsuite about windows-msvc, too. I've done just enough to be able to validate the idea, and see a few testcases pass. Pedro Alves (4): gdb: recognize *-*-windows* Windows targets gdb: treat Windows host + Windows target as native gdb: distinguish GNU and MSVC flavors of the Windows OS ABI gdb: MSVC "long double" is a 64-bit double gdb/NEWS | 16 ++++++++++++++++ gdb/aarch64-windows-tdep.c | 5 ++++- gdb/amd64-windows-tdep.c | 6 +++++- gdb/arch-utils.c | 18 ++++++++++++++++++ gdb/configure | 19 +++++++++++++++++-- gdb/configure.ac | 19 +++++++++++++++++-- gdb/configure.tgt | 22 +++++++++++----------- gdb/doc/gdb.texinfo | 15 +++++++++++++++ gdb/i386-windows-tdep.c | 6 +++++- gdb/osabi.c | 32 +++++++++++++++++++++++++++----- gdb/osabi.h | 8 ++++++++ gdb/windows-tdep.c | 9 +++++++++ gdb/windows-tdep.h | 5 +++-- gdbsupport/osabi.def | 2 ++ 14 files changed, 157 insertions(+), 25 deletions(-) base-commit: 490469846dcef89fe53668bdbba73591c64bed61 -- 2.54.0