From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@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 21:14:00 -0000 Message-ID: <1400015633-16145-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00182.txt.bz2 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" -- 2.0.0.rc0