Add a symbol's value to the computed frag offset, rather than overwriting it.
[deliverable/binutils-gdb.git] / gdb / go32-nat.c
index 0601a0d7d620c54642d74b949c7c1a574a45aee4..ae323b657ba3c3b4821fa126e9ada2830e5d7244 100644 (file)
@@ -25,7 +25,7 @@
 #include "frame.h"             /* required by inferior.h */
 #include "inferior.h"
 #include "target.h"
-#include "wait.h"
+#include "gdb_wait.h"
 #include "gdbcore.h"
 #include "command.h"
 #include "floatformat.h"
@@ -34,6 +34,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#include <unistd.h>
 #include <io.h>
 #include <dpmi.h>
 #include <debug/v2load.h>
@@ -344,7 +345,7 @@ sig_map[] =
     4, TARGET_SIGNAL_FPE,
     5, TARGET_SIGNAL_SEGV,
     6, TARGET_SIGNAL_ILL,
-    7, TARGET_SIGNAL_FPE,
+    7, TARGET_SIGNAL_EMT,      /* no-coprocessor exception */
     8, TARGET_SIGNAL_SEGV,
     9, TARGET_SIGNAL_SEGV,
     10, TARGET_SIGNAL_BUS,
@@ -569,7 +570,8 @@ go32_fetch_registers (int regno)
        supply_register (regno,
                         (char *) &npx + regno_mapping[regno].tss_ofs);
       else
-       fatal ("Invalid register no. %d in go32_fetch_register.", regno);
+       internal_error ("Invalid register no. %d in go32_fetch_register.",
+                       regno);
     }
 }
 
@@ -586,7 +588,7 @@ store_register (int regno)
   else if (regno < 31)
     rp = (char *) &npx + regno_mapping[regno].tss_ofs;
   else
-    fatal ("Invalid register no. %d in store_register.", regno);
+    internal_error ("Invalid register no. %d in store_register.", regno);
   memcpy (rp, v, regno_mapping[regno].size);
 }
 
@@ -679,7 +681,7 @@ go32_create_inferior (char *exec_file, char *args, char **env)
   resume_is_step = 0;
   /* Init command line storage.  */
   if (redir_debug_init (&child_cmd) == -1)
-    fatal ("Cannot allocate redirection storage: not enough memory.\n");
+    internal_error ("Cannot allocate redirection storage: not enough memory.\n");
 
   /* Parse the command line and create redirections.  */
   if (strpbrk (args, "<>"))
@@ -690,7 +692,7 @@ go32_create_inferior (char *exec_file, char *args, char **env)
        error ("Syntax error in command line.");
     }
   else
-    child_cmd.command = strdup (args);
+    child_cmd.command = xstrdup (args);
 
   cmdline = (char *) alloca (strlen (args) + 4);
   cmdline[0] = strlen (args);
@@ -716,7 +718,7 @@ go32_create_inferior (char *exec_file, char *args, char **env)
   push_target (&go32_ops);
   clear_proceed_status ();
   insert_breakpoints ();
-  proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_0, 0);
+  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
   prog_has_started = 1;
 }
 
@@ -797,6 +799,7 @@ ignore (void)
   do {\
     CONTROL &= ~(DR_CONTROL_MASK << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (index)));\
     D_REGS[index] = address;\
+    dr_ref_count[index]++;\
   } while(0)
 
 #define SET_WATCH(index,address,rw,len) \
@@ -808,11 +811,7 @@ ignore (void)
 #define IS_WATCH(index) \
   (CONTROL & (DR_CONTROL_MASK << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE*(index))))
 
-#define WATCH_HIT(index) \
-  (\
-   (STATUS & (1 << index)) && \
-   (CONTROL & (DR_CONTROL_MASK << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * index)))\
-  )
+#define WATCH_HIT(index) ((STATUS & (1 << (index))) && IS_WATCH(index))
 
 #define DR_DEF(index) \
   ((CONTROL >> (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (index))) & 0x0f)
@@ -1142,10 +1141,6 @@ go32_insert_hw_breakpoint (CORE_ADDR addr, CORE_ADDR shadow)
   return i < 4 ? 0 : -1;
 }
 
-static int inf_flags_valid = 0;
-static int inf_in_flag;
-static int inf_out_flag;
-
 /* Put the device open on handle FD into either raw or cooked
    mode, return 1 if it was in raw mode, zero otherwise.  */
 
@@ -1317,7 +1312,7 @@ init_go32_ops (void)
 
   /* Initialize child's command line storage.  */
   if (redir_debug_init (&child_cmd) == -1)
-    fatal ("Cannot allocate redirection storage: not enough memory.\n");
+    internal_error ("Cannot allocate redirection storage: not enough memory.\n");
 }
 
 void
This page took 0.024766 seconds and 4 git commands to generate.