/* Machine independent support for SVR4 /proc (process file system) for GDB.
- Copyright 1999 Free Software Foundation, Inc.
+ Copyright 1999-2000 Free Software Foundation, Inc.
Written by Michael Snyder at Cygnus Solutions.
Based on work by Fred Fish, Stu Grossman, Geoff Noer, and others.
#ifdef NEW_PROC_API
#include <sys/types.h>
-#include <dirent.h> /* opendir/readdir, for listing the LWP's */
+#include "gdb_dirent.h" /* opendir/readdir, for listing the LWP's */
#endif
#include <fcntl.h> /* for O_RDONLY */
#include "proc-utils.h"
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
+
/* =================== TARGET_OPS "MODULE" =================== */
/*
* This module defines the GDB target vector and its methods.
*/
-static void procfs_open PARAMS((char *, int));
-static void procfs_attach PARAMS ((char *, int));
-static void procfs_detach PARAMS ((char *, int));
-static void procfs_resume PARAMS ((int, int, enum target_signal));
-static int procfs_can_run PARAMS ((void));
-static void procfs_stop PARAMS ((void));
-static void procfs_files_info PARAMS ((struct target_ops *));
-static void procfs_fetch_registers PARAMS ((int));
-static void procfs_store_registers PARAMS ((int));
-static void procfs_notice_signals PARAMS ((int));
-static void procfs_prepare_to_store PARAMS ((void));
-static void procfs_kill_inferior PARAMS ((void));
-static void procfs_mourn_inferior PARAMS ((void));
-static void procfs_create_inferior PARAMS ((char *, char *, char **));
-static int procfs_wait PARAMS ((int,
- struct target_waitstatus *));
-static int procfs_xfer_memory PARAMS ((CORE_ADDR,
- char *, int, int,
- struct target_ops *));
-
-static int procfs_thread_alive PARAMS ((int));
-
-void procfs_find_new_threads PARAMS ((void));
-char *procfs_pid_to_str PARAMS ((int));
+static void procfs_open (char *, int);
+static void procfs_attach (char *, int);
+static void procfs_detach (char *, int);
+static void procfs_resume (int, int, enum target_signal);
+static int procfs_can_run (void);
+static void procfs_stop (void);
+static void procfs_files_info (struct target_ops *);
+static void procfs_fetch_registers (int);
+static void procfs_store_registers (int);
+static void procfs_notice_signals (int);
+static void procfs_prepare_to_store (void);
+static void procfs_kill_inferior (void);
+static void procfs_mourn_inferior (void);
+static void procfs_create_inferior (char *, char *, char **);
+static int procfs_wait (int, struct target_waitstatus *);
+static int procfs_xfer_memory (CORE_ADDR,
+ char *, int, int, struct target_ops *);
+
+static int procfs_thread_alive (int);
+
+void procfs_find_new_threads (void);
+char *procfs_pid_to_str (int);
struct target_ops procfs_ops; /* the target vector */
static void
-init_procfs_ops ()
+init_procfs_ops (void)
{
procfs_ops.to_shortname = "procfs";
procfs_ops.to_longname = "Unix /proc child process";
typedef prstatus_t gdb_lwpstatus_t;
#endif /* NEW_PROC_API */
-
-/* These #ifdefs are for sol2.x in particular. sol2.x has
- both a "gregset_t" and a "prgregset_t", which have
- similar uses but different layouts. sol2.x gdb tries to
- use prgregset_t (and prfpregset_t) everywhere. */
-
-#ifdef GDB_GREGSET_TYPE
- typedef GDB_GREGSET_TYPE gdb_gregset_t;
-#else
- typedef gregset_t gdb_gregset_t;
-#endif
-
-#ifdef GDB_FPREGSET_TYPE
- typedef GDB_FPREGSET_TYPE gdb_fpregset_t;
-#else
- typedef fpregset_t gdb_fpregset_t;
-#endif
-
/* Provide default composite pid manipulation macros for systems that
don't have threads. */
/* Function prototypes for procinfo module: */
-static procinfo *find_procinfo_or_die PARAMS ((int pid, int tid));
-static procinfo *find_procinfo PARAMS ((int pid, int tid));
-static procinfo *create_procinfo PARAMS ((int pid, int tid));
-static void destroy_procinfo PARAMS ((procinfo *p));
+static procinfo *find_procinfo_or_die (int pid, int tid);
+static procinfo *find_procinfo (int pid, int tid);
+static procinfo *create_procinfo (int pid, int tid);
+static void destroy_procinfo (procinfo * p);
static void do_destroy_procinfo_cleanup (void *);
-static void dead_procinfo PARAMS ((procinfo *p,
- char *msg, int killp));
-static int open_procinfo_files PARAMS ((procinfo *p, int which));
-static void close_procinfo_files PARAMS ((procinfo *p));
+static void dead_procinfo (procinfo * p, char *msg, int killp);
+static int open_procinfo_files (procinfo * p, int which);
+static void close_procinfo_files (procinfo * p);
/* The head of the procinfo list: */
static procinfo * procinfo_list;
*/
static procinfo *
-find_procinfo (pid, tid)
- int pid;
- int tid;
+find_procinfo (int pid, int tid)
{
procinfo *pi;
*/
static procinfo *
-find_procinfo_or_die (pid, tid)
- int pid;
- int tid;
+find_procinfo_or_die (int pid, int tid)
{
procinfo *pi = find_procinfo (pid, tid);
enum { FD_CTL, FD_STATUS, FD_AS };
static int
-open_procinfo_files (pi, which)
- procinfo *pi;
- int which;
+open_procinfo_files (procinfo *pi, int which)
{
#ifdef NEW_PROC_API
char tmp[MAX_PROC_NAME_SIZE];
*/
static procinfo *
-create_procinfo (pid, tid)
- int pid;
- int tid;
+create_procinfo (int pid, int tid)
{
procinfo *pi, *parent;
*/
static void
-close_procinfo_files (pi)
- procinfo *pi;
+close_procinfo_files (procinfo *pi)
{
if (pi->ctl_fd > 0)
close (pi->ctl_fd);
*/
static void
-destroy_one_procinfo (list, pi)
- procinfo **list;
- procinfo *pi;
+destroy_one_procinfo (procinfo **list, procinfo *pi)
{
procinfo *ptr;
}
static void
-destroy_procinfo (pi)
- procinfo *pi;
+destroy_procinfo (procinfo *pi)
{
procinfo *tmp;
*/
static void
-dead_procinfo (pi, msg, kill_p)
- procinfo *pi;
- char *msg;
- int kill_p;
+dead_procinfo (procinfo *pi, char *msg, int kill_p)
{
char procfile[80];
* functions, we do our best to hide them all in here.
*/
-int proc_get_status PARAMS ((procinfo *pi));
-long proc_flags PARAMS ((procinfo *pi));
-int proc_why PARAMS ((procinfo *pi));
-int proc_what PARAMS ((procinfo *pi));
-int proc_set_run_on_last_close PARAMS ((procinfo *pi));
-int proc_unset_run_on_last_close PARAMS ((procinfo *pi));
-int proc_set_inherit_on_fork PARAMS ((procinfo *pi));
-int proc_unset_inherit_on_fork PARAMS ((procinfo *pi));
-int proc_set_async PARAMS ((procinfo *pi));
-int proc_unset_async PARAMS ((procinfo *pi));
-int proc_stop_process PARAMS ((procinfo *pi));
-int proc_trace_signal PARAMS ((procinfo *pi, int signo));
-int proc_ignore_signal PARAMS ((procinfo *pi, int signo));
-int proc_clear_current_fault PARAMS ((procinfo *pi));
-int proc_set_current_signal PARAMS ((procinfo *pi, int signo));
-int proc_clear_current_signal PARAMS ((procinfo *pi));
-int proc_set_gregs PARAMS ((procinfo *pi));
-int proc_set_fpregs PARAMS ((procinfo *pi));
-int proc_wait_for_stop PARAMS ((procinfo *pi));
-int proc_run_process PARAMS ((procinfo *pi, int step, int signo));
-int proc_kill PARAMS ((procinfo *pi, int signo));
-int proc_parent_pid PARAMS ((procinfo *pi));
-int proc_get_nthreads PARAMS ((procinfo *pi));
-int proc_get_current_thread PARAMS ((procinfo *pi));
-int proc_set_held_signals PARAMS ((procinfo *pi, sigset_t *sighold));
-int proc_set_traced_sysexit PARAMS ((procinfo *pi, sysset_t *sysset));
-int proc_set_traced_sysentry PARAMS ((procinfo *pi, sysset_t *sysset));
-int proc_set_traced_faults PARAMS ((procinfo *pi, fltset_t *fltset));
-int proc_set_traced_signals PARAMS ((procinfo *pi, sigset_t *sigset));
-
-int proc_update_threads PARAMS ((procinfo *pi));
-int proc_iterate_over_threads PARAMS ((procinfo *pi,
- int (*func) PARAMS ((procinfo *,
- procinfo *,
- void *)),
- void *ptr));
-
-gdb_gregset_t *proc_get_gregs PARAMS ((procinfo *pi));
-gdb_fpregset_t *proc_get_fpregs PARAMS ((procinfo *pi));
-sysset_t *proc_get_traced_sysexit PARAMS ((procinfo *pi, sysset_t *save));
-sysset_t *proc_get_traced_sysentry PARAMS ((procinfo *pi, sysset_t *save));
-fltset_t *proc_get_traced_faults PARAMS ((procinfo *pi, fltset_t *save));
-sigset_t *proc_get_traced_signals PARAMS ((procinfo *pi, sigset_t *save));
-sigset_t *proc_get_held_signals PARAMS ((procinfo *pi, sigset_t *save));
-sigset_t *proc_get_pending_signals PARAMS ((procinfo *pi, sigset_t *save));
-struct sigaction *proc_get_signal_actions PARAMS ((procinfo *pi,
- struct sigaction *save));
-
-void proc_warn PARAMS ((procinfo *pi, char *func, int line));
-void proc_error PARAMS ((procinfo *pi, char *func, int line));
+int proc_get_status (procinfo * pi);
+long proc_flags (procinfo * pi);
+int proc_why (procinfo * pi);
+int proc_what (procinfo * pi);
+int proc_set_run_on_last_close (procinfo * pi);
+int proc_unset_run_on_last_close (procinfo * pi);
+int proc_set_inherit_on_fork (procinfo * pi);
+int proc_unset_inherit_on_fork (procinfo * pi);
+int proc_set_async (procinfo * pi);
+int proc_unset_async (procinfo * pi);
+int proc_stop_process (procinfo * pi);
+int proc_trace_signal (procinfo * pi, int signo);
+int proc_ignore_signal (procinfo * pi, int signo);
+int proc_clear_current_fault (procinfo * pi);
+int proc_set_current_signal (procinfo * pi, int signo);
+int proc_clear_current_signal (procinfo * pi);
+int proc_set_gregs (procinfo * pi);
+int proc_set_fpregs (procinfo * pi);
+int proc_wait_for_stop (procinfo * pi);
+int proc_run_process (procinfo * pi, int step, int signo);
+int proc_kill (procinfo * pi, int signo);
+int proc_parent_pid (procinfo * pi);
+int proc_get_nthreads (procinfo * pi);
+int proc_get_current_thread (procinfo * pi);
+int proc_set_held_signals (procinfo * pi, sigset_t * sighold);
+int proc_set_traced_sysexit (procinfo * pi, sysset_t * sysset);
+int proc_set_traced_sysentry (procinfo * pi, sysset_t * sysset);
+int proc_set_traced_faults (procinfo * pi, fltset_t * fltset);
+int proc_set_traced_signals (procinfo * pi, sigset_t * sigset);
+
+int proc_update_threads (procinfo * pi);
+int proc_iterate_over_threads (procinfo * pi,
+ int (*func) (procinfo *, procinfo *, void *),
+ void *ptr);
+
+gdb_gregset_t *proc_get_gregs (procinfo * pi);
+gdb_fpregset_t *proc_get_fpregs (procinfo * pi);
+sysset_t *proc_get_traced_sysexit (procinfo * pi, sysset_t * save);
+sysset_t *proc_get_traced_sysentry (procinfo * pi, sysset_t * save);
+fltset_t *proc_get_traced_faults (procinfo * pi, fltset_t * save);
+sigset_t *proc_get_traced_signals (procinfo * pi, sigset_t * save);
+sigset_t *proc_get_held_signals (procinfo * pi, sigset_t * save);
+sigset_t *proc_get_pending_signals (procinfo * pi, sigset_t * save);
+struct sigaction *proc_get_signal_actions (procinfo * pi,
+ struct sigaction *save);
+
+void proc_warn (procinfo * pi, char *func, int line);
+void proc_error (procinfo * pi, char *func, int line);
void
-proc_warn (pi, func, line)
- procinfo *pi;
- char *func;
- int line;
+proc_warn (procinfo *pi, char *func, int line)
{
sprintf (errmsg, "procfs: %s line %d, %s", func, line, pi->pathname);
print_sys_errmsg (errmsg, errno);
}
void
-proc_error (pi, func, line)
- procinfo *pi;
- char *func;
- int line;
+proc_error (procinfo *pi, char *func, int line)
{
sprintf (errmsg, "procfs: %s line %d, %s", func, line, pi->pathname);
perror_with_name (errmsg);
*/
int
-proc_get_status (pi)
- procinfo *pi;
+proc_get_status (procinfo *pi)
{
/* Status file descriptor is opened "lazily" */
if (pi->status_fd == 0 &&
*/
long
-proc_flags (pi)
- procinfo *pi;
+proc_flags (procinfo *pi)
{
if (!pi->status_valid)
if (!proc_get_status (pi))
*/
int
-proc_why (pi)
- procinfo *pi;
+proc_why (procinfo *pi)
{
if (!pi->status_valid)
if (!proc_get_status (pi))
*/
int
-proc_what (pi)
- procinfo *pi;
+proc_what (procinfo *pi)
{
if (!pi->status_valid)
if (!proc_get_status (pi))
*/
int
-proc_nsysarg (pi)
- procinfo *pi;
+proc_nsysarg (procinfo *pi)
{
if (!pi->status_valid)
if (!proc_get_status (pi))
*/
long *
-proc_sysargs (pi)
- procinfo *pi;
+proc_sysargs (procinfo *pi)
{
if (!pi->status_valid)
if (!proc_get_status (pi))
*/
int
-proc_syscall (pi)
- procinfo *pi;
+proc_syscall (procinfo *pi)
{
if (!pi->status_valid)
if (!proc_get_status (pi))
enum { FLAG_RESET, FLAG_SET };
static int
-proc_modify_flag (pi, flag, mode)
- procinfo *pi;
- long flag;
- long mode;
+proc_modify_flag (procinfo *pi, long flag, long mode)
{
long win = 0; /* default to fail */
*/
int
-proc_set_run_on_last_close (pi)
- procinfo *pi;
+proc_set_run_on_last_close (procinfo *pi)
{
return proc_modify_flag (pi, PR_RLC, FLAG_SET);
}
*/
int
-proc_unset_run_on_last_close (pi)
- procinfo *pi;
+proc_unset_run_on_last_close (procinfo *pi)
{
return proc_modify_flag (pi, PR_RLC, FLAG_RESET);
}
*/
int
-proc_set_kill_on_last_close (pi)
- procinfo *pi;
+proc_set_kill_on_last_close (procinfo *pi)
{
return proc_modify_flag (pi, PR_KLC, FLAG_SET);
}
*/
int
-proc_unset_kill_on_last_close (pi)
- procinfo *pi;
+proc_unset_kill_on_last_close (procinfo *pi)
{
return proc_modify_flag (pi, PR_KLC, FLAG_RESET);
}
*/
int
-proc_set_inherit_on_fork (pi)
- procinfo *pi;
+proc_set_inherit_on_fork (procinfo *pi)
{
return proc_modify_flag (pi, PR_FORK, FLAG_SET);
}
*/
int
-proc_unset_inherit_on_fork (pi)
- procinfo *pi;
+proc_unset_inherit_on_fork (procinfo *pi)
{
return proc_modify_flag (pi, PR_FORK, FLAG_RESET);
}
*/
int
-proc_set_async (pi)
- procinfo *pi;
+proc_set_async (procinfo *pi)
{
return proc_modify_flag (pi, PR_ASYNC, FLAG_SET);
}
*/
int
-proc_unset_async (pi)
- procinfo *pi;
+proc_unset_async (procinfo *pi)
{
return proc_modify_flag (pi, PR_ASYNC, FLAG_RESET);
}
*/
int
-proc_stop_process (pi)
- procinfo *pi;
+proc_stop_process (procinfo *pi)
{
int win;
*/
int
-proc_wait_for_stop (pi)
- procinfo *pi;
+proc_wait_for_stop (procinfo *pi)
{
int win;
*/
int
-proc_run_process (pi, step, signo)
- procinfo *pi;
- int step;
- int signo;
+proc_run_process (procinfo *pi, int step, int signo)
{
int win;
int runflags;
*/
int
-proc_set_traced_signals (pi, sigset)
- procinfo *pi;
- sigset_t *sigset;
+proc_set_traced_signals (procinfo *pi, sigset_t *sigset)
{
int win;
*/
int
-proc_set_traced_faults (pi, fltset)
- procinfo *pi;
- fltset_t *fltset;
+proc_set_traced_faults (procinfo *pi, fltset_t *fltset)
{
int win;
*/
int
-proc_set_traced_sysentry (pi, sysset)
- procinfo *pi;
- sysset_t *sysset;
+proc_set_traced_sysentry (procinfo *pi, sysset_t *sysset)
{
int win;
*/
int
-proc_set_traced_sysexit (pi, sysset)
- procinfo *pi;
- sysset_t *sysset;
+proc_set_traced_sysexit (procinfo *pi, sysset_t *sysset)
{
int win;
*/
int
-proc_set_held_signals (pi, sighold)
- procinfo *pi;
- sigset_t *sighold;
+proc_set_held_signals (procinfo *pi, sigset_t *sighold)
{
int win;
*/
sigset_t *
-proc_get_pending_signals (pi, save)
- procinfo *pi;
- sigset_t *save;
+proc_get_pending_signals (procinfo *pi, sigset_t *save)
{
sigset_t *ret = NULL;
*/
struct sigaction *
-proc_get_signal_actions (pi, save)
- procinfo *pi;
- struct sigaction *save;
+proc_get_signal_actions (procinfo *pi, struct sigaction *save)
{
struct sigaction *ret = NULL;
*/
sigset_t *
-proc_get_held_signals (pi, save)
- procinfo *pi;
- sigset_t *save;
+proc_get_held_signals (procinfo *pi, sigset_t *save)
{
sigset_t *ret = NULL;
*/
sigset_t *
-proc_get_traced_signals (pi, save)
- procinfo *pi;
- sigset_t *save;
+proc_get_traced_signals (procinfo *pi, sigset_t *save)
{
sigset_t *ret = NULL;
*/
int
-proc_trace_signal (pi, signo)
- procinfo *pi;
- int signo;
+proc_trace_signal (procinfo *pi, int signo)
{
sigset_t temp;
*/
int
-proc_ignore_signal (pi, signo)
- procinfo *pi;
- int signo;
+proc_ignore_signal (procinfo *pi, int signo)
{
sigset_t temp;
*/
fltset_t *
-proc_get_traced_faults (pi, save)
- procinfo *pi;
- fltset_t *save;
+proc_get_traced_faults (procinfo *pi, fltset_t *save)
{
fltset_t *ret = NULL;
*/
sysset_t *
-proc_get_traced_sysentry (pi, save)
- procinfo *pi;
- sysset_t *save;
+proc_get_traced_sysentry (procinfo *pi, sysset_t *save)
{
sysset_t *ret = NULL;
*/
sysset_t *
-proc_get_traced_sysexit (pi, save)
- procinfo *pi;
- sysset_t *save;
+proc_get_traced_sysexit (procinfo *pi, sysset_t *save)
{
sysset_t * ret = NULL;
*/
int
-proc_clear_current_fault (pi)
- procinfo *pi;
+proc_clear_current_fault (procinfo *pi)
{
int win;
*/
int
-proc_set_current_signal (pi, signo)
- procinfo *pi;
- int signo;
+proc_set_current_signal (procinfo *pi, int signo)
{
int win;
struct {
*/
int
-proc_clear_current_signal (pi)
- procinfo *pi;
+proc_clear_current_signal (procinfo *pi)
{
int win;
*/
gdb_gregset_t *
-proc_get_gregs (pi)
- procinfo *pi;
+proc_get_gregs (procinfo *pi)
{
if (!pi->status_valid || !pi->gregs_valid)
if (!proc_get_status (pi))
*/
gdb_fpregset_t *
-proc_get_fpregs (pi)
- procinfo *pi;
+proc_get_fpregs (procinfo *pi)
{
#ifdef NEW_PROC_API
if (!pi->status_valid || !pi->fpregs_valid)
*/
int
-proc_set_gregs (pi)
- procinfo *pi;
+proc_set_gregs (procinfo *pi)
{
gdb_gregset_t *gregs;
int win;
*/
int
-proc_set_fpregs (pi)
- procinfo *pi;
+proc_set_fpregs (procinfo *pi)
{
gdb_fpregset_t *fpregs;
int win;
*/
int
-proc_kill (pi, signo)
- procinfo *pi;
- int signo;
+proc_kill (procinfo *pi, int signo)
{
int win;
*/
int
-proc_parent_pid (pi)
- procinfo *pi;
+proc_parent_pid (procinfo *pi)
{
/*
* We should never have to apply this operation to any procinfo
*/
int
-proc_set_watchpoint (pi, addr, len, wflags)
- procinfo *pi;
- CORE_ADDR addr;
- int len;
- int wflags;
+proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags)
{
#if !defined (TARGET_HAS_HARDWARE_WATCHPOINTS)
return 0;
prwatch_t *pwatch;
pwatch = (prwatch_t *) &arg.watch;
- pwatch->pr_vaddr = addr;
+ pwatch->pr_vaddr = address_to_host_pointer (addr);
pwatch->pr_size = len;
pwatch->pr_wflags = wflags;
#if defined(NEW_PROC_API) && defined (PCWATCH)
every time, I don't need to lseek it. */
int
proc_iterate_over_mappings (func)
- int (*func) PARAMS ((int, CORE_ADDR));
+ int (*func) (int, CORE_ADDR);
{
struct prmap *map;
procinfo *pi;
not a problem. */
/* Stop looping if the callback returns non-zero. */
- if ((funcstat = (*func) (fd, (CORE_ADDR) map[i].pr_vaddr)) != 0)
+ funcstat = (*func) (fd, host_pointer_to_address (map[i].pr_vaddr));
+ if (funcstat != 0)
break;
}
#endif
*/
struct ssd *
-proc_get_LDT_entry (pi, key)
- procinfo *pi;
- int key;
+proc_get_LDT_entry (procinfo *pi, int key)
{
static struct ssd *ldt_entry = NULL;
#ifdef NEW_PROC_API
* OSF version
*/
int
-proc_get_nthreads (pi)
- procinfo *pi;
+proc_get_nthreads (procinfo *pi)
{
int nthreads = 0;
* Solaris and Unixware version
*/
int
-proc_get_nthreads (pi)
- procinfo *pi;
+proc_get_nthreads (procinfo *pi)
{
if (!pi->status_valid)
if (!proc_get_status (pi))
* Default version
*/
int
-proc_get_nthreads (pi)
- procinfo *pi;
+proc_get_nthreads (procinfo *pi)
{
return 0;
}
* Solaris and Unixware version
*/
int
-proc_get_current_thread (pi)
- procinfo *pi;
+proc_get_current_thread (procinfo *pi)
{
/*
* Note: this should be applied to the root procinfo for the process,
* OSF version
*/
int
-proc_get_current_thread (pi)
- procinfo *pi;
+proc_get_current_thread (procinfo *pi)
{
#if 0 /* FIXME: not ready for prime time? */
return pi->prstatus.pr_tid;
* Default version
*/
int
-proc_get_current_thread (pi)
- procinfo *pi;
+proc_get_current_thread (procinfo *pi)
{
return 0;
}
*/
int
-proc_delete_dead_threads (parent, thread, ignore)
- procinfo *parent;
- procinfo *thread;
- void *ignore;
+proc_delete_dead_threads (procinfo *parent, procinfo *thread, void *ignore)
{
if (thread && parent) /* sanity */
{
* Solaris 2.5 (ioctl) version
*/
int
-proc_update_threads (pi)
- procinfo *pi;
+proc_update_threads (procinfo *pi)
{
gdb_prstatus_t *prstatus;
struct cleanup *old_chain = NULL;
}
int
-proc_update_threads (pi)
- procinfo *pi;
+proc_update_threads (procinfo *pi)
{
char pathname[MAX_PROC_NAME_SIZE + 16];
struct dirent *direntry;
* OSF version
*/
int
-proc_update_threads (pi)
- procinfo *pi;
+proc_update_threads (procinfo *pi)
{
int nthreads, i;
tid_t *threads;
* Default version
*/
int
-proc_update_threads (pi)
- procinfo *pi;
+proc_update_threads (procinfo *pi)
{
return 0;
}
int
proc_iterate_over_threads (pi, func, ptr)
procinfo *pi;
- int (*func) PARAMS ((procinfo *, procinfo *, void *));
+ int (*func) (procinfo *, procinfo *, void *);
void *ptr;
{
procinfo *thread, *next;
* Here are all of the gdb target vector functions and their friends.
*/
-static int do_attach PARAMS ((int pid));
-static void do_detach PARAMS ((int signo));
-static int register_gdb_signals PARAMS ((procinfo *, sigset_t *));
+static int do_attach (int pid);
+static void do_detach (int signo);
+static int register_gdb_signals (procinfo *, sigset_t *);
/*
* Function: procfs_debug_inferior
*/
static int
-procfs_debug_inferior (pi)
- procinfo *pi;
+procfs_debug_inferior (procinfo *pi)
{
fltset_t traced_faults;
sigset_t traced_signals;
}
static void
-procfs_attach (args, from_tty)
- char *args;
- int from_tty;
+procfs_attach (char *args, int from_tty)
{
char *exec_file;
int pid;
}
static void
-procfs_detach (args, from_tty)
- char *args;
- int from_tty;
+procfs_detach (char *args, int from_tty)
{
char *exec_file;
int signo = 0;
}
static int
-do_attach (pid)
- int pid;
+do_attach (int pid)
{
procinfo *pi;
int fail;
}
static void
-do_detach (signo)
- int signo;
+do_detach (int signo)
{
procinfo *pi;
* is resumed.
*/
-/* These could go in a header file, but the many and various
- definitions of gregset_t would make it tricky and ugly. Several
- different native operating systems (notably Solaris and Linux) have
- various different definitions for gregset_t and fpregset_t. We
- have been kludging around this problem for a while, it would be
- nice if someday we came up with a prettier way of handling it
- (FIXME). */
-
-extern void fill_gregset (gdb_gregset_t *, int);
-extern void fill_fpregset (gdb_fpregset_t *, int);
-extern void supply_gregset (gdb_gregset_t *);
-extern void supply_fpregset (gdb_fpregset_t *);
-
static void
-procfs_fetch_registers (regno)
- int regno;
+procfs_fetch_registers (int regno)
{
gdb_fpregset_t *fpregs;
gdb_gregset_t *gregs;
from the program being debugged. */
static void
-procfs_prepare_to_store ()
+procfs_prepare_to_store (void)
{
#ifdef CHILD_PREPARE_TO_STORE
CHILD_PREPARE_TO_STORE ();
*/
static void
-procfs_store_registers (regno)
- int regno;
+procfs_store_registers (int regno)
{
gdb_fpregset_t *fpregs;
gdb_gregset_t *gregs;
*/
static int
-procfs_wait (pid, status)
- int pid;
- struct target_waitstatus *status;
+procfs_wait (int pid, struct target_waitstatus *status)
{
/* First cut: loosely based on original version 2.1 */
procinfo *pi;
static int
-invalidate_cache (parent, pi, ptr)
- procinfo *parent;
- procinfo *pi;
- void *ptr;
+invalidate_cache (procinfo *parent, procinfo *pi, void *ptr)
{
/*
* About to run the child; invalidate caches and do any other cleanup.
*/
static int
-make_signal_thread_runnable (process, pi, ptr)
- procinfo *process;
- procinfo *pi;
- void *ptr;
+make_signal_thread_runnable (procinfo *process, procinfo *pi, void *ptr)
{
#ifdef PR_ASLWP
if (proc_flags (pi) & PR_ASLWP)
*/
static void
-procfs_resume (pid, step, signo)
- int pid;
- int step;
- enum target_signal signo;
+procfs_resume (int pid, int step, enum target_signal signo)
{
procinfo *pi, *thread;
int native_signo;
*/
static int
-register_gdb_signals (pi, signals)
- procinfo *pi;
- sigset_t *signals;
+register_gdb_signals (procinfo *pi, sigset_t *signals)
{
int signo;
*/
static void
-procfs_notice_signals (pid)
- int pid;
+procfs_notice_signals (int pid)
{
sigset_t signals;
procinfo *pi = find_procinfo_or_die (PIDGET (pid), 0);
*/
static void
-procfs_files_info (ignore)
- struct target_ops *ignore;
+procfs_files_info (struct target_ops *ignore)
{
printf_filtered ("\tUsing the running image of %s %s via /proc.\n",
attach_flag? "attached": "child",
*/
static void
-procfs_open (args, from_tty)
- char *args;
- int from_tty;
+procfs_open (char *args, int from_tty)
{
error ("Use the \"run\" command to start a Unix child process.");
}
static int
-procfs_can_run ()
+procfs_can_run (void)
{
/* This variable is controlled by modules that sit atop procfs that
may layer their own process structure atop that provided here.
*/
static void
-procfs_stop ()
+procfs_stop (void)
{
extern pid_t inferior_process_group;
*/
static void
-unconditionally_kill_inferior (pi)
- procinfo *pi;
+unconditionally_kill_inferior (procinfo *pi)
{
int parent_pid;
*/
static void
-procfs_kill_inferior ()
+procfs_kill_inferior (void)
{
if (inferior_pid != 0) /* ? */
{
*/
static void
-procfs_mourn_inferior ()
+procfs_mourn_inferior (void)
{
procinfo *pi;
*/
static void
-procfs_init_inferior (pid)
- int pid;
+procfs_init_inferior (int pid)
{
procinfo *pi;
sigset_t signals;
*/
static void
-procfs_set_exec_trap ()
+procfs_set_exec_trap (void)
{
/* This routine called on the child side (inferior side)
after GDB forks the inferior. It must use only local variables,
*/
static void
-procfs_create_inferior (exec_file, allargs, env)
- char *exec_file;
- char *allargs;
- char **env;
+procfs_create_inferior (char *exec_file, char *allargs, char **env)
{
char *shell_file = getenv ("SHELL");
char *tryname;
*/
static int
-procfs_notice_thread (pi, thread, ptr)
- procinfo *pi;
- procinfo *thread;
- void *ptr;
+procfs_notice_thread (procinfo *pi, procinfo *thread, void *ptr)
{
int gdb_threadid = MERGEPID (pi->pid, thread->tid);
*/
void
-procfs_find_new_threads ()
+procfs_find_new_threads (void)
{
procinfo *pi;
*/
static int
-procfs_thread_alive (pid)
- int pid;
+procfs_thread_alive (int pid)
{
int proc, thread;
procinfo *pi;
*/
char *
-procfs_pid_to_str (pid)
- int pid;
+procfs_pid_to_str (int pid)
{
static char buf[80];
int proc, thread;
*/
int
-procfs_set_watchpoint (pid, addr, len, rwflag, after)
- int pid;
- CORE_ADDR addr;
- int len;
- int rwflag;
- int after;
+procfs_set_watchpoint (int pid, CORE_ADDR addr, int len, int rwflag, int after)
{
#ifndef UNIXWARE
int pflags = 0;
*/
int
-procfs_stopped_by_watchpoint (pid)
- int pid;
+procfs_stopped_by_watchpoint (int pid)
{
procinfo *pi;
*/
struct ssd *
-procfs_find_LDT_entry (pid)
- int pid;
+procfs_find_LDT_entry (int pid)
{
gdb_gregset_t *gregs;
int key;
static void
-info_proc_cmd (args, from_tty)
- char *args;
- int from_tty;
+info_proc_cmd (char *args, int from_tty)
{
struct cleanup *old_chain;
procinfo *process = NULL;
}
static void
-proc_trace_syscalls (args, from_tty, entry_or_exit, mode)
- char *args;
- int from_tty;
- int entry_or_exit;
- int mode;
+proc_trace_syscalls (char *args, int from_tty, int entry_or_exit, int mode)
{
procinfo *pi;
sysset_t *sysset;
}
static void
-proc_trace_sysentry_cmd (args, from_tty)
- char *args;
- int from_tty;
+proc_trace_sysentry_cmd (char *args, int from_tty)
{
proc_trace_syscalls (args, from_tty, PR_SYSENTRY, FLAG_SET);
}
static void
-proc_trace_sysexit_cmd (args, from_tty)
- char *args;
- int from_tty;
+proc_trace_sysexit_cmd (char *args, int from_tty)
{
proc_trace_syscalls (args, from_tty, PR_SYSEXIT, FLAG_SET);
}
static void
-proc_untrace_sysentry_cmd (args, from_tty)
- char *args;
- int from_tty;
+proc_untrace_sysentry_cmd (char *args, int from_tty)
{
proc_trace_syscalls (args, from_tty, PR_SYSENTRY, FLAG_RESET);
}
static void
-proc_untrace_sysexit_cmd (args, from_tty)
- char *args;
- int from_tty;
+proc_untrace_sysexit_cmd (char *args, int from_tty)
{
proc_trace_syscalls (args, from_tty, PR_SYSEXIT, FLAG_RESET);
}
void
-_initialize_procfs ()
+_initialize_procfs (void)
{
init_procfs_ops ();
add_target (&procfs_ops);
*/
int
-procfs_first_available ()
+procfs_first_available (void)
{
if (procinfo_list)
return procinfo_list->pid;