]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.base/style.exp on freebsd
authorTom de Vries <tdevries@suse.de>
Mon, 4 Aug 2025 18:49:04 +0000 (20:49 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 4 Aug 2025 18:49:04 +0000 (20:49 +0200)
On x86_64-freebsd, with test-case gdb.base/style.exp I run into:
...
(gdb) print $_colorsupport
\e[36;49;22;27m$1\e[m = "monochrome"
(gdb) FAIL: $exp: colorsupport_8color: color support is 8 color
...

Fix this by applying the same fix as for tuiterm: use TERM=ansiw instead of
TERM=ansi for bsd, getting us instead:
...
(gdb) print $_colorsupport
\e[36;49;22;27m$1\e[m = "monochrome,ansi_8color"
(gdb) PASS: $exp: colorsupport_8color: color support is 8 color
...

Tested on x86_64-freebsd.

gdb/testsuite/lib/gdb.exp

index 8d94d6b81af3817a14b6d523cccc4e9eb3ba756c..0a582aac3548fc36e351c440e3dae600cde52512 100644 (file)
@@ -10430,7 +10430,11 @@ proc with_override { name override body } {
 proc with_ansi_styling_terminal { body } {
     save_vars { ::env(TERM) ::env(NO_COLOR) ::env(COLORTERM) } {
        # Set environment variables to allow styling.
-       setenv TERM ansi
+       if { [ishost *-*-*bsd*] } {
+           setenv TERM ansiw
+       } else {
+           setenv TERM ansi
+       }
        unset -nocomplain ::env(NO_COLOR)
        unset -nocomplain ::env(COLORTERM)