1999-01-19 Fernando Nasser <fnasser@totem.to.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / procfs.c
index 56c1639685974e1e1ef5217eee8380b9739c7b83..83c0c328d08ce2d156df14d9785d65f70eb7cbb8 100644 (file)
@@ -534,7 +534,7 @@ static void procfs_attach PARAMS ((char *, int));
 
 static void proc_set_exec_trap PARAMS ((void));
 
-static int procfs_init_inferior PARAMS ((int));
+static void  procfs_init_inferior PARAMS ((int));
 
 static struct procinfo *create_procinfo PARAMS ((int));
 
@@ -2519,7 +2519,7 @@ LOCAL FUNCTION
 
 SYNOPSIS
 
-       int procfs_init_inferior (int pid)
+       void procfs_init_inferior (int pid)
 
 DESCRIPTION
 
@@ -2537,7 +2537,7 @@ NOTES
 
  */
 
-static int
+static void 
 procfs_init_inferior (pid)
      int pid;
 {
@@ -2563,8 +2563,6 @@ procfs_init_inferior (pid)
   /* One trap to exec the shell, one to exec the program being debugged.  */
   startup_inferior (2);
 #endif
-
-  return pid;
 }
 
 /*
@@ -5575,7 +5573,7 @@ procfs_create_inferior (exec_file, allargs, env)
     }
 
   fork_inferior (exec_file, allargs, env,
-                proc_set_exec_trap, procfs_init_inferior, shell_file);
+                proc_set_exec_trap, procfs_init_inferior, NULL, shell_file);
 
   /* We are at the first instruction we care about.  */
   /* Pedal to the metal... */
@@ -5754,48 +5752,7 @@ procfs_pid_to_str (pid)
 }
 #endif /* TIDGET */
 \f
-struct target_ops procfs_ops = {
-  "procfs",                    /* to_shortname */
-  "Unix /proc child process",  /* to_longname */
-  "Unix /proc child process (started by the \"run\" command).",        /* to_doc */
-  procfs_open,                 /* to_open */
-  0,                           /* to_close */
-  procfs_attach,                       /* to_attach */
-  procfs_detach,               /* to_detach */
-  procfs_resume,                       /* to_resume */
-  procfs_wait,                 /* to_wait */
-  procfs_fetch_registers,      /* to_fetch_registers */
-  procfs_store_registers,      /* to_store_registers */
-  procfs_prepare_to_store,     /* to_prepare_to_store */
-  procfs_xfer_memory,          /* to_xfer_memory */
-  procfs_files_info,           /* to_files_info */
-  memory_insert_breakpoint,    /* to_insert_breakpoint */
-  memory_remove_breakpoint,    /* to_remove_breakpoint */
-  terminal_init_inferior,      /* to_terminal_init */
-  terminal_inferior,           /* to_terminal_inferior */
-  terminal_ours_for_output,    /* to_terminal_ours_for_output */
-  terminal_ours,               /* to_terminal_ours */
-  child_terminal_info,         /* to_terminal_info */
-  procfs_kill_inferior,                /* to_kill */
-  0,                           /* to_load */
-  0,                           /* to_lookup_symbol */
-  procfs_create_inferior,      /* to_create_inferior */
-  procfs_mourn_inferior,       /* to_mourn_inferior */
-  procfs_can_run,              /* to_can_run */
-  procfs_notice_signals,       /* to_notice_signals */
-  procfs_thread_alive,         /* to_thread_alive */
-  procfs_stop,                 /* to_stop */
-  process_stratum,             /* to_stratum */
-  0,                           /* to_next */
-  1,                           /* to_has_all_memory */
-  1,                           /* to_has_memory */
-  1,                           /* to_has_stack */
-  1,                           /* to_has_registers */
-  1,                           /* to_has_execution */
-  0,                           /* sections */
-  0,                           /* sections_end */
-  OPS_MAGIC                    /* to_magic */
-};
+struct target_ops procfs_ops;
 
 void
 _initialize_procfs ()
@@ -5812,6 +5769,48 @@ _initialize_procfs ()
     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_store_registers = procfs_store_registers;
+  procfs_ops.to_prepare_to_store = procfs_prepare_to_store;
+  procfs_ops.to_xfer_memory = procfs_xfer_memory;
+  procfs_ops.to_files_info = procfs_files_info;
+  procfs_ops.to_insert_breakpoint = memory_insert_breakpoint;
+  procfs_ops.to_remove_breakpoint = memory_remove_breakpoint;
+  procfs_ops.to_terminal_init = terminal_init_inferior;
+  procfs_ops.to_terminal_inferior = terminal_inferior;
+  procfs_ops.to_terminal_ours_for_output = terminal_ours_for_output;
+  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_notice_signals = procfs_notice_signals;
+  procfs_ops.to_thread_alive = procfs_thread_alive;
+  procfs_ops.to_stop = procfs_stop;
+  procfs_ops.to_stratum = process_stratum;
+  procfs_ops.to_has_all_memory = 1;
+  procfs_ops.to_has_memory = 1;
+  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;
 
   add_target (&procfs_ops);
 
This page took 0.024763 seconds and 4 git commands to generate.