aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-07-24 19:34:17 +0100
committerPedro Alves <palves@redhat.com>2015-07-24 19:34:17 +0100
commit5068630ad34dce5fefbe68d70d3a50cd8b92f71e (patch)
treef586526bba18cdf565960cdbb32669a95026be6b /gdb
parent7759842763d94dc2f1c7d52d09f9203830b753ab (diff)
downloadgdb-5068630ad34dce5fefbe68d70d3a50cd8b92f71e.zip
gdb-5068630ad34dce5fefbe68d70d3a50cd8b92f71e.tar.gz
gdb-5068630ad34dce5fefbe68d70d3a50cd8b92f71e.tar.bz2
gdb.python/py-events.exp and normal_stop observers ordering
I have patches that: 1 - make the CLI print stop info from a normal_stop observer, like MI does. 2 - happen to change the order in which the Python and CLI/TUI normal_stop observers are installed. With those in place, py-events.exp regresses like shown below [1], because the Python stop events are output before CLI prints stop info, instead of after, and the test doesn't expect that. With the same Python hooks, the order in which MI and Python events is emited today is already undefined, because MI also uses the normal_stop observer for output. I see no reason that we should in general define the order observers, interpreters and scripting languages get their turn at being notified of these events. So this patch makes the test cope with Python->CLI output order too. Tested on x86_64 Fedora 20. gdb/testsuite/ 2015-07-24 Pedro Alves <palves@redhat.com> * gdb.python/py-events.exp: Accept output between the stop event and the prompt. * gdb.python/py-evsignal.exp: Likewise. * gdb.python/py-evthreads.exp: Likewise. [1] - The regressions in question look like: Before said patches: (gdb) continue Continuing. event type: continue Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30 30 for (i = 0; i < 2; i++) event type: stop event type: stop stop reason: breakpoint first breakpoint number: 2 breakpoint number: 2 breakpoint number: 3 all threads stopped (gdb) PASS: gdb.python/py-events.exp: continue After said patches: (gdb) continue Continuing. event type: continue event type: stop event type: stop stop reason: breakpoint first breakpoint number: 2 breakpoint number: 2 breakpoint number: 3 all threads stopped Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30 30 for (i = 0; i < 2; i++) (gdb) FAIL: gdb.python/py-events.exp: continue
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.python/py-events.exp4
-rw-r--r--gdb/testsuite/gdb.python/py-evsignal.exp2
-rw-r--r--gdb/testsuite/gdb.python/py-evthreads.exp8
4 files changed, 14 insertions, 7 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 535a540..8e878f1 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,12 @@
2015-07-24 Pedro Alves <palves@redhat.com>
+ * gdb.python/py-events.exp: Accept output between the stop event
+ and the prompt.
+ * gdb.python/py-evsignal.exp: Likewise.
+ * gdb.python/py-evthreads.exp: Likewise.
+
+2015-07-24 Pedro Alves <palves@redhat.com>
+
PR gdb/18717
* gdb.threads/non-ldr-exit.c: New file.
* gdb.threads/non-ldr-exit.exp: New file.
diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp
index 2d89eb6..f880b84 100644
--- a/gdb/testsuite/gdb.python/py-events.exp
+++ b/gdb/testsuite/gdb.python/py-events.exp
@@ -65,7 +65,7 @@ gdb_test "continue" ".*event type: continue.*
.*first breakpoint number: 2.*
.*breakpoint number: 2.*
.*breakpoint number: 3.*
-all threads stopped"
+all threads stopped.*"
# Test that when "step N" trips on a breakpoint, we get a stop event
# with breakpoint stop reason.
@@ -75,7 +75,7 @@ gdb_test "step 3" ".*event type: continue.*
.*stop reason: breakpoint.*
.*first breakpoint number: 4.*
.*breakpoint number: 4.*
-all threads stopped"
+all threads stopped.*"
delete_breakpoints
diff --git a/gdb/testsuite/gdb.python/py-evsignal.exp b/gdb/testsuite/gdb.python/py-evsignal.exp
index c90be8a..ea7b73b 100644
--- a/gdb/testsuite/gdb.python/py-evsignal.exp
+++ b/gdb/testsuite/gdb.python/py-evsignal.exp
@@ -38,7 +38,7 @@ gdb_test_no_output "set non-stop on"
gdb_run_cmd
gdb_test_multiple "" "Signal Thread 3" {
- -re "event type: stop\r\nstop reason: signal\r\nstop signal: SIGUSR1\r\nthread num: 3\r\nevent type: stop\r\n$gdb_prompt $" {
+ -re "event type: stop\r\nstop reason: signal\r\nstop signal: SIGUSR1\r\nthread num: 3\r\nevent type: stop\r\n.*$gdb_prompt $" {
pass "thread 3 was signaled"
}
-re "The target does not support running in non-stop mode" {
diff --git a/gdb/testsuite/gdb.python/py-evthreads.exp b/gdb/testsuite/gdb.python/py-evthreads.exp
index 4c9a53a..deefda5 100644
--- a/gdb/testsuite/gdb.python/py-evthreads.exp
+++ b/gdb/testsuite/gdb.python/py-evthreads.exp
@@ -48,7 +48,7 @@ gdb_breakpoint "thread3"
gdb_run_cmd
set test "Run to breakpoint 1"
gdb_test_multiple "" $test {
- -re "event type: stop\r\nstop reason: breakpoint\r\nfirst breakpoint number: 1\r\nbreakpoint number: 1\r\nthread num: 1\r\n$gdb_prompt $" {
+ -re "event type: stop\r\nstop reason: breakpoint\r\nfirst breakpoint number: 1\r\nbreakpoint number: 1\r\nthread num: 1\r\n.*$gdb_prompt $" {
pass $test
}
-re "The target does not support running in non-stop mode" {
@@ -57,11 +57,11 @@ gdb_test_multiple "" $test {
}
}
-gdb_test "next" "event type: stop\r\nstop reason: breakpoint\r\nfirst breakpoint number: 2\r\nbreakpoint number: 2\r\nthread num: 2" "reached breakpoint 2"
+gdb_test "next" "event type: stop\r\nstop reason: breakpoint\r\nfirst breakpoint number: 2\r\nbreakpoint number: 2\r\nthread num: 2.*" "reached breakpoint 2"
gdb_test "thread 2" {\[Switching to thread 2 .*}
-gdb_test "next" "event type: stop\r\nstop reason: breakpoint\r\nfirst breakpoint number: 3\r\nbreakpoint number: 3\r\nthread num: 3" "reached breakpoint 3"
+gdb_test "next" "event type: stop\r\nstop reason: breakpoint\r\nfirst breakpoint number: 3\r\nbreakpoint number: 3\r\nthread num: 3.*" "reached breakpoint 3"
gdb_test "thread 3" {\[Switching to thread 3 .*}
@@ -75,7 +75,7 @@ gdb_test_multiple "continue&" $test {
set test "thread 3 was signaled"
gdb_test_multiple "" $test {
- -re "event type: stop\r\nstop reason: signal\r\nstop signal: SIGUSR1\r\nthread num: 3\r\nevent type: stop\r\n$" {
+ -re "event type: stop\r\nstop reason: signal\r\nstop signal: SIGUSR1\r\nthread num: 3\r\nevent type: stop\r\n" {
pass $test
}
}