Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/4] Support the Windows/MSVC target in GDB
@ 2026-07-14  0:45 Pedro Alves
  2026-07-14  0:45 ` [PATCH 1/4] gdb: recognize *-*-windows* Windows targets Pedro Alves
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Pedro Alves @ 2026-07-14  0:45 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-07-15 15:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-14  0:45 [PATCH 0/4] Support the Windows/MSVC target in GDB Pedro Alves
2026-07-14  0:45 ` [PATCH 1/4] gdb: recognize *-*-windows* Windows targets Pedro Alves
2026-07-14  0:45 ` [PATCH 2/4] gdb: treat Windows host + Windows target as native Pedro Alves
2026-07-14  0:45 ` [PATCH 3/4] gdb: distinguish GNU and MSVC flavors of the Windows OS ABI Pedro Alves
2026-07-14 11:57   ` Eli Zaretskii
2026-07-14 22:15     ` Pedro Alves
2026-07-15  1:21       ` Simon Marchi
2026-07-15 11:18         ` Pedro Alves
2026-07-15 13:13           ` Simon Marchi
2026-07-15 14:10             ` Pedro Alves
2026-07-15 15:51               ` Simon Marchi
2026-07-15 11:43       ` Eli Zaretskii
2026-07-14  0:45 ` [PATCH 4/4] gdb: MSVC "long double" is a 64-bit double Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox