aboutsummaryrefslogtreecommitdiff
path: root/gdb/procfs.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-11-09 01:23:30 +0000
committerJason Molenda <jmolenda@apple.com>1999-11-09 01:23:30 +0000
commit11cf87416416e13eff634a70b4954fe6a3912720 (patch)
treea6dc7a21bb3d45b89c3f95e4b5862ec9d2fab83b /gdb/procfs.c
parent98007ce7b0dea06f0c04d833d39b5a9c9773a07a (diff)
downloadgdb-11cf87416416e13eff634a70b4954fe6a3912720.zip
gdb-11cf87416416e13eff634a70b4954fe6a3912720.tar.gz
gdb-11cf87416416e13eff634a70b4954fe6a3912720.tar.bz2
import gdb-1999-11-08 snapshot
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r--gdb/procfs.c50
1 files changed, 36 insertions, 14 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 83e58db..4f1c54f 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -2003,7 +2003,6 @@ unconditionally_kill_inferior (pi)
struct procinfo *pi;
{
int ppid;
- struct proc_ctl pctl;
ppid = pi->prstatus.pr_ppid;
@@ -2231,8 +2230,9 @@ init_procinfo (pid, kill)
{
struct procinfo *pi = (struct procinfo *)
xmalloc (sizeof (struct procinfo));
+#ifdef UNIXWARE
struct sig_ctl sctl;
- struct flt_ctl fctl;
+#endif /* UNIXWARE */
memset ((char *) pi, 0, sizeof (*pi));
if (!open_proc_file (pid, pi, O_RDWR, 1))
@@ -2313,8 +2313,9 @@ create_procinfo (pid)
int pid;
{
struct procinfo *pi;
- struct sig_ctl sctl;
+#ifdef PROCFS_USE_READ_WRITE
struct flt_ctl fctl;
+#endif
pi = find_procinfo (pid, 1);
if (pi != NULL)
@@ -2381,7 +2382,9 @@ procfs_exit_handler (pi, syscall_num, why, rtnvalp, statvalp)
int *statvalp;
{
struct procinfo *temp_pi, *next_pi;
+#if defined (UNIXWARE) || defined (PROCFS_USE_READ_WRITE)
struct proc_ctl pctl;
+#endif
#ifdef UNIXWARE
pctl.cmd = PCRUN;
@@ -2913,7 +2916,9 @@ proc_set_exec_trap ()
#ifdef PR_ASYNC
{
long pr_flags;
+#ifdef PROCFS_USE_READ_WRITE
struct proc_ctl pctl;
+#endif
/* Solaris needs this to make procfs treat all threads seperately. Without
this, all threads halt whenever something happens to any thread. Since
@@ -3250,8 +3255,9 @@ do_attach (pid)
int pid;
{
struct procinfo *pi;
- struct sig_ctl sctl;
+#ifdef PROCFS_USE_READ_WRITE
struct flt_ctl fctl;
+#endif
int nlwp, *lwps;
pi = init_procinfo (pid, 0);
@@ -3285,7 +3291,9 @@ do_attach (pid)
pi->was_stopped = 0;
if (1 || query ("Process is currently running, stop it? "))
{
+#ifdef PROCFS_USE_READ_WRITE
long cmd;
+#endif
/* Make it run again when we close it. */
modify_run_on_last_close_flag (pi->ctl_fd, 1);
#ifdef PROCFS_USE_READ_WRITE
@@ -3447,8 +3455,9 @@ do_detach (signal)
if (signal
|| (THE_PR_LWP (pi->prstatus).pr_flags & (PR_STOPPED | PR_ISTOP)))
{
+#ifdef PROCFS_USE_READ_WRITE
long cmd;
- struct proc_ctl pctl;
+#endif
if (signal || !pi->was_stopped ||
query ("Was stopped when attached, make it runnable again? "))
@@ -3516,7 +3525,6 @@ procfs_wait (pid, ourstatus)
int checkerr = 0;
int rtnval = -1;
struct procinfo *pi;
- struct proc_ctl pctl;
scan_again:
@@ -3783,7 +3791,9 @@ set_proc_siginfo (pip, signo)
{
struct siginfo newsiginfo;
struct siginfo *sip;
+#if defined (UNIXWARE) || defined (PROCFS_USE_READ_WRITE)
struct sigi_ctl sictl;
+#endif
#ifdef PROCFS_DONT_PIOCSSIG_CURSIG
/* With Alpha OSF/1 procfs, the kernel gets really confused if it
@@ -3844,7 +3854,9 @@ procfs_resume (pid, step, signo)
{
int signal_to_pass;
struct procinfo *pi, *procinfo, *next_pi;
+#if defined (UNIXWARE) || defined (PROCFS_USE_READ_WRITE)
struct proc_ctl pctl;
+#endif
pi = find_procinfo (pid == -1 ? inferior_pid : pid, 0);
@@ -4791,7 +4803,9 @@ info_proc_mappings (pip, summary)
int nmap;
struct prmap *prmaps;
struct prmap *prmap;
+#ifdef PROCFS_USE_READ_WRITE
struct stat sbuf;
+#endif
if (!summary)
{
@@ -5116,7 +5130,9 @@ modify_inherit_on_fork_flag (fd, flag)
long pr_flags;
#endif
int retval = 0;
+#ifdef PROCFS_USE_READ_WRITE
struct proc_ctl pctl;
+#endif
#if defined (PIOCSET) || defined (PCSET) /* New method */
pr_flags = PR_FORK;
@@ -5192,7 +5208,9 @@ modify_run_on_last_close_flag (fd, flag)
long pr_flags;
#endif
int retval = 0;
+#ifdef PROCFS_USE_READ_WRITE
struct proc_ctl pctl;
+#endif
#if defined (PIOCSET) || defined (PCSET) /* New method */
pr_flags = PR_RLC;
@@ -5473,7 +5491,9 @@ procfs_lwp_creation_handler (pi, syscall_num, why, rtnvalp, statvalp)
{
int lwp_id;
struct procinfo *childpi;
+#ifdef UNIXWARE
struct proc_ctl pctl;
+#endif
/* We've just detected the completion of an lwp_create system call. Now we
need to setup a procinfo struct for this thread, and notify the thread
@@ -5781,14 +5801,16 @@ procfs_thread_alive (pid)
{
next_pi = pi->next;
if (pi->pid == pid)
- if (procfs_read_status (pi)) /* alive */
- return 1;
- else
- /* defunct (exited) */
- {
- close_proc_file (pi);
- return 0;
- }
+ {
+ if (procfs_read_status (pi)) /* alive */
+ return 1;
+ else
+ /* defunct (exited) */
+ {
+ close_proc_file (pi);
+ return 0;
+ }
+ }
}
return 0;
}