From 7ac4ac061926872510858e0ff8e37673b5de28d5 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Mon, 26 Jul 2004 19:01:51 +0000 Subject: [PATCH] 2004-07-26 Andrew Cagney Problem reported by Ashley Pittman . * main.c (captured_main): When in batch mode always detach. --- gdb/ChangeLog | 5 +++++ gdb/main.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 364d1e34d77..6130f0e1a10 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2004-07-26 Andrew Cagney + + Problem reported by Ashley Pittman . + * main.c (captured_main): When in batch mode always detach. + 2004-07-26 Andrew Cagney * MAINTAINERS: Mark the xstormy16, sh64, ns32k, mn10300, mcore, 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); } -- 2.30.2