+2014-07-25 Tom Tromey <tromey@redhat.com>
+
+ * exec.c (using_exec_ops): Remove.
+ (exec_close_1): Update. Remove extraneous block, reindent.
+ (add_target_sections): Use target_is_pushed.
+
2014-07-25 Pedro Alves <palves@redhat.com>
* go32-nat.c (go32_create_inferior): Pass 0 to clear_proceed_status.
static struct target_ops exec_ops;
-/* True if the exec target is pushed on the stack. */
-static int using_exec_ops;
-
/* Whether to open exec and core files read-only or read-write. */
int write_files = 0;
static void
exec_close_1 (struct target_ops *self)
{
- using_exec_ops = 0;
+ struct program_space *ss;
+ struct cleanup *old_chain;
+ old_chain = save_current_program_space ();
+ ALL_PSPACES (ss)
{
- struct program_space *ss;
- struct cleanup *old_chain;
-
- old_chain = save_current_program_space ();
- ALL_PSPACES (ss)
- {
- set_current_program_space (ss);
- clear_section_table (current_target_sections);
- exec_close ();
- }
-
- do_cleanups (old_chain);
+ set_current_program_space (ss);
+ clear_section_table (current_target_sections);
+ exec_close ();
}
+
+ do_cleanups (old_chain);
}
void
/* If these are the first file sections we can provide memory
from, push the file_stratum target. */
- if (!using_exec_ops)
- {
- using_exec_ops = 1;
- push_target (&exec_ops);
- }
+ if (!target_is_pushed (&exec_ops))
+ push_target (&exec_ops);
}
}