[gdb/testsuite] Make skip_libstdcxx_probe_tests return 1 if true
[deliverable/binutils-gdb.git] / gdb / testsuite / lib / gdb-utils.exp
index 37abb14cfea0cf2c886f2137921f4aa38b581141..89767dc51c4ed350c6cce947b075db5c56aa3d16 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2014-2017 Free Software Foundation, Inc.
+# Copyright 2014-2019 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -37,3 +37,23 @@ proc string_to_regexp {str} {
     regsub -all {[]*+.|(){}^$\[\\]} $str {\\&} result
     return $result
 }
+
+# Wrap STR in an ANSI terminal escape sequences -- one to set the
+# style to STYLE, and one to reset the style to the default.  The
+# return value is suitable for use as a regular expression.
+
+# STYLE can either be the payload part of an ANSI terminal sequence,
+# or a shorthand for one of the gdb standard styles: "file",
+# "function", "variable", or "address".
+
+proc style {str style} {
+    switch -exact -- $style {
+       title { set style 1 }
+       file { set style 32 }
+       function { set style 33 }
+       highlight { set style 31 }
+       variable { set style 36 }
+       address { set style 34 }
+    }
+    return "\033\\\[${style}m${str}\033\\\[m"
+}
This page took 0.031797 seconds and 4 git commands to generate.