From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6YHLLg2tV2qcVAoAWB0awg (envelope-from ) for ; Wed, 15 Jul 2026 11:53:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1784130829; bh=IWYz3laCHVHinTS1OeLLcDQoCuRS4s3E9mjCbu64i7w=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BWAtcWaEk8YqCjpeZ8IPyLLFXstQJ8+YTNJa/30jlDU+Ee+NS0BUTWlZVqlEuf5HM m+XU2DmLrfa8rHqpCndBgBYk+nT9Yd8NYd85hMYy5M0zJOqK2AbkVowwc8GEO3MWVu UpCkr8VGuzSMhcdd1LTbkpmER3L6wXejMl+/pos8= Received: by simark.ca (Postfix, from userid 112) id BBD321E033; Wed, 15 Jul 2026 11:53:49 -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=w616no7u; 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 EA90B1E033 for ; Wed, 15 Jul 2026 11:53:48 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3DA154BA2E11 for ; Wed, 15 Jul 2026 15:53:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3DA154BA2E11 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=w616no7u Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id B50DA4BA23C7 for ; Wed, 15 Jul 2026 15:51:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B50DA4BA23C7 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 B50DA4BA23C7 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=1784130701; cv=none; b=GREBTpMcQl6J5P5iQPdKz/ZTxmtOKr7hGqFXjS8/JiWvHrg2/8mUZl6+0rj+W2sJCpZge1cxioFJMcZHZ8U4tOZ/W28hOiLXizdt0697A72DtYRrsaI2V/xF2DQYQDutDe41r8SJlYCLyPmNzHwRKjft2IDnisIma1v3Xwggxqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784130701; c=relaxed/simple; bh=IWYz3laCHVHinTS1OeLLcDQoCuRS4s3E9mjCbu64i7w=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=OzRO+7N50lOThtx072wJEMwysjSt1TdbTqZYrmwL/PfEYoVL7Yy/YqoguAq9lMmLkRbYjX/P3J6Zcf1M9eNX3pbpqM7FfaQZFsIDlCFRI4mmhtXJ1iFd1HWak5mYcHVZMhUaeCTjnXsNZZa+D+dkKVTE0JnIp2eUCWmXdaxl4Z0= 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=w616no7u DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B50DA4BA23C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1784130690; bh=IWYz3laCHVHinTS1OeLLcDQoCuRS4s3E9mjCbu64i7w=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=w616no7uj/Mz+54TR0lKIJOKSB+KAg/nybzp0N6JSGV4wAc9ZSddq7bOK7yEH5jVl 3QQyWSj4rsyy1alVYzrT6Wq9Xq24uhzy4mNxCl5+BvKWQaPS312gauSsOzfJKN3m3T ZwG3ah1u9MOVtMQg/6nNTuC52ulOjXvUwtgtkl3M= Received: by simark.ca (Postfix) id F0E281E033; Wed, 15 Jul 2026 11:51:29 -0400 (EDT) Message-ID: Date: Wed, 15 Jul 2026 11:51:29 -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> <4953c47d-3904-4df4-945b-4693c2df9dad@simark.ca> <3bb5dc17-a391-47a5-9548-c3d33b06136c@simark.ca> <34622628-862d-411a-b2b7-3c4e2174a612@palves.net> Content-Language: fr From: Simon Marchi In-Reply-To: <34622628-862d-411a-b2b7-3c4e2174a612@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 7/15/26 10:10 AM, Pedro Alves wrote: > On 2026-07-15 14:13, Simon Marchi wrote: >> On 7/15/26 7:18 AM, Pedro Alves wrote: >>> On 2026-07-15 02:21, Simon Marchi wrote: >>>> What happens if you build a GDB with --enable-targets=all and load a >>>> .exe? Is either ABI preferred over the other? >>> >>> The preferred one is taken out of --target, defaults to GNU. >>> --enable-targets=foo,bar,all does not affect it. >> >> I was thinking when building GDB on Linux (with --target that defaults >> to something Linux) with --enable-targets=all, i.e. a typical >> development build. In that case, the --target does not help to choose >> an ABI, so the fallback must come from somewhere else. >> > > Hmm, I _think_ I see what the confusion is. The logic is: > > "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." > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > The code that does this is here: > > + /* A generic "Windows" OS ABI means a PE binary whose flavor -- > + GNU (MinGW) or MSVC -- could not be determined. The osabi > + sniffers and gdbserver's target description both report the > + generic "Windows" OS ABI, because neither can tell the two > + flavors apart from the binary alone. Resolve it here to a > + concrete flavor: use the configured default if that is itself a > + Windows flavor, otherwise assume GNU. */ > + if (info->osabi == GDB_OSABI_WINDOWS) > + { > + info->osabi = GDB_OSABI_WINDOWS_GNU; <<< "somewhere else" > +#ifdef GDB_OSABI_DEFAULT > + if (GDB_OSABI_DEFAULT == GDB_OSABI_WINDOWS_GNU > + || GDB_OSABI_DEFAULT == GDB_OSABI_WINDOWS_MSVC) > + info->osabi = GDB_OSABI_DEFAULT; > +#endif > + } > > So with --target=Linux, if the sniffer, or the target.xml, or the user picks/returns > GDB_OSABI_WINDOWS, we resolve to GDB_OSABI_WINDOWS_GNU, as GDB_OSABI_DEFAULT itself is not > a Windows flavor (it's GDB_OSABI_LINUX). > > Does this clarify it? The "somewhere else" is basically indicated above in the <<< line. Ah yes thanks, I had missed the "and otherwise assumes the GNU flavor". Simon