static void core_close (int quitting) { char *name; if (core_bfd) { int pid = ptid_get_pid (inferior_ptid); inferior_ptid = null_ptid; /* Avoid confusion from thread stuff. */ if (pid != 0) exit_inferior_silent (pid); /* Clear out solib state while the bfd is still open. See comments in clear_solib in solib.c. */ clear_solib (); if (core_data) { xfree (core_data->sections); xfree (core_data); core_data = NULL; } name = bfd_get_filename (core_bfd); gdb_bfd_close_or_warn (core_bfd); xfree (name); core_bfd = NULL; } core_vec = NULL; core_gdbarch = NULL; }
static void core_close (struct target_ops *self) { if (core_bfd) { int pid = ptid_get_pid (inferior_ptid); inferior_ptid = null_ptid; /* Avoid confusion from thread stuff. */ if (pid != 0) exit_inferior_silent (pid); /* Clear out solib state while the bfd is still open. See comments in clear_solib in solib.c. */ clear_solib (); if (core_data) { xfree (core_data->sections); xfree (core_data); core_data = NULL; } gdb_bfd_unref (core_bfd); core_bfd = NULL; } core_vec = NULL; core_gdbarch = NULL; }
static void fbsd_core_detach (char *args, int from_tty) { if (fbsd_thread_active) fbsd_thread_deactivate (); unpush_target (&fbsd_thread_ops); orig_core_ops.to_detach (args, from_tty); /* Clear gdb solib information and symbol file cache, so that after detach and re-attach, new_objfile hook will be called */ clear_solib(); symbol_file_clear(0); }
static void nbsd_thread_detach (struct target_ops *ops, const char *args, int from_tty) { struct target_ops *beneath = find_target_beneath (ops); unpush_target (ops); td_close (main_ta); /* Ordinarily, gdb caches solib information, but this means that it won't call the new_obfile hook on a reattach. Clear the symbol file cache so that attach -> detach -> attach works. */ clear_solib(); symbol_file_clear(0); beneath->to_detach (beneath, args, from_tty); nbsd_thread_deactivate (); }
static void kgdb_trgt_close(int quitting) { if (kvm != NULL) { inferior_ptid = null_ptid; clear_solib(); if (kvm_close(kvm) != 0) warning("cannot close \"%s\": %s", vmcore, kvm_geterr(kvm)); kvm = NULL; xfree(vmcore); vmcore = NULL; } }
void core_target::close () { if (core_bfd) { inferior_ptid = null_ptid; /* Avoid confusion from thread stuff. */ exit_inferior_silent (current_inferior ()); /* Clear out solib state while the bfd is still open. See comments in clear_solib in solib.c. */ clear_solib (); current_program_space->cbfd.reset (nullptr); } /* Core targets are heap-allocated (see core_target_open), so here we delete ourselves. */ delete this; }