From patchwork Wed Sep 2 21:24:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 8557 Received: (qmail 115798 invoked by alias); 2 Sep 2015 21:24:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 115785 invoked by uid 89); 2 Sep 2015 21:24:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg21.ericsson.net Received: from usevmg21.ericsson.net (HELO usevmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 02 Sep 2015 21:24:44 +0000 Received: from EUSAAHC003.ericsson.se (Unknown_Domain [147.117.188.81]) by usevmg21.ericsson.net (Symantec Mail Security) with SMTP id 67.93.26730.2EEF6E55; Wed, 2 Sep 2015 15:51:31 +0200 (CEST) Received: from elxcz23q12-y4.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.81) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 2 Sep 2015 17:24:42 -0400 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH] Fix mi-detach.exp on native-gdbserver Date: Wed, 2 Sep 2015 17:24:38 -0400 Message-ID: <1441229078-22073-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-IsSubscribed: yes The =thread-exited event did not appear when detaching from a process with "target remote". When mourning an inferior, target remote takes a different path than target extended_remote. target remote calls unpush_target first which calls remote_close in order to close the "remote" target. remote_close calls discard_all_inferiors, which exits all inferiors with exit_inferior_silent. Because it's the _silent version, we don't see the MI event. extended_remote_mourn calls generic_mourn_inferior, which calls exit_inferior. Since it's the non-silent version, we see the MI event. When changing discard_all_inferiors to call exit_inferior instead of exit_inferior_silent, the MI event appears. Since remote_mourn is the only place where discard_all_inferiors is used, it should be an otherwise harmless change. Regression-tested on Ubuntu 14.04, with native and native-gdbserver. gdb/ChangeLog: * inferior.c (discard_all_inferiors): Call exit_inferior instead of exit_inferior_silent. --- gdb/inferior.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/inferior.c b/gdb/inferior.c index 04e9a28..6ca18b8 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -315,7 +315,7 @@ discard_all_inferiors (void) for (inf = inferior_list; inf; inf = inf->next) { if (inf->pid != 0) - exit_inferior_silent (inf->pid); + exit_inferior (inf->pid); } }