summaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-07-26 19:01:51 +0000
committerAndrew Cagney <cagney@redhat.com>2004-07-26 19:01:51 +0000
commit24cba63d89c3a765387e3f6f118b463b54b46433 (patch)
tree4a1e0a73afd77ae46cf55b8c181693894e150aee /gdb/main.c
parent747e40d9d6c9929fcab6e5a3e923d0f5360cf9b4 (diff)
downloadgdb-24cba63d89c3a765387e3f6f118b463b54b46433.tar.gz
2004-07-26 Andrew Cagney <cagney@gnu.org>
Problem reported by Ashley Pittman <ashley@quadrics.com>. * main.c (captured_main): When in batch mode always detach.
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 4e5fd2a02f5..0042962c5dc 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -729,6 +729,13 @@ extern int gdbtk_test (char *);
if (batch)
{
+ if (attach_flag)
+ /* Either there was a problem executing the command in the
+ batch file aborted early, or the batch file forgot to do an
+ explicit detach. Explicitly detach the inferior ensuring
+ that there are no zombies. */
+ target_detach (NULL, 0);
+
/* We have hit the end of the batch file. */
exit (0);
}