2004-01-17 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / target.c
index 4c12bda3f8ad07c0ca29e528b2201f2cd1968813..cc3b747d4b8cc930fcfcbf2820a4640115fa80bb 100644 (file)
@@ -709,8 +709,6 @@ unpush_target (struct target_ops *t)
   struct target_ops **cur;
   struct target_ops *tmp;
 
-  target_close (t, 0);
-
   /* Look for the specified target.  Note that we assume that a target
      can only occur once in the target stack. */
 
@@ -723,6 +721,14 @@ unpush_target (struct target_ops *t)
   if ((*cur) == NULL)
     return 0;                  /* Didn't find target_ops, quit now */
 
+  /* NOTE: cagney/2003-12-06: In '94 the close call was made
+     unconditional by moving it to before the above check that the
+     target was in the target stack (something about "Change the way
+     pushing and popping of targets work to support target overlays
+     and inheritance").  This doesn't make much sense - only open
+     targets should be closed.  */
+  target_close (t, 0);
+
   /* Unchain the target */
   tmp = (*cur);
   (*cur) = (*cur)->beneath;
This page took 0.032217 seconds and 4 git commands to generate.