Message ID | 047d7b15faa92d0dac052d29e927@google.com |
---|---|
State | New |
Headers | show |
On 16-03-03 02:21 PM, Doug Evans wrote: > 2016-03-03 Doug Evans <dje@google.com> > > * gdb.base/skip.c (main): Call test_skip_file_and_function. > * gdb.base/skip.exp: Remove hand calling test_skip_file_and_function. > > diff --git a/gdb/testsuite/gdb.base/skip.c b/gdb/testsuite/gdb.base/skip.c > index b9db2a7..e43da1e 100644 > --- a/gdb/testsuite/gdb.base/skip.c > +++ b/gdb/testsuite/gdb.base/skip.c > @@ -25,8 +25,14 @@ void skip1_test_skip_file_and_function (void); > int > main () > { > + int x; > + > /* Use comma operator to sequence evaluation of bar and foo. */ > - return baz ((bar (), foo ())); > + x = baz ((bar (), foo ())); > + > + test_skip_file_and_function (); This function should be forward-declared. Otherwise, it LGTM. I tested it on the target that reported the problem initially, and it's now 100% pass. Thank you very much!
diff --git a/gdb/testsuite/gdb.base/skip.c b/gdb/testsuite/gdb.base/skip.c index b9db2a7..e43da1e 100644 --- a/gdb/testsuite/gdb.base/skip.c +++ b/gdb/testsuite/gdb.base/skip.c @@ -25,8 +25,14 @@ void skip1_test_skip_file_and_function (void); int main () { + int x; + /* Use comma operator to sequence evaluation of bar and foo. */ - return baz ((bar (), foo ())); + x = baz ((bar (), foo ())); + + test_skip_file_and_function (); + + return 0; } int diff --git a/gdb/testsuite/gdb.base/skip.exp b/gdb/testsuite/gdb.base/skip.exp index 67ae9d9..ce55dd2 100644 --- a/gdb/testsuite/gdb.base/skip.exp +++ b/gdb/testsuite/gdb.base/skip.exp @@ -281,17 +281,15 @@ with_test_prefix "step using -rfu for baz" { # Test -fi + -fu. with_test_prefix "step using -fi + -fu" { - if ![runto_main] { - fail "Can't run to main" + gdb_test_no_output "skip delete" + + if ![runto test_skip_file_and_function no-message] { + fail "Can't run to test_skip_file_and_function" return } - gdb_test_no_output "skip delete" gdb_test "skip -fi skip1.c -fu test_skip" \ "Function test_skip in file skip1.c will be skipped when stepping\." - gdb_breakpoint "test_skip_file_and_function" - gdb_breakpoint "end_test_skip_file_and_function" - gdb_test "call test_skip_file_and_function ()" "silently stop." # Verify we can step into skip.c:test_skip but not skip1.c:test_skip. gdb_test "step" "test_skip \\(\\) at.*" "step 1" gdb_test "step" "test_skip_file_and_function \\(\\) at.*" "step 2"; #