[gdb/testsuite] Add xfails for PR gcc/90232
authorTom de Vries <tdevries@suse.de>
Wed, 29 Apr 2020 11:22:21 +0000 (13:22 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 29 Apr 2020 11:22:21 +0000 (13:22 +0200)
With target board debug-types, we have these FAILs:
...
FAIL: gdb.guile/scm-symtab.exp: test simple_struct in static symbols
FAIL: gdb.python/py-symtab.exp: test simple_struct in static symbols
...
due to PR gcc/90232, as explained in commit 15cd93d05e8 "[gdb/symtab] Handle
struct decl with DW_AT_signature".

Marks these as XFAILs.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

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

* lib/gdb.exp (debug_types): New proc.
* gdb.guile/scm-symtab.exp: Add xfail for PR gcc/90232.
* gdb.python/py-symtab.exp: Same.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.guile/scm-symtab.exp
gdb/testsuite/gdb.python/py-symtab.exp
gdb/testsuite/lib/gdb.exp

index 86b71913b0111ae094b100c5f2d63864c3816e64..299bb790c52152626e55f8f302003140bd02fb40 100644 (file)
@@ -1,3 +1,9 @@
+2020-04-29  Tom de Vries  <tdevries@suse.de>
+
+       * lib/gdb.exp (debug_types): New proc.
+       * gdb.guile/scm-symtab.exp: Add xfail for PR gcc/90232.
+       * gdb.python/py-symtab.exp: Same.
+
 2020-04-29  Hannes Domani  <ssbssa@yahoo.de>
 
        PR gdb/17320
index 4b8c15566ed22efc89c09dd764faad2117bd1ef6..b6d5a719437672e3fc54da538869581ede2fa7ed 100644 (file)
@@ -32,6 +32,8 @@ if ![gdb_guile_runto_main] {
     return
 }
 
+set debug_types [debug_types]
+
 # Setup and get the symbol table.
 set line_no [gdb_get_line_number "Block break here."]
 gdb_breakpoint $line_no
@@ -101,8 +103,21 @@ gdb_test "guile (print (->bool (member \"int\" static-symbols)))" \
     "#t" "test int in static symbols"
 gdb_test "guile (print (->bool (member \"char\" static-symbols)))" \
     "#t" "test char in static symbols"
-gdb_test "guile (print (->bool (member \"simple_struct\" static-symbols)))" \
-    "#t" "test simple_struct in static symbols"
+gdb_test_multiple \
+    "guile (print (->bool (member \"simple_struct\" static-symbols)))" \
+    "test simple_struct in static symbols" {
+       -re -wrap "#t" {
+           pass $gdb_test_name
+       }
+       -re -wrap "#f" {
+           if { $debug_types } {
+               # Xfail for PR gcc/90232.
+               xfail $gdb_test_name
+           } else {
+               fail $gdb_test_name
+           }
+       }
+    }
 
 # Test is_valid when the objfile is unloaded.  This must be the last
 # test as it unloads the object file in GDB.
index 836cfd236753d4851b3c8d3872eff2ba001e3bd2..a0fe885bdfcf96a8cfcf831bd07c0d05e9c57ec3 100644 (file)
@@ -32,6 +32,8 @@ if ![runto_main] then {
     return 0
 }
 
+set debug_types [debug_types]
+
 global hex decimal
 
 # Setup and get the symbol table.
@@ -75,7 +77,20 @@ gdb_test "python print (\"func\" in global_symbols)" "True" "test func in global
 gdb_test "python print (\"main\" in global_symbols)" "True" "test main in global symbols"
 gdb_test "python print (\"int\" in static_symbols)" "True" "test int in static symbols"
 gdb_test "python print (\"char\" in static_symbols)" "True" "test char in static symbols"
-gdb_test "python print (\"simple_struct\" in static_symbols)" "True" "test simple_struct in static symbols"
+gdb_test_multiple "python print (\"simple_struct\" in static_symbols)" \
+    "test simple_struct in static symbols" {
+       -re -wrap "True" {
+           pass $gdb_test_name
+       }
+       -re -wrap "False" {
+           if { $debug_types } {
+               # Xfail for PR gcc/90232.
+               xfail $gdb_test_name
+           } else {
+               fail $gdb_test_name
+           }
+       }
+    }
 
 # Test is_valid when the objfile is unloaded.  This must be the last
 # test as it unloads the object file in GDB.
index 2208f3a1a9b30de8a8d8534d75a5c8af7368580c..b72ce0cda7fad9833af3dbe388eed86afdafdad0 100644 (file)
@@ -7106,5 +7106,23 @@ proc ensure_gdb_index { binfile } {
     return -1
 }
 
+# Return 1 if executable contains .debug_types section.  Otherwise, return 0.
+
+proc debug_types { } {
+    global hex
+
+    set cmd "maint info sections"
+    gdb_test_multiple $cmd "" {
+       -re -wrap "at $hex: .debug_types.*" {
+           return 1
+       }
+       -re -wrap "" {
+           return 0
+       }
+    }
+
+    return 0
+}
+
 # Always load compatibility stuff.
 load_lib future.exp
This page took 0.055691 seconds and 4 git commands to generate.