Re: [PATCH 3/4] gdb: distinguish GNU and MSVC flavors of the Windows OS ABI
Simon Marchi <[email protected]>
| Newsgroups | gmane.comp.gdb.patches |
|---|---|
| Message-ID | <[email protected]> |
On 7/15/26 7:18 AM, Pedro Alves wrote:
> On 2026-07-15 02:21, Simon Marchi wrote:
>> On 2026-07-14 18:15, Pedro Alves wrote:
>>> On 2026-07-14 12:57, Eli Zaretskii wrote:
>>> * 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?
>
> 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.
Simon