public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Bruno Larsen <blarsen@redhat.com>
To: Tom Tromey <tom@tromey.com>,
	Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2 3/4] gdb/testsuite: fix testing gdb.reverse/step-reverse.exp with clang
Date: Fri, 28 Jul 2023 15:20:03 +0200	[thread overview]
Message-ID: <c70b90b6-6531-1650-f85d-e86a6188669a@redhat.com> (raw)
In-Reply-To: <873518i3ey.fsf@tromey.com>

On 28/07/2023 15:14, Tom Tromey wrote:
>>>>>> "Bruno" == Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org> writes:
> Bruno> It also adds a new parameter to get_hexadecimal_valueof, so that we can
> Bruno> use it without generating new passes, otherwise we'd get multiple
> Bruno> duplicate test names. This change shouldn't affect any other test using
> Bruno> this proc.
>
> You can just pass different test names instead.

I mean, yeah I can, but since it is in a loop, the differences would 
only be a counter at the end of the test case. Are we really getting any 
value from that? To me it seems like it would just boggle down the sum 
file with meaningless "tests" that aren't exercising any relevant code 
paths. I can do it if you disagree, though, it isn't a big deal.

One thing I did think of was that I should test for default value when 
getting the PC, to make sure that we didnt get a valid PC at first, then 
started getting "no registers" or similar. I'll have that on v3

-- 
Cheers,
Bruno

>
> Bruno> +proc get_current_pc {} {
> Bruno> +    set pc 0
> Bruno> +    gdb_test_multiple "print \$pc" "" {
> Bruno> +	-re -wrap ".*0x(\[0-9a-f\]+).*" {
> Bruno> +	    set pc $expect_out(1,string)
> Bruno> +	}
> Bruno> +    }
> Bruno> +    return $pc
>
> It seems to me that this shouldn't be needed.
>
> Bruno> diff --git a/gdb/testsuite/gdb.reverse/step-reverse.exp b/gdb/testsuite/gdb.reverse/step-reverse.exp
> Bruno> index 4b78a8f8fb7..9ff97bfde42 100644
> Bruno> --- a/gdb/testsuite/gdb.reverse/step-reverse.exp
> Bruno> +++ b/gdb/testsuite/gdb.reverse/step-reverse.exp
> Bruno> @@ -28,6 +28,16 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
> Bruno>      return -1
> Bruno>  }
>   
> Bruno> +proc get_current_pc {} {
> Bruno> +    set pc 0
> Bruno> +    gdb_test_multiple "print \$pc" "" {
> Bruno> +	-re -wrap ".*0x(\[0-9a-f\]+).*" {
> Bruno> +	    set pc $expect_out(1,string)
> Bruno> +	}
> Bruno> +    }
> Bruno> +    return $pc
>
> Same with this one.
>
> Tom
>


  reply	other threads:[~2023-07-28 13:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25  9:58 [PATCH 0/4] Many fixes to gdb.reverse tests Bruno Larsen
2023-07-25  9:58 ` [PATCH 1/4] gdb/testsuite: Fix many errors in gdb.reverse with clang Bruno Larsen
2023-07-25  9:58 ` [PATCH 2/4] gdb/testsuite: fix gdb.reverse/solib-*.exp tests when using clang Bruno Larsen
2023-07-26 13:37   ` Tom Tromey
2023-07-25  9:58 ` [PATCH 3/4] gdb/testsuite: fix testing gdb.reverse/step-reverse.exp with clang Bruno Larsen
2023-07-26 13:39   ` Tom Tromey
2023-07-25  9:58 ` [PATCH 4/4] gdb/testsuite: Multiple improvements for gdb.reverse/insn-reverse.exp Bruno Larsen
2023-07-27  7:41 ` [PATCH v2 0/4] Many fixes to gdb.reverse tests Bruno Larsen
2023-07-27  7:41   ` [PATCH v2 1/4] gdb/testsuite: Fix many errors in gdb.reverse with clang Bruno Larsen
2023-07-27  7:41   ` [PATCH v2 2/4] gdb/testsuite: fix gdb.reverse/solib-*.exp tests when using clang Bruno Larsen
2023-07-27  7:41   ` [PATCH v2 3/4] gdb/testsuite: fix testing gdb.reverse/step-reverse.exp with clang Bruno Larsen
2023-07-28 13:14     ` Tom Tromey
2023-07-28 13:20       ` Bruno Larsen [this message]
2023-07-28 14:18         ` Tom Tromey
2023-07-28 14:20           ` Bruno Larsen
2023-07-27  7:41   ` [PATCH v2 4/4] gdb/testsuite: Multiple improvements for gdb.reverse/insn-reverse.exp 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=c70b90b6-6531-1650-f85d-e86a6188669a@redhat.com \
    --to=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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).