From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uG0zN8rgVmo10AgAWB0awg (envelope-from ) for ; Tue, 14 Jul 2026 21:22:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1784078538; bh=5u41tItzkKfrbBhgwE+C8hvEREUYkmmSLVvQpLnq5CM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tL7Qz+vVfeSX3EE6RJAYSYcUIexCEXqfwIvKjrtZ+9IN0zXEiHUlWOOayDt+ph36t JtaDWrcKdGYk857pL8Mfl4rw6glv82FWu9jtJktqbuRaV3KAyyunDAS4llb2ZDsT1s HFvcUMzwlQ3DemBFKWATssDxDmBcaXM3PaUfNlfw= Received: by simark.ca (Postfix, from userid 112) id D14111E099; Tue, 14 Jul 2026 21:22:18 -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,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=SaCYEmVi; dkim-atps=neutral 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 40BB81E099 for ; Tue, 14 Jul 2026 21:22:18 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9E14C4BA7983 for ; Wed, 15 Jul 2026 01:22:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E14C4BA7983 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=SaCYEmVi Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 463DB4BA23CF for ; Wed, 15 Jul 2026 01:21:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 463DB4BA23CF Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 463DB4BA23CF Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784078512; cv=none; b=Iciq5P/f5WACb500mWRH6JqM4H6N+jRsHrWRRtc3+nlOv8D/XId6TvlD49bUaMQDDaue0jcl1dGeNPOtaFvk37F4l3Z2Kd1SeRjsXjbzrYXPVOK3m/q+kuTqW+4RfIrZe4CIRDmpVbY9CHI96uzGjoaTtUJ3eXtL6oNSvq8PyKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784078512; c=relaxed/simple; bh=5u41tItzkKfrbBhgwE+C8hvEREUYkmmSLVvQpLnq5CM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=JHYLgkVHaL1TU8wz2AQrGNeNkJV4DZOff57f3ybe1ViIHJDc9fGjmPKPcxqm/8590sk7OEu4F2oyT1NNcWvh53KslSLNuCWIRh9+/D+e6olM+eO3KrQJsmZIceHSEoVoj51qvdA6nX2tnENMdoeWXRnfhmuoqwwdFyNHr6yYq10= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=SaCYEmVi DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 463DB4BA23CF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1784078509; bh=5u41tItzkKfrbBhgwE+C8hvEREUYkmmSLVvQpLnq5CM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SaCYEmVi6r++C78woJ9oeRTC61jiAkzexODoGz2ya+x4lSYiPJIK3pLvTX2gY5aRe 0LKGGNdhtMIFX0i8ssl1v7mKBqdlaU0+mISyyhkPA6v6P37+hZQk8ENIMQppQnKHtM /pe/Fyv4hGZxcuFezPmk5zTEjvtQz1Gx6+E4wifw= Received: by simark.ca (Postfix) id 16FEF1E099; Tue, 14 Jul 2026 21:21:48 -0400 (EDT) Message-ID: <4953c47d-3904-4df4-945b-4693c2df9dad@simark.ca> Date: Tue, 14 Jul 2026 21:21:48 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/4] gdb: distinguish GNU and MSVC flavors of the Windows OS ABI To: Pedro Alves , Eli Zaretskii Cc: gdb-patches@sourceware.org References: <20260714004507.1323332-1-pedro@palves.net> <20260714004507.1323332-4-pedro@palves.net> <86ik6hg4vu.fsf@gnu.org> <2c36a069-53ed-465f-8ecf-360cc272eaac@palves.net> Content-Language: en-US From: Simon Marchi In-Reply-To: <2c36a069-53ed-465f-8ecf-360cc272eaac@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 On 2026-07-14 18:15, Pedro Alves wrote: > On 2026-07-14 12:57, Eli Zaretskii wrote: > >>> diff --git a/gdb/NEWS b/gdb/NEWS >>> index ec9b5a33787..cf3948f87e4 100644 >>> --- a/gdb/NEWS >>> +++ b/gdb/NEWS >>> @@ -103,6 +103,16 @@ >>> everywhere GDB shows a filename/dirname: source filenames, >>> executable filename, shared libraries, the cd/pwd commands, etc. >>> >>> +* GDB now distinguishes between the GNU (MinGW) and MSVC Windows ABIs. >>> + >>> + The "set osabi" command accepts two new values, "Windows-GNU" and >>> + "Windows-MSVC". The existing "Windows" value continues to work and >>> + now means "let GDB pick the flavor": GDB uses the configured default >>> + OS ABI (from --target) when that is a Windows flavor, and otherwise >>> + assumes the GNU flavor. E.g., --target=x86_64-pc-windows-msvc >>> + defaults to the MSVC ABI, and --target=x86_64-w64-mingw32 defaults >>> + to GNU ABI. See "New targets" entry below. >> >> This part is okay, but I think it would make sense to tell which >> compilers produce binaries of Windows-MSVC ABI. E.g., does the above >> mean that GDB will now be able to debug programs produces by MSVC, >> including use of the PDB debug data files? >> >> Also, you only mention the 64-bit host and target triplets, but does >> that mean this is limited to 64-bit Windows programs? > > That was an example, and the "New targets" section being pointed at has the > 32-bit x86 and AArch64 triplets. But I can try to make it clearer, along with > addressing your other points. > > How about this? > > * GDB now distinguishes between the GNU (MinGW) and MSVC Windows ABIs. > > The "set osabi" command accepts two new values, "Windows-GNU" and > "Windows-MSVC". The GNU ABI is for code produced by MinGW > toolchains, while the MSVC ABI is for code produced by Microsoft's > MSVC compiler (though see the PDB note below), or Clang targeting > one of {i686,aarch64,x86_64}-pc-windows-msvc. The existing > "Windows" value continues to work and now means "let GDB pick the > flavor": GDB uses the configured default OS ABI (from --target) when > that is a Windows flavor, and otherwise assumes the GNU flavor. For > example, --target=x86_64-pc-windows-msvc defaults to the MSVC ABI, > and --target=x86_64-w64-mingw32 defaults to GNU ABI. Similarly for > the i686 and AArch64 variants. See "New targets" entry below. What happens if you build a GDB with --enable-targets=all and load a .exe? Is either ABI preferred over the other? Would it be possible to "sniff" what ABI it is, for instance with the presence of some particular symbol? Simon