From: Andrew Cagney Date: Mon, 26 Jul 2004 19:01:36 +0000 (+0000) Subject: 2004-07-26 Andrew Cagney X-Git-Tag: gdb_6_2-20040730-release~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e256bbd48d7ebc7aa92ad295090f1cf9c68f8d2;p=thirdparty%2Fbinutils-gdb.git 2004-07-26 Andrew Cagney Problem reported by Ashley Pittman . * main.c (captured_main): When in batch mode always detach. --- 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); }