]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb.base/async.exp: Fix stepi& test.
authorPedro Alves <palves@redhat.com>
Wed, 19 Mar 2014 15:22:44 +0000 (15:22 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 19 Mar 2014 15:50:53 +0000 (15:50 +0000)
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
gdb/testsuite/gdb.base/async.c

index fa7b282af517509913b77e449c69d3e9f8c78748..cc8de97b1933d2643e9fa14ebb4b9a91a09ba55d 100644 (file)
@@ -1,3 +1,8 @@
+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
index fb5308248a8e358bb7f6f55306d851c1bfd449b1..76ce8be57a644ea97b5dc407d57e7037aab0d923 100644 (file)
@@ -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;