]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix maint-expand-symbols-header-file.exp for cc-with-gdb-index
authorTom de Vries <tdevries@suse.de>
Thu, 16 Apr 2020 06:40:19 +0000 (08:40 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 16 Apr 2020 06:40:19 +0000 (08:40 +0200)
With test-case gdb.base/maint-expand-symbols-header-file.exp and target board
cc-with-gdb-index, we have:
...
FAIL: gdb.base/maint-expand-symbols-header-file.exp: \
  verify no symtabs are expanded
...

By default, with partial symbols, we find the main function in the partial
symbols, and derive the initial language setting from that, without expanding
any psymtab.

But that doesn't work with the indices, because the indices don't store the
language with the symbols.  So instead, the main psymtab is expanded to get
the language of main, which causes the FAIL.

Fix this by manually setting the language.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

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

* gdb.base/maint-expand-symbols-header-file.exp: Set language before
loading exec.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/maint-expand-symbols-header-file.exp

index e021d3ea7a85182e64fa6c99b43fb969d739cfdd..f12a5d7830183518dc30c580c90ed9457469c437 100644 (file)
@@ -1,3 +1,8 @@
+2020-04-16  Tom de Vries  <tdevries@suse.de>
+
+       * gdb.base/maint-expand-symbols-header-file.exp: Set language before
+       loading exec.
+
 2020-04-15  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * gdb.base/many-completions.exp: New file.
index f73be404c993a83235833af35551541c41115dc1..05802b27190a4423b57a0ec681ddd68e99f07129 100644 (file)
 
 standard_testfile .c
 
-if {[prepare_for_testing "failed to prepare" $testfile \
+if {[build_executable "failed to prepare" $testfile \
         $srcfile {debug nowarnings}]} {
     return -1
 }
+clean_restart
+
+# Make sure that no symtabs are expanded, by setting language before
+# loading exec.
+gdb_test_no_output "set language c"
+gdb_load ${binfile}
 
 set test "verify no symtabs are expanded"
 if { [readnow] } {