Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Mihails Strasuns <mihails.strasuns@intel.com>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH 1/7] [gdb/testsuite] allow more registers in reader test
Date: Sat, 21 Mar 2020 22:09:36 -0400	[thread overview]
Message-ID: <0b1b6dcc-5925-89d7-1729-7933f676d0b5@simark.ca> (raw)
In-Reply-To: <d418ce77-87d9-79aa-363a-696a6b4a213b@simark.ca>

On 2020-03-21 12:03 p.m., Simon Marchi wrote:
> On 2020-02-18 7:43 a.m., Mihails Strasuns wrote:
>> Fixes jit-reader test failures on systems that have more registers than
>> expected by the current condition.
>>
>> gdb/testsuite/ChangeLog:
>>
>> 2020-02-18  Mihails Strasuns  <mihails.strasuns@intel.com>
>>
>> 	* gdb.base/jit-reader.exp: relax register output check
>>
>> Signed-off-by: Mihails Strasuns <mihails.strasuns@intel.com>
>> Change-Id: I227ab8691b2363d626f7100216477ab637f619fa
> 
> This is fine with me too, but could you please just quote in the commit message what
> are the extra registers you see?  And maybe what hardware/cpu you run on, to help
> anybody who would like to replicate what you are seeing.
> 
> Thanks,
> 
> Simon
> 

Hmm, in fact, I now get some failures, which I don't get before:

Running /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/jit-reader.exp ...
FAIL: gdb.base/jit-reader.exp: with jit-reader: after mangling: current frame: info registers
FAIL: gdb.base/jit-reader.exp: with jit-reader: after mangling: caller frame: info registers
FAIL: gdb.base/jit-reader.exp: without jit-reader: info registers

The reason is that the regexp generated by multi_line mandates another line after the `gs` line.
It ends something like this:

    ...gs             $hex +$neg_decimal\r\n.*\r\n

If you don't have any line after the `gs` line, the regexp won't match.

multi_line just returns regexp as a string, so you can just append .* after it.  I would suggest
integrating the change below in your patch.


From 9a32960dfa05b322fd873aedc9768a8dd721acd6 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@polymtl.ca>
Date: Sat, 21 Mar 2020 22:06:36 -0400
Subject: [PATCH] fixup

---
 gdb/testsuite/gdb.base/jit-reader.exp | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.base/jit-reader.exp b/gdb/testsuite/gdb.base/jit-reader.exp
index 5140e3d9306b..8663f0021def 100644
--- a/gdb/testsuite/gdb.base/jit-reader.exp
+++ b/gdb/testsuite/gdb.base/jit-reader.exp
@@ -66,7 +66,8 @@ proc info_registers_current_frame {sp} {
     set any "\[^\r\n\]*"

     set neg_decimal "-?$decimal"
-    gdb_test "info registers" \
+
+    set expected \
 	[multi_line \
 	     "rax            $hex +$neg_decimal" \
 	     "rbx            $hex +$neg_decimal" \
@@ -92,8 +93,12 @@ proc info_registers_current_frame {sp} {
 	     "es             $hex +$neg_decimal" \
 	     "fs             $hex +$neg_decimal" \
 	     "gs             $hex +$neg_decimal" \
-	     ".*" \
 	    ]
+
+    # There may be more registers.
+    append expected ".*"
+
+    gdb_test "info registers" $expected
 }

 proc jit_reader_test {} {
@@ -171,7 +176,8 @@ proc jit_reader_test {} {

 		# Since the JIT unwinder only provides RIP/RSP/RBP,
 		# all other registers should show as "<not saved>".
-		gdb_test "info registers" \
+
+		set expected \
 		    [multi_line \
 			 "rax            <not saved>" \
 			 "rbx            <not saved>" \
@@ -197,9 +203,13 @@ proc jit_reader_test {} {
 			 "es             <not saved>" \
 			 "fs             <not saved>" \
 			 "gs             <not saved>" \
-			 ".*" \
 			]

+		# There may be more registers.
+		append expected ".*"
+
+		gdb_test "info registers" $expected
+
 		# Make sure that "info frame" doesn't crash.
 		gdb_test "info frame" "Stack level 1, .*in main.*"

-- 
2.25.2



  reply	other threads:[~2020-03-22  2:09 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 12:42 [PATCH 0/7] refactor and enhance jit testing Mihails Strasuns
2020-02-18 12:42 ` [PATCH 5/7] [gdb/testsuite] add lib/jit-elf-helpers.exp Mihails Strasuns
2020-03-23  0:52   ` Simon Marchi
2020-02-18 12:42 ` [PATCH 3/7] [gdb/testsuite] share jit-protocol.h by all jit tests Mihails Strasuns
2020-02-19 21:23   ` Tom Tromey
2020-03-22 16:00   ` Simon Marchi
2020-02-18 12:42 ` [PATCH 1/7] [gdb/testsuite] allow more registers in reader test Mihails Strasuns
2020-02-19 21:22   ` Tom Tromey
2020-03-21 16:03   ` Simon Marchi
2020-03-22  2:09     ` Simon Marchi [this message]
2020-02-18 12:42 ` [PATCH 4/7] [gdb/testsuite] use args as lib list for jit-elf tests Mihails Strasuns
2020-03-23  0:04   ` Simon Marchi
2020-03-23  0:35     ` Simon Marchi
2020-02-18 12:42 ` [PATCH 7/7] [gdb/testsuite] add jit-elf-util.h and run jit function Mihails Strasuns
2020-03-23  3:13   ` Simon Marchi
2020-03-23  9:23     ` Strasuns, Mihails
2020-03-23 11:14       ` Simon Marchi
2020-02-18 12:42 ` [PATCH 6/7] [gdb/testsuite] use -Ttext-segment for jit-elf tests Mihails Strasuns
2020-03-23  3:03   ` Simon Marchi
2020-02-18 12:42 ` [PATCH 2/7] [gdb/testsuite] structured rename of jit test files Mihails Strasuns
2020-02-19 21:23   ` Tom Tromey
2020-03-22  2:47     ` Simon Marchi
2020-02-26 13:56 ` [PATCH 0/7] refactor and enhance jit testing Strasuns, Mihails
2020-03-18 12:48   ` Simon Marchi

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=0b1b6dcc-5925-89d7-1729-7933f676d0b5@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=mihails.strasuns@intel.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