From 95b71071825df95482061f9e942be6615ad28303 Mon Sep 17 00:00:00 2001 From: Peter Schauer Date: Sat, 26 Apr 1997 09:44:30 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 10 ++++++++++ gdb/corelow.c | 4 ++-- gdb/procfs.c | 45 +++++++++++++++++++++++++++++++++------------ 3 files changed, 45 insertions(+), 14 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dc33c45f9b..5a27eeda07 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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 diff --git a/gdb/corelow.c b/gdb/corelow.c index c3ddebbd26..d7cab710c6 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -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) { diff --git a/gdb/procfs.c b/gdb/procfs.c index 539835e815..9d3c9697d6 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -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