Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: GDB Patches <gdb-patches@sourceware.org>
Subject: [PATCH] Fix mi_expect_stop for non-zero exit codes
Date: Tue, 25 Jun 2013 19:13:00 -0000	[thread overview]
Message-ID: <51C9EB04.1090206@ericsson.com> (raw)

The message is a different when the inferior exits with zero
and non-zero values, this fix takes that into account.

I split the following patch in two distinct patches:
http://sourceware.org/ml/gdb-patches/2013-06/msg00374.html

gdb/testsuite/ChangeLog:
2013-06-25  Simon Marchi  <simon.marchi@ericsson.com>

	* lib/mi-support.exp (mi_expect_stop): Expect message for
	inferiors that exit with non-zero exit code. Also, remove useless
	whitespace just above.
---
 gdb/testsuite/lib/mi-support.exp | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/mi-support.exp
b/gdb/testsuite/lib/mi-support.exp
index 86a0fd6..b3a9de7 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -1040,7 +1040,7 @@ proc mi_expect_stop { reason func args file line
extra test } {
         }
         return
     }
-
+
     if { $reason == "exited-normally" } {

         gdb_expect {
@@ -1055,6 +1055,21 @@ 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
+    }
+
     set args "\\\[$args\\\]"

     set bn ""


             reply	other threads:[~2013-06-25 19:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25 19:13 Simon Marchi [this message]
2013-06-25 19:14 ` Pedro Alves

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=51C9EB04.1090206@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