Sun2 native support (untested).
[deliverable/binutils-gdb.git] / gdb / pyr-xdep.c
index 5ba4a8d41a4d587c627624d1fbe40772335ae731..84b01565a880621a24dabe92309f88e265d2d92e 100644 (file)
@@ -3,23 +3,21 @@
 
 This file is part of GDB.
 
-GDB is free software; you can redistribute it and/or modify
+This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
-GDB is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GDB; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+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"
 
@@ -33,11 +31,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/user.h>          /* After a.out.h  */
 #include <sys/file.h>
 #include <sys/stat.h>
+
 \f
 void
-fetch_inferior_registers ()
+fetch_inferior_registers (regno)
+     int regno;
 {
-  register int regno, datum;
+  register int datum;
   register unsigned int regaddr;
   int reg_buf[NUM_REGS+1];
   struct user u;
@@ -46,7 +46,7 @@ fetch_inferior_registers ()
   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",
@@ -63,8 +63,8 @@ fetch_inferior_registers ()
   }
   /* 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,7 +100,8 @@ fetch_inferior_registers ()
   
   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,
@@ -125,6 +126,7 @@ fetch_inferior_registers ()
    If REGNO is -1, do this for all registers.
    Otherwise, REGNO specifies which register (so we can save time).  */
 
+void
 store_inferior_registers (regno)
      int regno;
 {
@@ -137,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);
@@ -152,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);
@@ -273,17 +277,17 @@ core_file_command (filename, from_tty)
 
            if (*(int *)buf >= 0)
                    break;
-           printf ("skipping frame %0x\n", last_frame_address);
+           printf ("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 = 0x%08x\n",
-               u.u_pcb.pcb_csp);
-       printf ("offset to control stack %d outermost frame %d (%0x)\n",
-             reg_stack_offset, reg_offset, last_frame_address);
+       printf ("Control stack pointer = %s\n",
+               local_hex_string (u.u_pcb.pcb_csp));
+       printf ("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 */
 
 #else /* not PYRAMID_CORE */
@@ -342,12 +346,12 @@ core_file_command (filename, from_tty)
        corefile = savestring (filename, strlen (filename));
       else
        {
-         corefile = concat (current_directory, "/", filename);
+         corefile = concat (current_directory, "/", filename, NULL);
        }
 
 #if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
-      printf ("Providing CSP (%0x) as nominal address of current frame.\n",
-             last_frame_address);
+      printf ("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? */
 #if 0
This page took 0.02799 seconds and 4 git commands to generate.