Fia x comment typo.
[deliverable/binutils-gdb.git] / gdb / windows-nat.c
index c6f8f66fd16bcd109f88c2e009cf997a09096e1f..358bdf7a9f53234e0e188df1ab3983ad64b72453 100644 (file)
@@ -27,7 +27,6 @@
 /* We assume we're being built with and will be used for cygwin.  */
 
 #include "defs.h"
-#include "tm.h"                        /* required for SSE registers */
 #include "frame.h"             /* required by inferior.h */
 #include "inferior.h"
 #include "target.h"
@@ -36,7 +35,6 @@
 #include "completer.h"
 #include "regcache.h"
 #include "top.h"
-#include "i386-tdep.h"
 #include <signal.h>
 #include <sys/types.h>
 #include <fcntl.h>
 #include "gdbcmd.h"
 #include <sys/param.h>
 #include <unistd.h>
+#include "exec.h"
+
+#include "i386-tdep.h"
+#include "i387-tdep.h"
 
 /* The ui's event loop. */
 extern int (*ui_loop_hook) (int signo);
@@ -70,12 +72,8 @@ enum
 #include <sys/procfs.h>
 #include <psapi.h>
 
-#ifdef HAVE_SSE_REGS
 #define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_DEBUG_REGISTERS \
        | CONTEXT_EXTENDED_REGISTERS
-#else
-#define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_DEBUG_REGISTERS
-#endif
 
 static unsigned dr[8];
 static int debug_registers_changed = 0;
@@ -187,7 +185,6 @@ static const int mappings[] =
   context_offset (FloatSave.DataSelector),
   context_offset (FloatSave.DataOffset),
   context_offset (FloatSave.ErrorSelector)
-#ifdef HAVE_SSE_REGS
   /* XMM0-7 */ ,
   context_offset (ExtendedRegisters[10*16]),
   context_offset (ExtendedRegisters[11*16]),
@@ -199,7 +196,6 @@ static const int mappings[] =
   context_offset (ExtendedRegisters[17*16]),
   /* MXCSR */
   context_offset (ExtendedRegisters[24])
-#endif
 };
 
 #undef context_offset
@@ -352,12 +348,15 @@ do_child_fetch_inferior_registers (int r)
 {
   char *context_offset = ((char *) &current_thread->context) + mappings[r];
   long l;
-  if (r == FCS_REGNUM)
+
+#define I387_ST0_REGNUM I386_ST0_REGNUM
+
+  if (r == I387_FISEG_REGNUM)
     {
       l = *((long *) context_offset) & 0xffff;
       supply_register (r, (char *) &l);
     }
-  else if (r == FOP_REGNUM)
+  else if (r == I387_FOP_REGNUM)
     {
       l = (*((long *) context_offset) >> 16) & ((1 << 11) - 1);
       supply_register (r, (char *) &l);
@@ -369,6 +368,8 @@ do_child_fetch_inferior_registers (int r)
       for (r = 0; r < NUM_REGS; r++)
        do_child_fetch_inferior_registers (r);
     }
+
+#undef I387_ST0_REGNUM
 }
 
 static void
@@ -637,7 +638,7 @@ get_image_name (HANDLE h, void *address, int unicode)
 
   /* See if we could read the address of a string, and that the
      address isn't null. */
-  if (!ReadProcessMemory (h, address,  &address_ptr, sizeof (address_ptr), &done) 
+  if (!ReadProcessMemory (h, address,  &address_ptr, sizeof (address_ptr), &done)
       || done != sizeof (address_ptr) || !address_ptr)
     return NULL;
 
@@ -802,7 +803,7 @@ get_relocated_section_addrs (bfd *abfd, CORE_ADDR text_load)
 static struct objfile *
 solib_symbols_add (char *name, int from_tty, CORE_ADDR load_addr)
 {
-  struct section_addr_info *section_addrs_ptr = NULL;
+  struct section_addr_info *addrs = NULL;
   static struct objfile *result = NULL;
   bfd *abfd = NULL;
 
@@ -825,33 +826,28 @@ solib_symbols_add (char *name, int from_tty, CORE_ADDR load_addr)
     {
       if (bfd_check_format (abfd, bfd_object))
        {
-         section_addrs_ptr = get_relocated_section_addrs (abfd, load_addr);
+         addrs = get_relocated_section_addrs (abfd, load_addr);
        }
 
       bfd_close (abfd);
     }
 
-  if (section_addrs_ptr)
+  if (addrs)
     {
-      result = safe_symbol_file_add (name, from_tty, section_addrs_ptr,
-                                    0, OBJF_SHARED);
-
-      free_section_addr_info (section_addrs_ptr);
+      result = safe_symbol_file_add (name, from_tty, addrs, 0, OBJF_SHARED);
+      free_section_addr_info (addrs);
     }
-
   else
     {
       /* Fallback on handling just the .text section. */
-      struct section_addr_info *section_addrs;
       struct cleanup *my_cleanups;
 
-      section_addrs = alloc_section_addr_info (1);
-      my_cleanups = make_cleanup (xfree, section_addrs);
-      section_addrs.other[0].name = ".text";
-      section_addrs.other[0].addr = load_addr;
+      addrs = alloc_section_addr_info (1);
+      my_cleanups = make_cleanup (xfree, addrs);
+      addrs->other[0].name = ".text";
+      addrs->other[0].addr = load_addr;
 
-      result = safe_symbol_file_add (name, from_tty, &section_addrs,
-                                    0, OBJF_SHARED);
+      result = safe_symbol_file_add (name, from_tty, addrs, 0, OBJF_SHARED);
       do_cleanups (my_cleanups);
     }
 
@@ -1635,7 +1631,6 @@ child_files_info (struct target_ops *ignore)
       attach_flag ? "attached" : "child", target_pid_to_str (inferior_ptid));
 }
 
-/* ARGSUSED */
 static void
 child_open (char *arg, int from_tty)
 {
@@ -2215,8 +2210,7 @@ typedef struct
 {
   struct target_ops *target;
   bfd_vma addr;
-}
-map_code_section_args;
+} map_code_section_args;
 
 static void
 map_single_dll_code_section (bfd * abfd, asection * sect, void *obj)
This page took 0.025758 seconds and 4 git commands to generate.