[gdb/testsuite] Use non-capturing parentheses for inferior_exited_re
authorTom de Vries <tdevries@suse.de>
Tue, 4 Feb 2020 08:53:50 +0000 (09:53 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 4 Feb 2020 08:53:50 +0000 (09:53 +0100)
commit780636aec079208cd8ee1079f27d0d5ac5dae48a
treea431e0ba5708c12196eb031e65849f028e70821c
parent719546c44f5777a3902a2f913c70fd15b942461d
[gdb/testsuite] Use non-capturing parentheses for inferior_exited_re

The inferior_exited_re regexp uses capturing parentheses by default:
...
set inferior_exited_re "(\\\[Inferior \[0-9\]+ \\(.*\\) exited)"
...

The parentheses are there to be able to use the expression as an atom, f.i.,
to have '+' apply to the whole regexp in "${inferior_exited_re}+".

But the capturing is not necessary, and it can be confusing because it's not
obvious in a regexp using "$inferior_exited_re (bla|bli)" that the first
captured expression is in $inferior_exited_re.

Replace by non-capturing parentheses.  If we still want to capture the
expression, we can simply (and more clearly) use "($inferior_exited_re)".

Build and reg-tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-02-04  Tom de Vries  <tdevries@suse.de>

* lib/gdb.exp (inferior_exited_re): Use non-capturing parentheses.

Change-Id: I7640c6129b1ada617424d6a63730d4b119c58ef3
gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp
This page took 0.026846 seconds and 4 git commands to generate.