* config/pa/tm-hppa.h: Define lots register offsets needed by
[deliverable/binutils-gdb.git] / gdb / pyr-xdep.c
index 4517c0b2224c080146c9bff09f919c3d198ba23e..bdfdd5f4ce1fa9bccd54d10ff3fa59e09c189d39 100644 (file)
@@ -46,16 +46,16 @@ fetch_inferior_registers (regno)
   registers_fetched ();
   
   for (regno = 0; regno < 64; regno++) {
-    reg_buf[regno] = ptrace (3, inferior_pid, regno, 0);
+    reg_buf[regno] = ptrace (3, inferior_pid, (PTRACE_ARG3_TYPE) regno, 0);
     
 #if defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
-    printf ("Fetching %s from inferior, got %0x\n",
+    printf_unfiltered ("Fetching register %s, got %0x\n",
            reg_names[regno],
            reg_buf[regno]);
 #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
     
     if (reg_buf[regno] == -1 && errno == EIO) {
-      printf("fetch_interior_registers: fetching %s from inferior\n",
+      printf_unfiltered("fetch_interior_registers: fetching register %s\n",
             reg_names[regno]);
       errno = 0;
     }
@@ -63,8 +63,8 @@ fetch_inferior_registers (regno)
   }
   /* that leaves regs 64, 65, and 66 */
   datum = ptrace (3, inferior_pid,
-                 ((char *)&u.u_pcb.pcb_csp) -
-                 ((char *)&u), 0);
+                 (PTRACE_ARG3_TYPE) (((char *)&u.u_pcb.pcb_csp) -
+                 ((char *)&u)), 0);
   
   
   
@@ -100,10 +100,11 @@ fetch_inferior_registers (regno)
   
   while (1) {
     register int inferior_saved_pc;
-    inferior_saved_pc = ptrace (1, inferior_pid, datum+((32+15)*4), 0);
+    inferior_saved_pc = ptrace (1, inferior_pid,
+                               (PTRACE_ARG3_TYPE) (datum+((32+15)*4)), 0);
     if (inferior_saved_pc > 0) break;
 #if defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
-    printf("skipping kernel frame %08x, pc=%08x\n", datum,
+    printf_unfiltered("skipping kernel frame %08x, pc=%08x\n", datum,
           inferior_saved_pc);
 #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
     skipped_frames++;
@@ -114,7 +115,7 @@ fetch_inferior_registers (regno)
   supply_register(CSP_REGNUM, reg_buf+CSP_REGNUM);
 #ifdef  PYRAMID_CONTROL_FRAME_DEBUGGING
   if (skipped_frames) {
-    fprintf (stderr,
+    fprintf_unfiltered (stderr,
             "skipped %d frames from %x to %x; cfp was %x, now %x\n",
             skipped_frames, reg_buf[CSP_REGNUM]);
   }
@@ -138,7 +139,8 @@ store_inferior_registers (regno)
        /*regaddr = register_addr (regno, offset);*/
        regaddr = regno;
        errno = 0;
-       ptrace (6, inferior_pid, regaddr, read_register (regno));
+       ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
+               read_register (regno));
        if (errno != 0)
          {
            sprintf (buf, "writing register number %d", regno);
@@ -153,7 +155,8 @@ store_inferior_registers (regno)
          /*regaddr = register_addr (regno, offset);*/
          regaddr = regno;
          errno = 0;
-         ptrace (6, inferior_pid, regaddr, read_register (regno));
+         ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
+                 read_register (regno));
          if (errno != 0)
            {
              sprintf (buf, "writing all regs, number %d", regno);
@@ -228,7 +231,7 @@ core_file_command (filename, from_tty)
       make_cleanup (free, filename);
       
       if (have_inferior_p ())
-       error ("To look at a core file, you must kill the inferior with \"kill\".");
+       error ("To look at a core file, you must kill the program with \"kill\".");
       corechan = open (filename, O_RDONLY, 0);
       if (corechan < 0)
        perror_with_name (filename);
@@ -274,16 +277,16 @@ core_file_command (filename, from_tty)
 
            if (*(int *)buf >= 0)
                    break;
-           printf ("skipping frame %s\n", local_hex_string (last_frame_address));
+           printf_unfiltered ("skipping frame %s\n", local_hex_string (last_frame_address));
            last_frame_offset -= CONTROL_STACK_FRAME_SIZE;
            last_frame_address -= CONTROL_STACK_FRAME_SIZE;
        }
        reg_offset = last_frame_offset;
 
 #if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
-       printf ("Control stack pointer = %s\n",
+       printf_unfiltered ("Control stack pointer = %s\n",
                local_hex_string (u.u_pcb.pcb_csp));
-       printf ("offset to control stack %d outermost frame %d (%s)\n",
+       printf_unfiltered ("offset to control stack %d outermost frame %d (%s)\n",
              reg_stack_offset, reg_offset, local_hex_string (last_frame_address));
 #endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
 
@@ -329,7 +332,7 @@ core_file_command (filename, from_tty)
              if (val < 0)
                perror_with_name (filename);
 #ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
-      printf ("[reg %s(%d), offset in file %s=0x%0x, addr =0x%0x, =%0x]\n",
+      printf_unfiltered ("[reg %s(%d), offset in file %s=0x%0x, addr =0x%0x, =%0x]\n",
              reg_names[regno], regno, filename,
              register_addr(regno, reg_offset),
              regno * 4 + last_frame_address,
@@ -347,7 +350,7 @@ core_file_command (filename, from_tty)
        }
 
 #if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
-      printf ("Providing CSP (%s) as nominal address of current frame.\n",
+      printf_unfiltered ("Providing CSP (%s) as nominal address of current frame.\n",
              local_hex_string(last_frame_address));
 #endif PYRAMID_CONTROL_FRAME_DEBUGGING
       /* FIXME: Which of the following is correct? */
@@ -363,5 +366,5 @@ core_file_command (filename, from_tty)
       validate_files ();
     }
   else if (from_tty)
-    printf ("No core file now.\n");
+    printf_unfiltered ("No core file now.\n");
 }
This page took 0.027376 seconds and 4 git commands to generate.