Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix mi_expect_stop for non-zero exit codes
@ 2013-06-25 19:13 Simon Marchi
  2013-06-25 19:14 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Marchi @ 2013-06-25 19:13 UTC (permalink / raw)
  To: GDB Patches

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 ""


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-25 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-25 19:13 [PATCH] Fix mi_expect_stop for non-zero exit codes Simon Marchi
2013-06-25 19:14 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox