Fix racy output matching in gdb.base/memattr.exp
authorPedro Alves <palves@redhat.com>
Thu, 9 Nov 2017 22:44:08 +0000 (22:44 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 9 Nov 2017 22:45:39 +0000 (22:45 +0000)
commit2c88253fc469fbf40be7f0d1f7060b81055f2eb1
tree373e83d87a9b7be4361583b0aa9fc667c7ba6cd6
parentc7a3851716f98540396b9e02be7d2fcd3bff2d29
Fix racy output matching in gdb.base/memattr.exp

Testing with:
 $ make check-read1 TESTS="gdb.base/memattr.exp"

Exposes a testcase bug that can result in racy fails:

  info mem
  Using user-defined memory regions.
  Num Enb Low Addr           High Addr          Attrs
  1   y   0x0000000000601060 0x0000000000601160 wo nocache
  2   y   0x0000000000601180 0x0000000000601280 ro nocache
  4   y   0x0000000000601280 0x0000000000601380 rw nocache
  3   y   0x0000000000601380 0x0000000000601480 rw nocache
  5   y   0x0000000000601480 0x0000000000601580 rw nocache
  (gdb) FAIL: gdb.base/memattr.exp: info mem (1)

The problem is that:

  "Attrs\[^\n\r]*.."

matches:

  "Attrs \r"

when the output buffer is filled with partial output like this:

  "info mem\r\nUsing user-defined memory regions.\r\nNum Enb Low Addr           High Addr          Attrs \r"

gdb/testsuite/ChangeLog:
2017-11-09  Pedro Alves  <palves@redhat.com>

* gdb.base/memattr.exp: Tighten regexes to match the end line.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/memattr.exp
This page took 0.024498 seconds and 4 git commands to generate.