* procfs.c (proc_wait): Call print_sys_errmsg() if we get an
[deliverable/binutils-gdb.git] / gdb / i386-xdep.c
index 243e05763b1994b01f6029fe8db24de809b0e13b..67e904b83421fa6febfb91b9fed34ba5f79e1b4b 100644 (file)
@@ -17,9 +17,7 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-#include <stdio.h>
 #include "defs.h"
-#include "param.h"
 #include "frame.h"
 #include "inferior.h"
 #include "language.h"
@@ -42,12 +40,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/reg.h>
 #include "ieee-float.h"
 
-extern void print_387_control_word ();         /* i387-tdep.h */
-extern void print_387_status_word ();
+#include "target.h"
 
 extern struct ext_format ext_format_i387;
 \f
-/* this table must line up with REGISTER_NAMES in m-i386.h */
+/* this table must line up with REGISTER_NAMES in tm-i386v.h */
 /* symbols like 'EAX' come from <sys/reg.h> */
 static int regmap[] = 
 {
@@ -60,7 +57,11 @@ static int regmap[] =
 /* blockend is the value of u.u_ar0, and points to the
  * place where GS is stored
  */
+
+int
 i386_register_u_addr (blockend, regnum)
+     int blockend;
+     int regnum;
 {
 #if 0
   /* this will be needed if fp registers are reinstated */
@@ -81,6 +82,9 @@ i386_register_u_addr (blockend, regnum)
   
 }
 
+#if 0
+/* mauro@olympus 1991.10.20 -- compiling the following code causes
+   undefined symbols at link time, specifically: corechan, have_inferior_p */
 struct env387 
 {
   unsigned short control;
@@ -156,13 +160,13 @@ print_387_status (status, ep)
       printf ("  %g\n", val);
     }
   if (ep->r0)
-    printf ("warning: reserved0 is %s\n", local_hex_string(ep->r0));
+    warning ("reserved0 is %s\n", local_hex_string(ep->r0));
   if (ep->r1)
-    printf ("warning: reserved1 is %s\n", local_hex_string(ep->r1));
+    warning ("reserved1 is %s\n", local_hex_string(ep->r1));
   if (ep->r2)
-    printf ("warning: reserved2 is %s\n", local_hex_string(ep->r2));
+    warning ("reserved2 is %s\n", local_hex_string(ep->r2));
   if (ep->r3)
-    printf ("warning: reserved3 is %s\n", local_hex_string(ep->r3));
+    warning ("reserved3 is %s\n", local_hex_string(ep->r3));
 }
 
 #ifndef U_FPSTATE
@@ -177,24 +181,25 @@ i386_float_info ()
   struct fpstate *fpstatep;
   char buf[sizeof (struct fpstate) + 2 * sizeof (int)];
   unsigned int uaddr;
-  char fpvalid;
+  char fpvalid = 0;
   unsigned int rounded_addr;
   unsigned int rounded_size;
   extern int corechan;
   int skip;
   
   uaddr = (char *)&u.u_fpvalid - (char *)&u;
-  if (have_inferior_p()) 
+  if (target_has_execution)
     {
       unsigned int data;
       unsigned int mask;
       
       rounded_addr = uaddr & -sizeof (int);
-      data = ptrace (3, inferior_pid, rounded_addr, 0);
+      data = ptrace (3, inferior_pid, (PTRACE_ARG3_TYPE) rounded_addr, 0);
       mask = 0xff << ((uaddr - rounded_addr) * 8);
       
       fpvalid = ((data & mask) != 0);
     } 
+#if 0
   else 
     {
       if (lseek (corechan, uaddr, 0) < 0)
@@ -203,6 +208,7 @@ i386_float_info ()
        perror ("read on core file");
       
     }
+#endif /* no core support yet */
   
   if (fpvalid == 0) 
     {
@@ -211,7 +217,7 @@ i386_float_info ()
     }
   
   uaddr = (char *)&U_FPSTATE(u) - (char *)&u;
-  if (have_inferior_p ()) 
+  if (target_has_execution)
     {
       int *ip;
       
@@ -223,10 +229,11 @@ i386_float_info ()
       ip = (int *)buf;
       for (i = 0; i < rounded_size; i++) 
        {
-         *ip++ = ptrace (3, inferior_pid, rounded_addr, 0);
+         *ip++ = ptrace (3, inferior_pid, (PTRACE_ARG3_TYPE) rounded_addr, 0);
          rounded_addr += sizeof (int);
        }
     } 
+#if 0
   else 
     {
       if (lseek (corechan, uaddr, 0) < 0)
@@ -235,7 +242,9 @@ i386_float_info ()
        perror_with_name ("read from core file");
       skip = 0;
     }
-  
+ #endif        /* 0 */ 
+
   fpstatep = (struct fpstate *)(buf + skip);
   print_387_status (fpstatep->status, (struct env387 *)fpstatep->state);
 }
+#endif /* mauro@olympus 1991.10.20 */
This page took 0.025931 seconds and 4 git commands to generate.