aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1994-07-23 08:01:09 +0000
committerStu Grossman <grossman@cygnus>1994-07-23 08:01:09 +0000
commit67e947deb2bd91e8394b47c2babf9601571685f6 (patch)
tree5669833fd41db515c58a30cd76d5007fd0da878f /gdb/target.c
parentc7f722531493cfd5d5a17f8a29e68bbd5cb0e7d2 (diff)
downloadgdb-67e947deb2bd91e8394b47c2babf9601571685f6.zip
gdb-67e947deb2bd91e8394b47c2babf9601571685f6.tar.gz
gdb-67e947deb2bd91e8394b47c2babf9601571685f6.tar.bz2
* target.c (unpush_target): Fix handling of removal of top target.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/target.c b/gdb/target.c
index f68b9ab..10ff09c 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -443,6 +443,8 @@ unpush_target (t)
{
struct target_stack_item *cur, *prev;
+ t->to_close (0); /* Let it clean up */
+
/* Look for the specified target. Note that we assume that a target
can only occur once in the target stack. */
@@ -456,13 +458,14 @@ unpush_target (t)
/* Unchain the target */
if (!prev)
- target_stack = NULL;
+ target_stack = cur->next;
else
prev->next = cur->next;
free (cur); /* Release the target_stack_item */
- (t->to_close) (0); /* Let it clean up */
+ update_current_target ();
+ cleanup_target (&current_target);
return 1;
}