From patchwork Tue May 13 21:13:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 892 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx23.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id A07F2360073 for ; Tue, 13 May 2014 14:14:08 -0700 (PDT) Received: by homiemail-mx23.g.dreamhost.com (Postfix, from userid 14314964) id 583B4638EB863; Tue, 13 May 2014 14:14:08 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx23.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx23.g.dreamhost.com (Postfix) with ESMTPS id 323D0638EB7A6 for ; Tue, 13 May 2014 14:14:08 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-type; q=dns; s=default; b=Lb9+9rZSpppeYtUe DJxfDL8XI/rrmJjI1NbaOnc0bbCQhZM6S7dpZUsG0v8fwjFfOstLe+xWroIMmIIu Ml++yEFpFfPwXRdJgpeYWQF5BJqU+pIhFes+CmgTL7j6jyPZZ3Zkwh/B+aXjNNAf DeFtzTkVniQQqcJgZeer0vLjiwg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-type; s=default; bh=FcL7Nz7HYqwBIcildeQ+LK s2KhQ=; b=BKKrL1RcNQr9DLz2JXiaIktsCs2kpW/KS0cnekjJDFNJMLjP2x2/NE ftXNe4aIE895FsxstLYZdzFeREYOaIb0UhTZYt2LDIaYK89NZIGZNMEF2QtnRReK +sgpA3xFOczLFEIcaRam4Wd8fuvpUKmZUPlCJ6ymkOtAFZEvObD0M= Received: (qmail 23827 invoked by alias); 13 May 2014 21:14:05 -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 23776 invoked by uid 89); 13 May 2014 21:14:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 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; Tue, 13 May 2014 21:14:03 +0000 Received: from EUSAAHC004.ericsson.se (Unknown_Domain [147.117.188.84]) by usevmg21.ericsson.net (Symantec Mail Security) with SMTP id 05.15.02831.45932735; Tue, 13 May 2014 17:25:09 +0200 (CEST) Received: from simark-hp.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.84) with Microsoft SMTP Server (TLS) id 14.3.174.1; Tue, 13 May 2014 17:14:01 -0400 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH v2] Fix mi_expect_stop for non-zero exit codes Date: Tue, 13 May 2014 17:13:53 -0400 Message-ID: <1400015633-16145-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in This patch was accepted almost a year ago, but I only recently received my commit access. I submit it again to make sure it is still relevant. Original submission: https://sourceware.org/ml/gdb-patches/2013-06/msg00736.html The message displayed by gdb is different when the inferior exits with zero and non-zero values, this fix takes that into account. gdb/testsuite/ChangeLog: 2014-05-13 Simon Marchi * lib/mi-support.exp (mi_expect_stop): Expect message for inferiors that exit with non-zero exit code. --- gdb/testsuite/lib/mi-support.exp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index ad58775..4478ba0 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -1068,6 +1068,20 @@ proc mi_expect_stop { reason func args file line extra test } { } return } + if { $reason == "exited" } { + gdb_expect { + -re "\\*stopped,reason=\"exited\",exit-code=\"\[0-7\]+\"\r\n$prompt_re" { + pass "$test" + } + -re ".*$mi_gdb_prompt$" { + fail "$test (inferior not stopped)" + } + timeout { + fail "$test (unknown output after running)" + } + } + return + } if { $reason == "solib-event" } { set pattern "\\*stopped,reason=\"solib-event\",thread-id=\"$decimal\",stopped-threads=$any\r\n($thread_selected_re|$breakpoint_re)*$prompt_re"