[v3,1/9,gdb/testsuite] allow more registers in reader test

Message ID 20200331171356.26126-1-mihails.strasuns@intel.com
State New
Headers show
Series
  • [v3,1/9,gdb/testsuite] allow more registers in reader test
Related show

Commit Message

Shahab Vahedi via Gdb-patches March 31, 2020, 5:13 p.m.
Fixes jit-reader test failures on systems that have more registers than
expected by the current condition.

On Intel i9-7920X the following extra registers are printed:

k0             0x0                 0
k1             0x0                 0
k2             0x0                 0
k3             0x0                 0
k4             0x0                 0
k5             0x0                 0
k6             0x0                 0
k7             0x0                 0

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
---
 gdb/testsuite/gdb.base/jit-reader.exp | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

-- 
2.25.2

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

Comments

Shahab Vahedi via Gdb-patches April 14, 2020, 10:08 a.m. | #1
Ping for the series 😉

> -----Original Message-----

> From: Mihails Strasuns <mihails.strasuns@intel.com>

> Sent: Tuesday, March 31, 2020 7:14 PM

> To: gdb-patches@sourceware.org

> Cc: Strasuns, Mihails <mihails.strasuns@intel.com>

> Subject: [PATCH v3 1/9] [gdb/testsuite] allow more registers in reader test

> 

> Fixes jit-reader test failures on systems that have more registers than

> expected by the current condition.

> 

> On Intel i9-7920X the following extra registers are printed:

> 

> k0             0x0                 0

> k1             0x0                 0

> k2             0x0                 0

> k3             0x0                 0

> k4             0x0                 0

> k5             0x0                 0

> k6             0x0                 0

> k7             0x0                 0

> 

> 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

> ---

>  gdb/testsuite/gdb.base/jit-reader.exp | 16 ++++++++++++++--

>  1 file changed, 14 insertions(+), 2 deletions(-)

> 

> diff --git a/gdb/testsuite/gdb.base/jit-reader.exp

> b/gdb/testsuite/gdb.base/jit-reader.exp

> index 7852a5b550..8663f0021d 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" \

> @@ -93,6 +94,11 @@ proc info_registers_current_frame {sp} {

>  	     "fs             $hex +$neg_decimal" \

>  	     "gs             $hex +$neg_decimal" \

>  	    ]

> +

> +    # There may be more registers.

> +    append expected ".*"

> +

> +    gdb_test "info registers" $expected

>  }

> 

>  proc jit_reader_test {} {

> @@ -170,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>" \

> @@ -198,6 +205,11 @@ proc jit_reader_test {} {

>  			 "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


Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
Simon Marchi April 18, 2020, 2:30 a.m. | #2
On 2020-03-31 1:13 p.m., Mihails Strasuns via Gdb-patches wrote:
> Fixes jit-reader test failures on systems that have more registers than

> expected by the current condition.

> 

> On Intel i9-7920X the following extra registers are printed:

> 

> k0             0x0                 0

> k1             0x0                 0

> k2             0x0                 0

> k3             0x0                 0

> k4             0x0                 0

> k5             0x0                 0

> k6             0x0                 0

> k7             0x0                 0

> 

> gdb/testsuite/ChangeLog:

> 

> 2020-02-18  Mihails Strasuns  <mihails.strasuns@intel.com>

> 

> 	* gdb.base/jit-reader.exp: relax register output check


Please start with capital letter and end with a period.

> Signed-off-by: Mihails Strasuns <mihails.strasuns@intel.com>

> Change-Id: I227ab8691b2363d626f7100216477ab637f619fa


Update the commit title to mention jit, just saying "reader test" is vague.  Might as well
mention the test filename:

  allow more registers in gdb.bas/jit-reader.exp

This patch is ok to push by itself with those fixed.  Please remind me, do you have push
access, or do you need/want it?  If not I don't mind pushing for you.

Simon

Patch

diff --git a/gdb/testsuite/gdb.base/jit-reader.exp b/gdb/testsuite/gdb.base/jit-reader.exp
index 7852a5b550..8663f0021d 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" \
@@ -93,6 +94,11 @@  proc info_registers_current_frame {sp} {
 	     "fs             $hex +$neg_decimal" \
 	     "gs             $hex +$neg_decimal" \
 	    ]
+
+    # There may be more registers.
+    append expected ".*"
+
+    gdb_test "info registers" $expected
 }
 
 proc jit_reader_test {} {
@@ -170,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>" \
@@ -198,6 +205,11 @@  proc jit_reader_test {} {
 			 "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.*"