* Support debugging using native MACH primitives on hppa*-*-osf*.
[deliverable/binutils-gdb.git] / gdb / i386m3-nat.c
index df42662f006cbc5e4f71fbaebee14826b60b41db..6581a8660a77afa18abf312f62252cf9ae26c0b0 100644 (file)
@@ -19,6 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
+#include "floatformat.h"
 
 #include <stdio.h>
 
@@ -55,8 +56,6 @@ FIXME!! UPAGES is neither 2 nor 16
 extern void print_387_control_word ();         /* i387-tdep.h */
 extern void print_387_status_word ();
 
-extern struct ext_format ext_format_i387;
-
 #define private static
 
 \f
@@ -87,13 +86,13 @@ static int reg_offset[] =
 #define FETCH_REGS(state, regnum, count) \
   memcpy (&registers[REGISTER_BYTE (regnum)], \
          REG_ADDRESS (state, regnum), \
-         count*sizeof (REGISTER_TYPE))
+         count*REGISTER_SIZE)
 
 /* Store COUNT contiguous registers to thread STATE starting from REGNUM */
 #define STORE_REGS(state, regnum, count) \
   memcpy (REG_ADDRESS (state, regnum), \
          &registers[REGISTER_BYTE (regnum)], \
-         count*sizeof (REGISTER_TYPE))
+         count*REGISTER_SIZE)
 \f
 /*
  * Fetch inferiors registers for gdb.
@@ -121,7 +120,7 @@ fetch_inferior_registers (regno)
                          &stateCnt);
 
   if (ret != KERN_SUCCESS)
-    message ("fetch_inferior_registers: %s ",
+    warning ("fetch_inferior_registers: %s ",
             mach_error_string (ret));
 #if 0
   /* It may be more effective to store validate all of them,
@@ -169,7 +168,7 @@ store_inferior_registers (regno)
 
    if (ret != KERN_SUCCESS) 
     {
-      message ("store_inferior_registers (get): %s",
+      warning ("store_inferior_registers (get): %s",
               mach_error_string (ret));
       if (must_suspend_thread)
        setup_thread (current_thread, 0);
@@ -200,7 +199,7 @@ store_inferior_registers (regno)
                          i386_THREAD_STATE_COUNT);
   
   if (ret != KERN_SUCCESS)
-    message ("store_inferior_registers (set): %s",
+    warning ("store_inferior_registers (set): %s",
             mach_error_string (ret));
 
   if (must_suspend_thread)
@@ -275,56 +274,56 @@ print_387_status (status, ep)
   if (status != 0) 
     {
       if (bothstatus)
-       printf ("u: ");
+       printf_unfiltered ("u: ");
       print_387_status_word (status);
     }
   
   if (ep->status != 0) 
     {
       if (bothstatus)
-       printf ("e: ");
+       printf_unfiltered ("e: ");
       print_387_status_word (ep->status);
     }
   
   print_387_control_word (ep->control);
-  printf ("last exception: ");
-  printf ("opcode %s; ", local_hex_string(ep->opcode));
-  printf ("pc %s:", local_hex_string(ep->code_seg));
-  printf ("%s; ", local_hex_string(ep->eip));
-  printf ("operand %s", local_hex_string(ep->operand_seg));
-  printf (":%s\n", local_hex_string(ep->operand));
+  printf_unfiltered ("last exception: ");
+  printf_unfiltered ("opcode %s; ", local_hex_string(ep->opcode));
+  printf_unfiltered ("pc %s:", local_hex_string(ep->code_seg));
+  printf_unfiltered ("%s; ", local_hex_string(ep->eip));
+  printf_unfiltered ("operand %s", local_hex_string(ep->operand_seg));
+  printf_unfiltered (":%s\n", local_hex_string(ep->operand));
   
   top = (ep->status >> 11) & 7;
   
-  printf ("regno  tag  msb              lsb  value\n");
+  printf_unfiltered ("regno  tag  msb              lsb  value\n");
   for (fpreg = 7; fpreg >= 0; fpreg--) 
     {
       double val;
       
-      printf ("%s %d: ", fpreg == top ? "=>" : "  ", fpreg);
+      printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : "  ", fpreg);
       
       switch ((ep->tag >> (fpreg * 2)) & 3) 
        {
-       case 0: printf ("valid "); break;
-       case 1: printf ("zero  "); break;
-       case 2: printf ("trap  "); break;
-       case 3: printf ("empty "); break;
+       case 0: printf_unfiltered ("valid "); break;
+       case 1: printf_unfiltered ("zero  "); break;
+       case 2: printf_unfiltered ("trap  "); break;
+       case 3: printf_unfiltered ("empty "); break;
        }
       for (i = 9; i >= 0; i--)
-       printf ("%02x", ep->regs[fpreg][i]);
+       printf_unfiltered ("%02x", ep->regs[fpreg][i]);
       
-      ieee_extended_to_double (&ext_format_i387, (char *)ep->regs[fpreg],
+      floatformat_to_double (&floatformat_i387_ext, (char *)ep->regs[fpreg],
                               &val);
-      printf ("  %g\n", val);
+      printf_unfiltered ("  %g\n", val);
     }
   if (ep->r0)
-    printf ("warning: reserved0 is %s\n", local_hex_string(ep->r0));
+    printf_unfiltered ("warning: reserved0 is %s\n", local_hex_string(ep->r0));
   if (ep->r1)
-    printf ("warning: reserved1 is %s\n", local_hex_string(ep->r1));
+    printf_unfiltered ("warning: reserved1 is %s\n", local_hex_string(ep->r1));
   if (ep->r2)
-    printf ("warning: reserved2 is %s\n", local_hex_string(ep->r2));
+    printf_unfiltered ("warning: reserved2 is %s\n", local_hex_string(ep->r2));
   if (ep->r3)
-    printf ("warning: reserved3 is %s\n", local_hex_string(ep->r3));
+    printf_unfiltered ("warning: reserved3 is %s\n", local_hex_string(ep->r3));
 }
        
 /*
@@ -363,7 +362,7 @@ get_i387_state (fstate)
 
   if (ret != KERN_SUCCESS)
     {
-      message ("Can not get live floating point state: %s",
+      warning ("Can not get live floating point state: %s",
               mach_error_string (ret));
       return FALSE;
     }
@@ -376,7 +375,7 @@ get_i387_state (fstate)
   /* Clear the target then copy thread's float state there.
      Make a copy of the status word, for some reason?
    */
-  bzero (fstate, sizeof(struct fpstate));
+  memset (fstate, 0, sizeof (struct fpstate));
 
   fstate->status = fsp->exc_status;
 
@@ -412,7 +411,7 @@ i386_mach3_float_info()
 
   if (!valid) 
     {
-      message("no floating point status saved");
+      warning ("no floating point status saved");
       return;
     }
   
This page took 0.03024 seconds and 4 git commands to generate.