-#endif /* MAINTENANCE_CMDS */
-
-struct target_ops sol_thread_ops = {
- "solaris-threads", /* to_shortname */
- "Solaris threads and pthread.", /* to_longname */
- "Solaris threads and pthread support.", /* to_doc */
- sol_thread_open, /* to_open */
- 0, /* to_close */
- sol_thread_attach, /* to_attach */
- sol_thread_detach, /* to_detach */
- sol_thread_resume, /* to_resume */
- sol_thread_wait, /* to_wait */
- sol_thread_fetch_registers, /* to_fetch_registers */
- sol_thread_store_registers, /* to_store_registers */
- sol_thread_prepare_to_store, /* to_prepare_to_store */
- sol_thread_xfer_memory, /* to_xfer_memory */
- sol_thread_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 */
- sol_thread_kill_inferior, /* to_kill */
- 0, /* to_load */
- 0, /* to_lookup_symbol */
- sol_thread_create_inferior, /* to_create_inferior */
- sol_thread_mourn_inferior, /* to_mourn_inferior */
- sol_thread_can_run, /* to_can_run */
- sol_thread_notice_signals, /* to_notice_signals */
- sol_thread_alive, /* to_thread_alive */
- sol_thread_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 */
-};
+
+static int
+ignore (CORE_ADDR addr, char *contents)
+{
+ return 0;
+}
+
+
+static void
+init_sol_thread_ops (void)
+{
+ sol_thread_ops.to_shortname = "solaris-threads";
+ sol_thread_ops.to_longname = "Solaris threads and pthread.";
+ sol_thread_ops.to_doc = "Solaris threads and pthread support.";
+ sol_thread_ops.to_open = sol_thread_open;
+ sol_thread_ops.to_close = 0;
+ sol_thread_ops.to_attach = sol_thread_attach;
+ sol_thread_ops.to_detach = sol_thread_detach;
+ sol_thread_ops.to_resume = sol_thread_resume;
+ sol_thread_ops.to_wait = sol_thread_wait;
+ sol_thread_ops.to_fetch_registers = sol_thread_fetch_registers;
+ sol_thread_ops.to_store_registers = sol_thread_store_registers;
+ sol_thread_ops.to_prepare_to_store = sol_thread_prepare_to_store;
+ sol_thread_ops.to_xfer_memory = sol_thread_xfer_memory;
+ sol_thread_ops.to_files_info = sol_thread_files_info;
+ sol_thread_ops.to_insert_breakpoint = memory_insert_breakpoint;
+ sol_thread_ops.to_remove_breakpoint = memory_remove_breakpoint;
+ sol_thread_ops.to_terminal_init = terminal_init_inferior;
+ sol_thread_ops.to_terminal_inferior = terminal_inferior;
+ sol_thread_ops.to_terminal_ours_for_output = terminal_ours_for_output;
+ sol_thread_ops.to_terminal_ours = terminal_ours;
+ sol_thread_ops.to_terminal_info = child_terminal_info;
+ sol_thread_ops.to_kill = sol_thread_kill_inferior;
+ sol_thread_ops.to_load = 0;
+ sol_thread_ops.to_lookup_symbol = 0;
+ sol_thread_ops.to_create_inferior = sol_thread_create_inferior;
+ sol_thread_ops.to_mourn_inferior = sol_thread_mourn_inferior;
+ sol_thread_ops.to_can_run = sol_thread_can_run;
+ sol_thread_ops.to_notice_signals = sol_thread_notice_signals;
+ sol_thread_ops.to_thread_alive = sol_thread_alive;
+ sol_thread_ops.to_pid_to_str = solaris_pid_to_str;
+ sol_thread_ops.to_find_new_threads = sol_find_new_threads;
+ sol_thread_ops.to_stop = sol_thread_stop;
+ sol_thread_ops.to_stratum = process_stratum;
+ sol_thread_ops.to_has_all_memory = 1;
+ sol_thread_ops.to_has_memory = 1;
+ sol_thread_ops.to_has_stack = 1;
+ sol_thread_ops.to_has_registers = 1;
+ sol_thread_ops.to_has_execution = 1;
+ sol_thread_ops.to_has_thread_control = tc_none;
+ sol_thread_ops.to_sections = 0;
+ sol_thread_ops.to_sections_end = 0;
+ sol_thread_ops.to_magic = OPS_MAGIC;
+}
+
+
+static void
+init_sol_core_ops (void)
+{
+ sol_core_ops.to_shortname = "solaris-core";
+ sol_core_ops.to_longname = "Solaris core threads and pthread.";
+ sol_core_ops.to_doc = "Solaris threads and pthread support for core files.";
+ sol_core_ops.to_open = sol_core_open;
+ sol_core_ops.to_close = sol_core_close;
+ sol_core_ops.to_attach = sol_thread_attach;
+ sol_core_ops.to_detach = sol_core_detach;
+ /* sol_core_ops.to_resume = 0; */
+ /* sol_core_ops.to_wait = 0; */
+ sol_core_ops.to_fetch_registers = sol_thread_fetch_registers;
+ /* sol_core_ops.to_store_registers = 0; */
+ /* sol_core_ops.to_prepare_to_store = 0; */
+ sol_core_ops.to_xfer_memory = sol_thread_xfer_memory;
+ sol_core_ops.to_files_info = sol_core_files_info;
+ sol_core_ops.to_insert_breakpoint = ignore;
+ sol_core_ops.to_remove_breakpoint = ignore;
+ /* sol_core_ops.to_terminal_init = 0; */
+ /* sol_core_ops.to_terminal_inferior = 0; */
+ /* sol_core_ops.to_terminal_ours_for_output = 0; */
+ /* sol_core_ops.to_terminal_ours = 0; */
+ /* sol_core_ops.to_terminal_info = 0; */
+ /* sol_core_ops.to_kill = 0; */
+ /* sol_core_ops.to_load = 0; */
+ /* sol_core_ops.to_lookup_symbol = 0; */
+ sol_core_ops.to_create_inferior = sol_thread_create_inferior;
+ sol_core_ops.to_stratum = core_stratum;
+ sol_core_ops.to_has_all_memory = 0;
+ sol_core_ops.to_has_memory = 1;
+ sol_core_ops.to_has_stack = 1;
+ sol_core_ops.to_has_registers = 1;
+ sol_core_ops.to_has_execution = 0;
+ sol_core_ops.to_has_thread_control = tc_none;
+ sol_core_ops.to_thread_alive = sol_thread_alive;
+ sol_core_ops.to_pid_to_str = solaris_pid_to_str;
+ /* On Solaris/x86, when debugging a threaded core file from process <n>,
+ the following causes "info threads" to produce "procfs: couldn't find pid
+ <n> in procinfo list" where <n> is the pid of the process that produced
+ the core file. Disable it for now. */
+ /* sol_core_ops.to_find_new_threads = sol_find_new_threads; */
+ sol_core_ops.to_sections = 0;
+ sol_core_ops.to_sections_end = 0;
+ sol_core_ops.to_magic = OPS_MAGIC;
+}
+
+/* we suppress the call to add_target of core_ops in corelow because
+ if there are two targets in the stratum core_stratum, find_core_target
+ won't know which one to return. see corelow.c for an additonal
+ comment on coreops_suppress_target. */
+int coreops_suppress_target = 1;