}
}
-/* This is the target_close implementation. Clears all target
+/* This is the target_xclose implementation. Clears all target
sections and closes all executable bfds from all program spaces. */
static void
-exec_close_1 (struct target_ops *self)
+exec_xclose_1 (struct target_ops *self)
{
struct program_space *ss;
struct cleanup *old_chain;
}
do_cleanups (old_chain);
+ xfree (self);
}
void
/* If these are the first file sections we can provide memory
from, push the file_stratum target. */
if (!target_is_pushed (&exec_ops))
- push_target (&exec_ops);
+ push_target (TARGET_NEW (struct target_ops, &exec_ops));
}
}
mem_range_s *r;
int i;
- table = target_get_section_table (&exec_ops);
+ table = current_target_sections;
available_memory = section_table_available_memory (available_memory,
offset, len,
table->sections,
p->addr += offset;
p->endaddr += offset;
if (from_tty)
- exec_files_info (&exec_ops);
+ exec_files_info (NULL);
return;
}
}
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_1;
+ exec_ops.to_xclose = exec_xclose_1;
exec_ops.to_xfer_partial = exec_xfer_partial;
exec_ops.to_get_section_table = exec_get_section_table;
exec_ops.to_files_info = exec_files_info;