[gdb/testsuite] Fix unrecognized debug output level 'statement-frontiers' message
authorTom de Vries <tdevries@suse.de>
Sat, 14 Mar 2020 09:41:46 +0000 (10:41 +0100)
committerTom de Vries <tdevries@suse.de>
Sat, 14 Mar 2020 09:41:46 +0000 (10:41 +0100)
When running testcase gdb.cp/step-and-next-inline.exp, I get:
...
 Running src/gdb/testsuite/gdb.cp/step-and-next-inline.exp ...
 gdb compile failed, g++: error: unrecognized debug output level \
   'statement-frontiers'
 gdb compile failed, g++: error: unrecognized debug output level \
   'statement-frontiers'

                 === gdb Summary ===

 # of untested testcases         2
...

Fix this by using a new gdb_caching_proc supports_statement_frontiers.

Tested on x86_64-linux, with gcc 7.5.0 (which does not support
-gstatement-frontiers) and with gcc 8.4.0 (which does support
-gstatement-frontiers).

gdb/testsuite/ChangeLog:

2020-03-14  Tom de Vries  <tdevries@suse.de>

* lib/gdb.exp (supports_statement_frontiers): New proc.
* gdb.cp/step-and-next-inline.exp: Use supports_statement_frontiers.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/step-and-next-inline.exp
gdb/testsuite/lib/gdb.exp

index 9f65a4eaa82786cb7fd1bdfc6742a9db9995dcc1..a9c2852251153fc11c4585ac9074d3616108c59a 100644 (file)
@@ -1,3 +1,8 @@
+2020-03-14  Tom de Vries  <tdevries@suse.de>
+
+       * lib/gdb.exp (supports_statement_frontiers): New proc.
+       * gdb.cp/step-and-next-inline.exp: Use supports_statement_frontiers.
+
 2020-03-14  Tom de Vries  <tdevries@suse.de>
 
        * gdb.base/printcmds.exp: Add missing quoting for "print
index acec48ba81d5e381f09a1e001a787fdf2aa6c4cb..3733fa755709c1e7b07f76456d426ee84532c4a2 100644 (file)
 
 standard_testfile .cc
 
+if { ![supports_statement_frontiers] } {
+    return -1
+}
+
 # Compile the test source with USE_NEXT_INLINE_H defined (when
 # use_header is true), or not defined.
 proc do_test { use_header } {
index ae2d810a1eb82aebde5cf5b5581d5b7a33f4094b..b14b3a968e19a3f3c234a2197af330eae3075e05 100644 (file)
@@ -6947,5 +6947,16 @@ gdb_caching_proc skip_ctf_tests {
     } executable "additional_flags=-gt"]
 }
 
+# Return 1 if compiler supports -gstatement-frontiers.  Otherwise,
+# return 0.
+
+gdb_caching_proc supports_statement_frontiers {
+    return [gdb_can_simple_compile supports_statement_frontiers {
+       int main () {
+           return 0;
+       }
+    } executable "additional_flags=-gstatement-frontiers"]
+}
+
 # Always load compatibility stuff.
 load_lib future.exp