From: Hannes Domani Date: Fri, 23 Jan 2026 19:07:04 +0000 (+0100) Subject: Create x86-windows-nat.c X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79ef785045e2a5f984df3af6eb1f2bb667232101;p=thirdparty%2Fbinutils-gdb.git Create x86-windows-nat.c 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 --- diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 161e8128e98..b564048f9fa 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -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 \ diff --git a/gdb/configure.nat b/gdb/configure.nat index 1325d584bea..3ac0319328f 100644 --- a/gdb/configure.nat +++ b/gdb/configure.nat @@ -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 ;; diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 144b1ae8578..9bcbc740f86 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -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); - #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 index 00000000000..d1f78a01255 --- /dev/null +++ b/gdb/x86-windows-nat.c @@ -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 . */ + +#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 +{ +}; + +/* 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; +}