#define MAX_PROC_NAME_SIZE sizeof("/proc/1234567890/status")
-extern struct target_ops procfs_ops; /* Forward declaration */
+struct target_ops procfs_ops;
int procfs_suppress_run = 0; /* Non-zero if procfs should pretend not to
be a runnable target. Used by targets
static void procfs_resume PARAMS ((int pid, int step,
enum target_signal signo));
+static void init_procfs_ops PARAMS ((void));
+
/* External function prototypes that can't be easily included in any
header file because the args are typedefs in system include files. */
return buf;
}
#endif /* TIDGET */
-\f
-struct target_ops procfs_ops;
-void
-_initialize_procfs ()
+\f
+static void
+init_procfs_ops ()
{
-#ifdef HAVE_OPTIONAL_PROC_FS
- char procname[MAX_PROC_NAME_SIZE];
- int fd;
-
- /* If we have an optional /proc filesystem (e.g. under OSF/1),
- don't add procfs support if we cannot access the running
- GDB via /proc. */
- sprintf (procname, STATUS_PROC_NAME_FMT, getpid ());
- if ((fd = open (procname, O_RDONLY)) < 0)
- return;
- close (fd);
-#endif
procfs_ops.to_shortname = "procfs";
procfs_ops.to_longname = "Unix /proc child process";
procfs_ops.to_doc = "Unix /proc child process (started by the \"run\" command).";
procfs_ops.to_open = procfs_open;
- procfs_ops.to_close = 0;
procfs_ops.to_attach = procfs_attach;
- procfs_ops.to_require_attach = procfs_attach;
procfs_ops.to_detach = procfs_detach;
- procfs_ops.to_require_detach = procfs_detach;
procfs_ops.to_resume = procfs_resume;
procfs_ops.to_wait = procfs_wait;
procfs_ops.to_fetch_registers = procfs_fetch_registers;
procfs_ops.to_terminal_ours = terminal_ours;
procfs_ops.to_terminal_info = child_terminal_info;
procfs_ops.to_kill = procfs_kill_inferior;
- procfs_ops.to_load = 0;
- procfs_ops.to_lookup_symbol = 0;
procfs_ops.to_create_inferior = procfs_create_inferior;
procfs_ops.to_mourn_inferior = procfs_mourn_inferior;
procfs_ops.to_can_run = procfs_can_run;
procfs_ops.to_has_stack = 1;
procfs_ops.to_has_registers = 1;
procfs_ops.to_has_execution = 1;
- procfs_ops.to_has_thread_control = tc_none;
- procfs_ops.to_sections = 0;
- procfs_ops.to_sections_end = 0;
procfs_ops.to_magic = OPS_MAGIC;
+}
+
+void
+_initialize_procfs ()
+{
+#ifdef HAVE_OPTIONAL_PROC_FS
+ char procname[MAX_PROC_NAME_SIZE];
+ int fd;
+
+ /* If we have an optional /proc filesystem (e.g. under OSF/1),
+ don't add procfs support if we cannot access the running
+ GDB via /proc. */
+ sprintf (procname, STATUS_PROC_NAME_FMT, getpid ());
+ if ((fd = open (procname, O_RDONLY)) < 0)
+ return;
+ close (fd);
+#endif
+ init_procfs_ops ();
add_target (&procfs_ops);
add_info ("processes", info_proc,