]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Create x86-windows-nat.c
authorHannes Domani <ssbssa@yahoo.de>
Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)
committerHannes Domani <ssbssa@yahoo.de>
Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)
Also creates the x86_windows_per_inferior and x86_windows_nat_target
derived classes in there which will then hold the arch-specific data and
function overrides.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/Makefile.in
gdb/configure.nat
gdb/windows-nat.c
gdb/x86-windows-nat.c [new file with mode: 0644]

index 161e8128e98e2c16513b0b955c70624ad690d28a..b564048f9fadf9c93f3d8e58febb6ffa95f2c991 100644 (file)
@@ -1985,6 +1985,7 @@ ALLDEPFILES = \
        x86-gnu-nat.c \
        x86-nat.c \
        x86-tdep.c \
+       x86-windows-nat.c \
        xstormy16-tdep.c \
        xtensa-config.c \
        xtensa-linux-nat.c \
index 1325d584bea2b673ccf3b52e7ce7a70903763af2..3ac0319328fe854aeebc7bbf9b64cdeefcb2427a 100644 (file)
@@ -128,7 +128,8 @@ case ${gdb_host} in
            i386)
                # Native config information for GDB on i386
                # systems running Cygwin.
-               NATDEPFILES="${NATDEPFILES} i386-windows-nat.o"
+               NATDEPFILES="${NATDEPFILES} i386-windows-nat.o \
+               x86-windows-nat.o"
                ;;
        esac
        ;;
@@ -137,7 +138,8 @@ case ${gdb_host} in
            i386)
                # Native config information for GDB on amd64
                # systems running Cygwin.
-               NATDEPFILES="${NATDEPFILES} i386-windows-nat.o amd64-windows-nat.o"
+               NATDEPFILES="${NATDEPFILES} i386-windows-nat.o \
+               amd64-windows-nat.o x86-windows-nat.o"
                ;;
        esac
        ;;
@@ -361,14 +363,16 @@ case ${gdb_host} in
     mingw)
        case ${gdb_host_cpu} in
            i386)
-               NATDEPFILES="${NATDEPFILES} i386-windows-nat.o"
+               NATDEPFILES="${NATDEPFILES} i386-windows-nat.o \
+               x86-windows-nat.o"
                ;;
        esac
        ;;
     mingw64)
        case ${gdb_host_cpu} in
            i386)
-               NATDEPFILES="${NATDEPFILES} i386-windows-nat.o amd64-windows-nat.o"
+               NATDEPFILES="${NATDEPFILES} i386-windows-nat.o \
+               amd64-windows-nat.o x86-windows-nat.o"
                ;;
        esac
        ;;
index 144b1ae8578b502c11cc2f2a5f78bfc453e455e7..9bcbc740f86982d858b8ff9bac9ba5714d7aa9f3 100644 (file)
@@ -73,8 +73,7 @@
 using namespace windows_nat;
 
 /* The current process.  */
-static windows_per_inferior x86_windows_process;
-windows_per_inferior *windows_process = &x86_windows_process;
+windows_per_inferior *windows_process;
 
 #undef STARTUPINFO
 
@@ -2868,10 +2867,6 @@ INIT_GDB_FILE (windows_nat)
      calling x86_set_debug_register_length function
      in processor windows specific native file.  */
 
-  /* The target is not a global specifically to avoid a C++ "static
-     initializer fiasco" situation.  */
-  add_inf_child_target (new x86_nat_target<windows_nat_target>);
-
 #ifdef __CYGWIN__
   cygwin_internal (CW_SET_DOS_FILE_WARNING, 0);
 #endif
diff --git a/gdb/x86-windows-nat.c b/gdb/x86-windows-nat.c
new file mode 100644 (file)
index 0000000..d1f78a0
--- /dev/null
@@ -0,0 +1,42 @@
+/* Native-dependent code for Windows x86 (i386 and x86-64).
+
+   Copyright (C) 2025-2026 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include "windows-nat.h"
+
+#include "x86-nat.h"
+
+struct x86_windows_per_inferior : public windows_per_inferior
+{
+};
+
+struct x86_windows_nat_target final : public x86_nat_target<windows_nat_target>
+{
+};
+
+/* The current process.  */
+static x86_windows_per_inferior x86_windows_process;
+
+INIT_GDB_FILE (x86_windows_nat)
+{
+  /* The target is not a global specifically to avoid a C++ "static
+     initializer fiasco" situation.  */
+  add_inf_child_target (new x86_windows_nat_target);
+
+  windows_process = &x86_windows_process;
+}