Skip to content

Commit

Permalink
gdb.base/async.exp: Fix stepi& test.
Browse files Browse the repository at this point in the history
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  <[email protected]>

	* gdb.base/async.c (foo): Make 'x' volatile.  Write to it twice in
	the same line.
  • Loading branch information
palves committed Mar 19, 2014
1 parent e2f6c96 commit f48088c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions gdb/testsuite/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2014-03-19 Pedro Alves <[email protected]>

* gdb.base/async.c (foo): Make 'x' volatile. Write to it twice in
the same line.

2014-03-19 Pedro Alves <[email protected]>

* gdb.base/async.c (main): Add "jump here" and "until here" line
Expand Down
5 changes: 3 additions & 2 deletions gdb/testsuite/gdb.base/async.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f48088c

Please sign in to comment.