Rename common to gdbsupport
[deliverable/binutils-gdb.git] / gdb / arch / i386.c
index 60cf63b87e60f7327a2b6132d5085a73313f246e..d08ac6a5e8632457ee6dc8642195da89780102de 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2017 Free Software Foundation, Inc.
+/* Copyright (C) 2017-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    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 "gdbsupport/common-defs.h"
 #include "i386.h"
-#include "tdesc.h"
-#include "x86-xstate.h"
+#include "gdbsupport/tdesc.h"
+#include "gdbsupport/x86-xstate.h"
 #include <stdlib.h>
 
 #include "../features/i386/32bit-core.c"
 #include "../features/i386/32bit-avx512.c"
 #include "../features/i386/32bit-mpx.c"
 #include "../features/i386/32bit-pkeys.c"
+#include "../features/i386/32bit-segments.c"
 
 /* Create i386 target descriptions according to XCR0.  */
 
 target_desc *
-i386_create_target_description (uint64_t xcr0)
+i386_create_target_description (uint64_t xcr0, bool is_linux, bool segments)
 {
   target_desc *tdesc = allocate_target_description ();
 
 #ifndef IN_PROCESS_AGENT
   set_tdesc_architecture (tdesc, "i386");
-  set_tdesc_osabi (tdesc, "GNU/Linux");
+  if (is_linux)
+    set_tdesc_osabi (tdesc, "GNU/Linux");
 #endif
 
   long regnum = 0;
@@ -48,7 +51,11 @@ i386_create_target_description (uint64_t xcr0)
   if (xcr0 & X86_XSTATE_SSE)
     regnum = create_feature_i386_32bit_sse (tdesc, regnum);
 
-  regnum = create_feature_i386_32bit_linux (tdesc, regnum);
+  if (is_linux)
+    regnum = create_feature_i386_32bit_linux (tdesc, regnum);
+
+  if (segments)
+    regnum = create_feature_i386_32bit_segments (tdesc, regnum);
 
   if (xcr0 & X86_XSTATE_AVX)
     regnum = create_feature_i386_32bit_avx (tdesc, regnum);
This page took 0.025479 seconds and 4 git commands to generate.