aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-01-05 22:32:23 +0000
committerAndrew Cagney <cagney@redhat.com>2004-01-05 22:32:23 +0000
commit5269965e4ca43d4cbbb90bdae10e3614ac7e2004 (patch)
tree7d7c2bc260adaa4e92c3e6774e4f5e722e4f3fc5
parent4a4c4a1dfbe39e44fd7c80b3883453fb4d1d1579 (diff)
downloadgdb-5269965e4ca43d4cbbb90bdae10e3614ac7e2004.zip
gdb-5269965e4ca43d4cbbb90bdae10e3614ac7e2004.tar.gz
gdb-5269965e4ca43d4cbbb90bdae10e3614ac7e2004.tar.bz2
2004-01-05 Andrew Cagney <cagney@redhat.com>
* target.c (unpush_target): Only close a target that is in the target stack.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/target.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2c4903e..4a0ba8b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-05 Andrew Cagney <cagney@redhat.com>
+
+ * target.c (unpush_target): Only close a target that is in the
+ target stack.
+
2004-01-05 Mark Kettenis <kettenis@gnu.org>
* sparc-tdep.c (sparc_extract_struct_value_address): Get the
diff --git a/gdb/target.c b/gdb/target.c
index 4c12bda..cc3b747 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -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;