public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Bruno Larsen <blarsen@redhat.com>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: [PATCHv2] gdb/testsuite: add KFAILs to gdb.reverse/step-reverse.exp
Date: Thu, 3 Nov 2022 15:30:38 +0100	[thread overview]
Message-ID: <717de14c-8b25-6691-5c0a-0b779997b742@redhat.com> (raw)
In-Reply-To: <c22bee29-0b92-a3c2-9241-45727d1bd6e2@simark.ca>

On 03/11/2022 14:06, Simon Marchi wrote:
>
> 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.

That makes sense. This is my first time working with gdbserver, so 
everything here is news to me.  Updated version:

---

     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

diff --git a/gdb/testsuite/gdb.reverse/step-reverse.exp 
b/gdb/testsuite/gdb.reverse/step-reverse.exp
index c28e1f6db4f..d2975cffb5c 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 target_remote [gdb_is_target_remote]

  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 {$target_remote} {
+    # gdb doesn't record the change of return pointer for remote targets,
+    # 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 {$target_remote} {
+    # 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 {$target_remote} {
+    # 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


  reply	other threads:[~2022-11-03 14:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 10:38 [PATCH v4 0/2] Fix reverse nexting over recursions Bruno Larsen
2022-10-05 10:38 ` [PATCH v4 1/2] Change calculation of frame_id by amd64 epilogue unwinder Bruno Larsen
2022-10-25 13:44   ` Simon Marchi
2022-10-25 13:51     ` Bruno Larsen
2022-10-25 13:59     ` Simon Marchi
2022-10-25 14:13       ` Bruno Larsen
2022-10-25 14:37         ` Simon Marchi
2022-10-05 10:38 ` [PATCH v4 2/2] gdb/reverse: Fix stepping over recursive functions Bruno Larsen
2022-10-25 14:55   ` Simon Marchi
2022-10-25 16:22     ` Tom de Vries
2022-11-02 17:03     ` Bruno Larsen
2022-11-02 17:46       ` Simon Marchi
2022-11-03  9:08         ` [PATCH] gdb/testsuite: add KFAILs to gdb.reverse/step-reverse.exp Bruno Larsen
2022-11-03 13:06           ` Simon Marchi
2022-11-03 14:30             ` Bruno Larsen [this message]
2022-11-03 16:59               ` [PATCHv2] " Simon Marchi
2022-11-04 11:06                 ` Bruno Larsen
2022-10-20  7:42 ` [PING][PATCH v4 0/2] Fix reverse nexting over recursions Bruno Larsen
2022-10-20 18:56   ` Tom Tromey
2022-10-21 10:50     ` Bruno Larsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=717de14c-8b25-6691-5c0a-0b779997b742@redhat.com \
    --to=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).