static void exec_close_1 (void) { using_exec_ops = 0; { struct program_space *ss; struct cleanup *old_chain; old_chain = save_current_program_space (); ALL_PSPACES (ss) { set_current_program_space (ss); /* Delete all target sections. */ resize_section_table (current_target_sections, -resize_section_table (current_target_sections, 0)); exec_close (); } do_cleanups (old_chain); } }
static void exec_close_1 (int quitting) { int need_symtab_cleanup = 0; struct vmap *vp, *nxt; using_exec_ops = 0; for (nxt = vmap; nxt != NULL;) { vp = nxt; nxt = vp->nxt; /* if there is an objfile associated with this bfd, free_objfile() will do proper cleanup of objfile *and* bfd. */ if (vp->objfile) { free_objfile (vp->objfile); need_symtab_cleanup = 1; } else if (vp->bfd != exec_bfd) /* FIXME-leak: We should be freeing vp->name too, I think. */ gdb_bfd_close_or_warn (vp->bfd); xfree (vp); } vmap = NULL; { struct program_space *ss; struct cleanup *old_chain; old_chain = save_current_program_space (); ALL_PSPACES (ss) { set_current_program_space (ss); /* Delete all target sections. */ resize_section_table (current_target_sections, -resize_section_table (current_target_sections, 0)); exec_close (); } do_cleanups (old_chain); } }
static void exec_close_1 (struct target_ops *self) { 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); }
static void exec_close_1 (int quitting) { struct vmap *vp, *nxt; using_exec_ops = 0; for (nxt = vmap; nxt != NULL;) { vp = nxt; nxt = vp->nxt; if (vp->objfile) free_objfile (vp->objfile); gdb_bfd_unref (vp->bfd); xfree (vp); } vmap = NULL; { struct program_space *ss; struct cleanup *old_chain; old_chain = save_current_program_space (); ALL_PSPACES (ss) { set_current_program_space (ss); /* Delete all target sections. */ resize_section_table (current_target_sections, -resize_section_table (current_target_sections, 0)); exec_close (); } do_cleanups (old_chain); } }
ps_err_e ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj, const char *name, psaddr_t *sym_addr) { struct bound_minimal_symbol ms; struct cleanup *old_chain = save_current_program_space (); struct inferior *inf = find_inferior_ptid (ph->ptid); ps_err_e result; set_current_program_space (inf->pspace); /* FIXME: kettenis/2000-09-03: What should we do with OBJ? */ ms = lookup_minimal_symbol (name, NULL, NULL); if (ms.minsym == NULL) result = PS_NOSYM; else { *sym_addr = core_addr_to_ps_addr (BMSYMBOL_VALUE_ADDRESS (ms)); result = PS_OK; } do_cleanups (old_chain); return result; }