* procfs.c (init_procfs_ops): New function, fills in procfs_ops,
authorStan Shebs <shebs@codesourcery.com>
Fri, 22 Jan 1999 02:30:37 +0000 (02:30 +0000)
committerStan Shebs <shebs@codesourcery.com>
Fri, 22 Jan 1999 02:30:37 +0000 (02:30 +0000)
init only nonzero fields, leave to_require_attach and
to_require_detach empty, not needed for /proc systems yet.
(_initialize_procfs): Call init_procfs_ops.

gdb/ChangeLog
gdb/procfs.c

index f11c86cd49cecd6aac7f82a4917f83743df56334..8101355b36e8d3cf7d0f8554a1145072407c1591 100644 (file)
@@ -1,3 +1,10 @@
+Thu Jan 21 17:51:51 1999  Stan Shebs  <shebs@andros.cygnus.com>
+
+       * procfs.c (init_procfs_ops): New function, fills in procfs_ops,
+       init only nonzero fields, leave to_require_attach and
+       to_require_detach empty, not needed for /proc systems yet.
+       (_initialize_procfs): Call init_procfs_ops.
+
 Thu Jan 21 17:25:46 1999  Mark Alexander  <marka@cygnus.com>
 
        * mon960-rom.c (_initialize_mon960): Call init_mon960_cmds
index 83c0c328d08ce2d156df14d9785d65f70eb7cbb8..eb4cbfbf032d30238ffeea562fc1fd5da11d06ea 100644 (file)
@@ -137,7 +137,7 @@ regardless of whether or not the actual target has floating point hardware.
 
 #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
@@ -653,6 +653,8 @@ struct procfs_syscall_handler
 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. */
 
@@ -5751,33 +5753,17 @@ procfs_pid_to_str (pid)
   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;
@@ -5793,8 +5779,6 @@ _initialize_procfs ()
   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;
@@ -5807,11 +5791,26 @@ _initialize_procfs ()
   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, 
This page took 0.030655 seconds and 4 git commands to generate.