[gdb/testsuite] allow more registers in gdb.base/jit-reader.exp
authorMihails Strasuns <mihails.strasuns@intel.com>
Tue, 11 Feb 2020 12:46:27 +0000 (13:46 +0100)
committerMihails Strasuns <mihails.strasuns@intel.com>
Tue, 21 Apr 2020 13:22:30 +0000 (15:22 +0200)
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.

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

index 7852a5b5507a952f6ac8858e4da0f99e65d440d5..8663f0021deff90107766c14a0e1f398aa040238 100644 (file)
@@ -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.*"