]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* corelow.c (get_core_registers): Initialize cf.
authorPeter Schauer <Peter.Schauer@mytum.de>
Sat, 26 Apr 1997 09:44:30 +0000 (09:44 +0000)
committerPeter Schauer <Peter.Schauer@mytum.de>
Sat, 26 Apr 1997 09:44:30 +0000 (09:44 +0000)
* procfs.c:  Minor changes to make pre-ANSI compilers happy.
(procfs_notice_signals):  Copy traced signal set back to
pi->prrun.pr_trace.
(unconditionally_kill_inferior):  If PR_DEAD is defined,
rerun inferior after killing it.

gdb/ChangeLog
gdb/corelow.c
gdb/procfs.c

index dc33c45f9b0bf11483dc49eb6b63cb86a7a57bff..5a27eeda07652bbc3bb7e45efbaac42e5d4f26c7 100644 (file)
@@ -1,3 +1,13 @@
+Sat Apr 26 02:42:52 1997  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
+
+       * corelow.c (get_core_registers):  Initialize cf.
+
+       * procfs.c:  Minor changes to make pre-ANSI compilers happy.
+       (procfs_notice_signals):  Copy traced signal set back to
+       pi->prrun.pr_trace.
+       (unconditionally_kill_inferior):  If PR_DEAD is defined,
+       rerun inferior after killing it.
+
 Fri Apr 25 00:10:18 1997  Jeffrey A Law  (law@cygnus.com)
 
        * config/mn10300/tm-mn10300.h (EXTRACT_STRUCT_VALUE_ADDRESS): The
index c3ddebbd26d614f2120cf6238928ade0deb7b644..d7cab710c61dd62895afce4dc02c116954da3260 100644 (file)
@@ -1,5 +1,5 @@
 /* Core dump and executable file functions below target vector, for GDB.
-   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996
+   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997
    Free Software Foundation, Inc.
 
 This file is part of GDB.
@@ -280,7 +280,7 @@ get_core_registers (regno)
   char *the_regs;
   char secname[10];
   enum bfd_flavour our_flavour = bfd_get_flavour (core_bfd);
-  struct core_fns *cf;
+  struct core_fns *cf = NULL;
 
   if (core_file_fns == NULL)
     {
index 539835e815e3fe55f20dfa35d77f0f2848817f87..9d3c9697d606ea08dc83da3fd8fea7fc8c28fab5 100644 (file)
@@ -65,19 +65,19 @@ regardless of whether or not the actual target has floating point hardware.
 
 /* proc name formats may vary depending on the proc implementation */
 #ifdef HAVE_MULTIPLE_PROC_FDS
-  #ifndef CTL_PROC_NAME_FMT
-  #define CTL_PROC_NAME_FMT "/proc/%d/ctl"
-  #define AS_PROC_NAME_FMT "/proc/%d/as"
-  #define MAP_PROC_NAME_FMT "/proc/%d/map"
-  #define STATUS_PROC_NAME_FMT "/proc/%d/status"
-  #endif
+#  ifndef CTL_PROC_NAME_FMT
+#  define CTL_PROC_NAME_FMT "/proc/%d/ctl"
+#  define AS_PROC_NAME_FMT "/proc/%d/as"
+#  define MAP_PROC_NAME_FMT "/proc/%d/map"
+#  define STATUS_PROC_NAME_FMT "/proc/%d/status"
+#  endif
 #else /* HAVE_MULTIPLE_PROC_FDS */
-  #ifndef CTL_PROC_NAME_FMT
-  #define CTL_PROC_NAME_FMT "/proc/%05d"
-  #define AS_PROC_NAME_FMT "/proc/%05d"
-  #define MAP_PROC_NAME_FMT "/proc/%05d"
-  #define STATUS_PROC_NAME_FMT "/proc/%05d"
-  #endif
+#  ifndef CTL_PROC_NAME_FMT
+#  define CTL_PROC_NAME_FMT "/proc/%05d"
+#  define AS_PROC_NAME_FMT "/proc/%05d"
+#  define MAP_PROC_NAME_FMT "/proc/%05d"
+#  define STATUS_PROC_NAME_FMT "/proc/%05d"
+#  endif
 #endif /* HAVE_MULTIPLE_PROC_FDS */
 
 #define MAX_PROC_NAME_SIZE sizeof("/proc/1234567890/status")
@@ -1740,6 +1740,23 @@ unconditionally_kill_inferior (pi)
   procfs_write_pckill (pi);
 #endif /* PROCFS_NEED_PIOCSSIG_FOR_KILL */
 
+#ifdef PR_DEAD
+  /* With Alpha OSF/1 procfs, the process remains stopped after the inferior
+     gets killed. After some time, the stop reason of the inferior changes
+     to PR_DEAD and a PIOCRUN ioctl must be used to finally terminate the
+     process.  While the stop reason has not yet changed to PR_DEAD,
+     the PIOCRUN will return with EAGAIN, and we keep trying.
+     Any other errors are silently ignored as the inferior might have
+     died already.  */
+  while (procfs_read_status (pi) && (pi->prstatus.pr_flags & PR_STOPPED))
+    {
+      pi->prrun.pr_flags = PRCFAULT;
+      if (ioctl (pi->ctl_fd, PIOCRUN, &pi->prrun) >= 0 || errno != EAGAIN)
+        break;
+      sleep (1);
+    }
+#endif
+
   close_proc_file (pi);
 
 /* Only wait() for our direct children.  Our grandchildren zombies are killed
@@ -2340,6 +2357,10 @@ procfs_notice_signals (pid)
 #endif
 
   notice_signals (pi, &sctl);
+
+#ifndef UNIXWARE
+  pi->prrun.pr_trace = sctl.sigset;
+#endif
 }
 
 static void