* Rename remote-es1800.c to remote-es.c
[deliverable/binutils-gdb.git] / gdb / procfs.c
index 6254c9c421f8c16020ebf3c43e853bcd39aa630c..2b1b66099bebdd9af65397fb6bf8f7313f25afc3 100644 (file)
@@ -416,6 +416,9 @@ do_detach PARAMS ((int siggnal));
 static void
 procfs_create_inferior PARAMS ((char *, char *, char **));
 
+static void
+procfs_notice_signals PARAMS ((void));
+
 /* External function prototypes that can't be easily included in any
    header file because the args are typedefs in system include files. */
 
@@ -1267,7 +1270,7 @@ procfs_init_inferior (pid)
     {
       memset ((char *) &pi.prrun, 0, sizeof (pi.prrun));
       prfillset (&pi.prrun.pr_trace);
-      proc_signal_handling_change ();
+      procfs_notice_signals ();
       prfillset (&pi.prrun.pr_fault);
       prdelset (&pi.prrun.pr_fault, FLTPAGE);
       if (ioctl (pi.fd, PIOCWSTOP, &pi.prstatus) < 0)
@@ -1285,11 +1288,11 @@ procfs_init_inferior (pid)
 
 GLOBAL FUNCTION
 
-       proc_signal_handling_change
+       procfs_notice_signals
 
 SYNOPSIS
 
-       void proc_signal_handling_change (void);
+       static void procfs_notice_signals (void);
 
 DESCRIPTION
 
@@ -1306,8 +1309,8 @@ DESCRIPTION
        involved.
  */
 
-void
-proc_signal_handling_change ()
+static void
+procfs_notice_signals ()
 {
   int signo;
 
@@ -1775,7 +1778,7 @@ do_attach (pid)
   
   memset (&pi.prrun, 0, sizeof (pi.prrun));
   prfillset (&pi.prrun.pr_trace);
-  proc_signal_handling_change ();
+  procfs_notice_signals ();
   prfillset (&pi.prrun.pr_fault);
   prdelset (&pi.prrun.pr_fault, FLTPAGE);
   if (ioctl (pi.fd, PIOCSFAULT, &pi.prrun.pr_fault))
@@ -1953,10 +1956,17 @@ procfs_wait (statloc)
     }
   else if (!(pi.prstatus.pr_flags & (PR_STOPPED | PR_ISTOP)))
     {
+      if (attach_flag)
+       set_sigint_trap();      /* Causes SIGINT to be passed on to the
+                                  attached process. */
+
       if (ioctl (pi.fd, PIOCWSTOP, &pi.prstatus) < 0)
        {
          checkerr++;
        }
+
+      if (attach_flag)
+       clear_sigint_trap();
     }    
   if (checkerr)
     {
@@ -2250,66 +2260,6 @@ procfs_fetch_registers (regno)
 
 /*
 
-GLOBAL FUNCTION
-
-       fetch_core_registers -- fetch current registers from core file data
-
-SYNOPSIS
-
-       void fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
-                                  int which, unsigned in reg_addr)
-
-DESCRIPTION
-
-       Read the values of either the general register set (WHICH equals 0)
-       or the floating point register set (WHICH equals 2) from the core
-       file data (pointed to by CORE_REG_SECT), and update gdb's idea of
-       their current values.  The CORE_REG_SIZE parameter is ignored.
-
-NOTES
-
-       Use the indicated sizes to validate the gregset and fpregset
-       structures.
-*/
-
-void
-fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
-     char *core_reg_sect;
-     unsigned core_reg_size;
-     int which;
-     unsigned int reg_addr;    /* Unused in this version */
-{
-
-  if (which == 0)
-    {
-      if (core_reg_size != sizeof (pi.gregset))
-       {
-         warning ("wrong size gregset struct in core file");
-       }
-      else
-       {
-         memcpy ((char *) &pi.gregset, core_reg_sect, sizeof (pi.gregset));
-         supply_gregset (&pi.gregset);
-       }
-    }
-  else if (which == 2)
-    {
-      if (core_reg_size != sizeof (pi.fpregset))
-       {
-         warning ("wrong size fpregset struct in core file");
-       }
-      else
-       {
-         memcpy ((char *) &pi.fpregset, core_reg_sect, sizeof (pi.fpregset));
-#if defined (FP0_REGNUM)
-         supply_fpregset (&pi.fpregset);
-#endif
-       }
-    }
-}
-
-/*
-
 LOCAL FUNCTION
 
        proc_init_failed - called whenever /proc access initialization fails
@@ -3011,7 +2961,8 @@ info_proc (args, from_tty)
 
   if (!pip -> valid)
     {
-      error ("No process.  Run an inferior or specify an explicit pid.");
+      error ("\
+No process.  Start debugging a program or specify an explicit process ID.");
     }
   if (ioctl (pip -> fd, PIOCSTATUS, &(pip -> prstatus)) < 0)
     {
@@ -3118,6 +3069,7 @@ struct target_ops procfs_ops = {
   procfs_create_inferior,      /* to_create_inferior */
   procfs_mourn_inferior,       /* to_mourn_inferior */
   procfs_can_run,              /* to_can_run */
+  procfs_notice_signals,       /* to_notice_signals */
   process_stratum,             /* to_stratum */
   0,                           /* to_next */
   1,                           /* to_has_all_memory */
This page took 0.025263 seconds and 4 git commands to generate.