-struct target_ops exec_ops = {
- "exec", "Local exec file",
- "Use an executable file as a target.\n\
-Specify the filename of the executable file.",
- exec_file_command, exec_close, /* open, close */
- child_attach, 0, 0, 0, /* attach, detach, resume, wait, */
- 0, 0, /* fetch_registers, store_registers, */
- 0, 0, 0, /* prepare_to_store, conv_to, conv_from, */
- exec_xfer_memory, exec_files_info,
- 0, 0, /* insert_breakpoint, remove_breakpoint, */
- 0, 0, 0, 0, 0, /* terminal stuff */
- 0, 0, /* kill, load */
- add_syms_addr_command,
- 0, 0, /* call fn, lookup sym */
- child_create_inferior,
- 0, /* mourn_inferior */
- file_stratum, 0, /* next */
- 0, 1, 0, 0, 0, /* all mem, mem, stack, regs, exec */
- OPS_MAGIC, /* Always the last thing */
-};
+/* If mourn is being called in all the right places, this could be say
+ `gdb internal error' (since generic_mourn calls
+ breakpoint_init_inferior). */
+
+static int
+ignore (CORE_ADDR addr, char *contents)
+{
+ return 0;
+}
+
+/* Find mapped memory. */
+
+extern void
+exec_set_find_memory_regions (int (*func) (int (*) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
+ void *),
+ void *))
+{
+ exec_ops.to_find_memory_regions = func;
+}
+
+static char *exec_make_note_section (bfd *, int *);
+
+/* Fill in the exec file target vector. Very few entries need to be
+ defined. */
+
+static void
+init_exec_ops (void)
+{
+ exec_ops.to_shortname = "exec";
+ exec_ops.to_longname = "Local exec file";
+ exec_ops.to_doc = "Use an executable file as a target.\n\
+Specify the filename of the executable file.";
+ exec_ops.to_open = exec_open;
+ exec_ops.to_close = exec_close;
+ exec_ops.to_attach = find_default_attach;
+ exec_ops.deprecated_xfer_memory = xfer_memory;
+ exec_ops.to_files_info = exec_files_info;
+ exec_ops.to_insert_breakpoint = ignore;
+ exec_ops.to_remove_breakpoint = ignore;
+ exec_ops.to_create_inferior = find_default_create_inferior;
+ exec_ops.to_stratum = file_stratum;
+ exec_ops.to_has_memory = 1;
+ exec_ops.to_make_corefile_notes = exec_make_note_section;
+ exec_ops.to_magic = OPS_MAGIC;
+}