]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/testsuite] Simplify gdb.cp/local-static.exp
authorTom de Vries <tdevries@suse.de>
Wed, 22 Oct 2025 15:32:57 +0000 (17:32 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 22 Oct 2025 15:32:57 +0000 (17:32 +0200)
commit46eeb5132aed207cd4c822df15106b72c740b94d
treeb701562adfed7bbfbc1970bd2f2b6fdac9de72a2
parent8eb1701823e46179e3adcb49abf57126b3c49f28
[gdb/testsuite] Simplify gdb.cp/local-static.exp

Simplify test-case gdb.cp/local-static.exp in the following way.

First rewrite this uplevel into a more usual form:
...
-set print_quoted_re [uplevel 1 "subst_vars \"$print_quoted_re\""]
+set print_quoted_re [uplevel 1 [list subst -nocommands $print_quoted_re]]
...

This requires us to use "subst -nocommands" instead of subst_vars, to allow
backslash substitution, which previously was happening implicitly because of
the way uplevel was used.

Then, declare globals hex and syntax_re, such that we no longer have to use
uplevel:
...
-set print_quoted_re [uplevel 1 [list subst -nocommands $print_quoted_re]]
+set print_quoted_re [subst -nocommands $print_quoted_re]
...

Finally, stop applying backslash substitution, simplifying cxx_scopes_list and
c_scopes_list:
...
-set print_quoted_re [subst -nocommands $print_quoted_re]
+set print_quoted_re [subst_vars $print_quoted_re]
...

While we're at it, simplify some regexps using string_to_regexp in a few places.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.cp/local-static.exp