gdb/testsuite: add KFAILs to gdb.reverse/step-reverse.exp

Message ID 20221103090836.320197-1-blarsen@redhat.com
State Superseded
Headers
Series gdb/testsuite: add KFAILs to gdb.reverse/step-reverse.exp |

Commit Message

Guinevere Larsen Nov. 3, 2022, 9:08 a.m. UTC
  > I don't know the reverse stuff well, but the explanation makes sense.
> Do you plan on tackling this bug?  If not, can you file a bug and add a
> kfail?

Sure, I do plan on tackling this at some point, but I don't know when
that will be, so I filed the bug, and this is the patch to add the
KFAILs, thoughts?

---

Recent changes to gdb.reverse/step-reverse.exp revealed the latent bug
PR record/29745, where we can't skip one funcion forward if we're using
native-gdbserver. This commit just adds kfails to the test.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29745
---
 gdb/testsuite/gdb.reverse/step-reverse.exp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
  

Comments

Simon Marchi Nov. 3, 2022, 1:06 p.m. UTC | #1
On 11/3/22 05:08, Bruno Larsen wrote:
>> I don't know the reverse stuff well, but the explanation makes sense.
>> Do you plan on tackling this bug?  If not, can you file a bug and add a
>> kfail?
> 
> Sure, I do plan on tackling this at some point, but I don't know when
> that will be, so I filed the bug, and this is the patch to add the
> KFAILs, thoughts?
> 
> ---
> 
> Recent changes to gdb.reverse/step-reverse.exp revealed the latent bug
> PR record/29745, where we can't skip one funcion forward if we're using
> native-gdbserver. This commit just adds kfails to the test.
> 
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29745
> ---
>  gdb/testsuite/gdb.reverse/step-reverse.exp | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/gdb/testsuite/gdb.reverse/step-reverse.exp b/gdb/testsuite/gdb.reverse/step-reverse.exp
> index c28e1f6db4f..37e80a7d337 100644
> --- a/gdb/testsuite/gdb.reverse/step-reverse.exp
> +++ b/gdb/testsuite/gdb.reverse/step-reverse.exp
> @@ -31,6 +31,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
>  }
>  
>  runto_main
> +set using_gdbserver [target_is_gdbserver]
>  
>  if [supports_process_record] {
>      # Activate process record/replay
> @@ -273,11 +274,25 @@ if { "$step_out" == 1 } {
>  # Step forward over recursion again so we can test stepping over calls
>  # inside the recursion itself.
>  gdb_test_no_output "set exec-dir forward" "forward again to test recursion"
> +if {$using_gdbserver} {
> +    # gdbserver doesn't record the change of return pointer, so we can't
> +    # next forward over functions.
> +    setup_kfail gdb/29745 *-*-*

There's one thing bugging me in your explanation: as far as I know,
gdbserver does any recording, with the built-in GDB recorder (i.e. not
btrace).  So we probably shouldn't say "gdbserver doesn't record", as
it's not meant to record in the first place.  That would mean the
problem is within GDB, when using the remote target.  And the check for
the kfail should therefore use gdb_is_target_remote instead of
target_is_gdbserver.

Simon
  

Patch

diff --git a/gdb/testsuite/gdb.reverse/step-reverse.exp b/gdb/testsuite/gdb.reverse/step-reverse.exp
index c28e1f6db4f..37e80a7d337 100644
--- a/gdb/testsuite/gdb.reverse/step-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/step-reverse.exp
@@ -31,6 +31,7 @@  if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 }
 
 runto_main
+set using_gdbserver [target_is_gdbserver]
 
 if [supports_process_record] {
     # Activate process record/replay
@@ -273,11 +274,25 @@  if { "$step_out" == 1 } {
 # Step forward over recursion again so we can test stepping over calls
 # inside the recursion itself.
 gdb_test_no_output "set exec-dir forward" "forward again to test recursion"
+if {$using_gdbserver} {
+    # gdbserver doesn't record the change of return pointer, so we can't
+    # next forward over functions.
+    setup_kfail gdb/29745 *-*-*
+}
 gdb_test "next" "NEXT OVER THIS CALL.*" "reverse next over recursion again"
 gdb_test_no_output "set exec-dir reverse" "reverse again to test recursion"
 
+if {$using_gdbserver} {
+    # Because of the above mentioned KFAIL, the inferior is now out of sync
+    setup_kfail gdb/29745 *-*-*
+}
 gdb_test "step" ".*EXIT RECURSIVE FUNCTION.*" "enter recursive function"
 set seen_recursive_call 0
+if {$using_gdbserver} {
+    # Because of the above mentioned KFAIL, the inferior is now out of sync
+    # The fail state below will resync the inferior.
+    setup_kfail gdb/29745 *-*-*
+}
 gdb_test_multiple "next" "step over recursion inside the recursion" {
     -re -wrap ".*RECURSIVE CALL.*" {
 	incr seen_recursive_call