aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2012-01-19 16:32:59 +0000
committerPedro Alves <palves@redhat.com>2012-01-19 16:32:59 +0000
commit305436e07ac142e2cd8f9659bf8d6ad9630d5008 (patch)
treee286c155da31aad656b96c3233dd2757dd3c37b4 /gdb/target.c
parent2fc0fe4faa2bee97a91ad1948900778c459ce977 (diff)
downloadgdb-305436e07ac142e2cd8f9659bf8d6ad9630d5008.zip
gdb-305436e07ac142e2cd8f9659bf8d6ad9630d5008.tar.gz
gdb-305436e07ac142e2cd8f9659bf8d6ad9630d5008.tar.bz2
2012-01-19 Pedro Alves <palves@redhat.com>
* linux-nat.c (linux_nat_close): Call linux_nat_is_async_p and linux_nat_async directly instead of going through the target vector. * target.c (unpush_target): Close target after unpushing it, not before.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 9aaa0ea..6af4620 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1010,16 +1010,10 @@ unpush_target (struct target_ops *t)
break;
}
+ /* If we don't find target_ops, quit. Only open targets should be
+ closed. */
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);
+ return 0;
/* Unchain the target. */
tmp = (*cur);
@@ -1028,6 +1022,11 @@ unpush_target (struct target_ops *t)
update_current_target ();
+ /* Finally close the target. Note we do this after unchaining, so
+ any target method calls from within the target_close
+ implementation don't end up in T anymore. */
+ target_close (t, 0);
+
return 1;
}