mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 04:00:07 +08:00
gdb.base/async.exp: Don't hardcode line numbers.
gdb/testsuite/ 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. (jump& test): Use it. (until_here): New global. (until& test): Use it.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
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.
|
||||||
|
(jump& test): Use it.
|
||||||
|
(until_here): New global.
|
||||||
|
(until& test): Use it.
|
||||||
|
|
||||||
2014-03-19 Pedro Alves <palves@redhat.com>
|
2014-03-19 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* gdb.base/async.exp: Don't frob gdb_protocol.
|
* gdb.base/async.exp: Don't frob gdb_protocol.
|
||||||
|
@ -30,9 +30,9 @@ main ()
|
|||||||
z = 9;
|
z = 9;
|
||||||
y = foo ();
|
y = foo ();
|
||||||
z = y;
|
z = y;
|
||||||
y = y + 2;
|
y = y + 2; /* jump here */
|
||||||
y = baz ();
|
y = baz ();
|
||||||
return 0;
|
return 0; /* until here */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,17 +103,21 @@ gdb_expect {
|
|||||||
timeout { fail "(timeout) finish &" }
|
timeout { fail "(timeout) finish &" }
|
||||||
}
|
}
|
||||||
|
|
||||||
send_gdb "jump 33&\n"
|
set jump_here [gdb_get_line_number "jump here"]
|
||||||
|
|
||||||
|
send_gdb "jump $jump_here&\n"
|
||||||
gdb_expect {
|
gdb_expect {
|
||||||
-re "^jump 33&.*Continuing at $hex.*$gdb_prompt.*Breakpoint 2, baz \\(\\) at.*async.c.*return 5.*completed\.\r\n" \
|
-re "^jump $jump_here&.*Continuing at $hex.*$gdb_prompt.*Breakpoint 2, baz \\(\\) at.*async.c.*return 5.*completed\.\r\n" \
|
||||||
{ pass "jump &" }
|
{ pass "jump &" }
|
||||||
-re ".*$gdb_prompt.*completed\.$" { fail "jump &" }
|
-re ".*$gdb_prompt.*completed\.$" { fail "jump &" }
|
||||||
timeout { fail "(timeout) jump &" }
|
timeout { fail "(timeout) jump &" }
|
||||||
}
|
}
|
||||||
|
|
||||||
send_gdb "until 35&\n"
|
set until_here [gdb_get_line_number "until here"]
|
||||||
|
|
||||||
|
send_gdb "until $until_here&\n"
|
||||||
gdb_expect {
|
gdb_expect {
|
||||||
-re "^until 35&.*$gdb_prompt.*$hex in main \\(\\) at.*async.c.*y = baz \\(\\).*completed\.\r\n" \
|
-re "^until $until_here&.*$gdb_prompt.*$hex in main \\(\\) at.*async.c.*y = baz \\(\\).*completed\.\r\n" \
|
||||||
{ pass "until &" }
|
{ pass "until &" }
|
||||||
-re "$gdb_prompt.*completed\.$" { fail "until &" }
|
-re "$gdb_prompt.*completed\.$" { fail "until &" }
|
||||||
timeout { fail "(timeout) until &" }
|
timeout { fail "(timeout) until &" }
|
||||||
|
Reference in New Issue
Block a user