From 67e947deb2bd91e8394b47c2babf9601571685f6 Mon Sep 17 00:00:00 2001 From: Stu Grossman Date: Sat, 23 Jul 1994 08:01:09 +0000 Subject: [PATCH] * target.c (unpush_target): Fix handling of removal of top target. --- gdb/ChangeLog | 4 ++++ gdb/target.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1260e51dd6..1f809c9a91 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +Sat Jul 23 00:58:15 1994 Stu Grossman (grossman@cygnus.com) + + * target.c (unpush_target): Fix handling of removal of top target. + Fri Jul 22 17:30:39 1994 Stu Grossman (grossman@cygnus.com) * Makefile.in: Add stuff to build nlmstub. diff --git a/gdb/target.c b/gdb/target.c index f68b9ab6cd..10ff09cac1 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 (¤t_target); return 1; }