This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PUSHED 3/8] gdb.base/async.exp: Fix stepi& test.
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 19 Mar 2014 15:57:56 +0000
- Subject: [PUSHED 3/8] gdb.base/async.exp: Fix stepi& test.
- Authentication-results: sourceware.org; auth=none
- References: <1395244681-24272-1-git-send-email-palves at redhat dot com>
Currently the test assumes that "stepi" over:
13 x = 5;
end up somewhere midline. But, (at least) on x86, that assignment
ends up compiled as just one movl instruction, so a stepi stops at the
next line already:
completed.
PASS: gdb.base/async.exp: step &
step&
(gdb) foo () at ../../../src/gdb/testsuite/gdb.base/async.c:13
13 x = 5;
completed.
PASS: gdb.base/async.exp: step &
stepi&
(gdb) 14 y = 3;
completed.
FAIL: gdb.base/async.exp: (timeout) stepi &
nexti&
(gdb) 16 return x + y;
completed.
FAIL: gdb.base/async.exp: (timeout) nexti &
finish&
Run till exit from #0 foo () at ../../../src/gdb/testsuite/gdb.base/async.c:16
This patch fixes it, by making sure there's more than one instruction
in that line.
gdb/testsuite/
2014-03-19 Pedro Alves <palves@redhat.com>
* gdb.base/async.c (foo): Make 'x' volatile. Write to it twice in
the same line.
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.base/async.c | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index fa7b282..cc8de97 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2014-03-19 Pedro Alves <palves@redhat.com>
+ * gdb.base/async.c (foo): Make 'x' volatile. Write to it twice in
+ the same line.
+
+2014-03-19 Pedro Alves <palves@redhat.com>
+
* gdb.base/async.c (main): Add "jump here" and "until here" line
marker comments.
* gdb.base/async.exp (jump_here): New global.
diff --git a/gdb/testsuite/gdb.base/async.c b/gdb/testsuite/gdb.base/async.c
index fb53082..76ce8be 100644
--- a/gdb/testsuite/gdb.base/async.c
+++ b/gdb/testsuite/gdb.base/async.c
@@ -8,9 +8,10 @@ int
foo ()
#endif
{
- int x, y;
+ int y;
+ volatile int x;
- x = 5;
+ x = 5; x = 5;
y = 3;
return x + y;
--
1.7.11.7