2004-07-26 Andrew Cagney Problem reported by Ashley Pittman . * main.c (captured_main): When in batch mode always detach. Index: main.c =================================================================== RCS file: /cvs/src/src/gdb/main.c,v retrieving revision 1.42 diff -p -u -r1.42 main.c --- main.c 17 Jul 2004 03:25:10 -0000 1.42 +++ main.c 26 Jul 2004 19:00:46 -0000 @@ -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); }