* gnu-nat.c (gnu_attach): Add process to inferiors table.
[deliverable/binutils-gdb.git] / gdb / corelow.c
index 2f2e0f501170c288549adf8f14fb8bf78bb07dc7..14868e26570877e8dcec3010dc1d5f336b21b700 100644 (file)
@@ -93,6 +93,9 @@ void _initialize_corelow (void);
 
 struct target_ops core_ops;
 
+/* An arbitrary identifier for the core inferior.  */
+#define CORELOW_PID 1
+
 /* Link a new core_fns into the global core_file_fns list.  Called on gdb
    startup by the _initialize routine in each core file register reader, to
    register information about each format the the reader is prepared to
@@ -197,6 +200,7 @@ core_close (int quitting)
   if (core_bfd)
     {
       inferior_ptid = null_ptid;       /* Avoid confusion from thread stuff */
+      delete_inferior_silent (CORELOW_PID);
 
       /* Clear out solib state while the bfd is still open. See
          comments in clear_solib in solib.c. */
@@ -270,8 +274,7 @@ core_open (char *filename, int from_tty)
   bfd *temp_bfd;
   int scratch_chan;
   int flags;
-  /* An arbitrary identifier for the core inferior.  */
-  int corelow_pid = 1;
+  int corelow_pid = CORELOW_PID;
 
   target_preopen (from_tty);
   if (!filename)
@@ -355,6 +358,8 @@ core_open (char *filename, int from_tty)
   push_target (&core_ops);
   discard_cleanups (old_chain);
 
+  add_inferior_silent (corelow_pid);
+
   /* Do this before acknowledging the inferior, so if
      post_create_inferior throws (can happen easilly if you're loading
      a core file with the wrong exec), we aren't left with threads
This page took 0.024641 seconds and 4 git commands to generate.