Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH v2] Fix mi_expect_stop for non-zero exit codes
Date: Tue, 13 May 2014 21:14:00 -0000	[thread overview]
Message-ID: <1400015633-16145-1-git-send-email-simon.marchi@ericsson.com> (raw)

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  <simon.marchi@ericsson.com>

	* 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


             reply	other threads:[~2014-05-13 21:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 21:14 Simon Marchi [this message]
2014-05-15 18:39 ` Tom Tromey
2014-05-15 19:44   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1400015633-16145-1-git-send-email-simon.marchi@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox