+2020-04-22 Tom de Vries <tdevries@suse.de>
+
+ PR symtab/25764
+ * dwarf2/read.c (scan_partial_symbols): Allow external variable decls
+ in psymtabs.
+
2020-04-22 Tom de Vries <tdevries@suse.de>
PR symtab/25801
case DW_TAG_variable:
case DW_TAG_typedef:
case DW_TAG_union_type:
- if (!pdi->is_declaration)
+ if (!pdi->is_declaration
+ || (pdi->tag == DW_TAG_variable && pdi->is_external))
{
add_partial_symbol (pdi, cu);
}
+2020-04-22 Tom de Vries <tdevries@suse.de>
+
+ PR symtab/25764
+ * gdb.base/psym-external-decl-2.c: New test.
+ * gdb.base/psym-external-decl.c: New test.
+ * gdb.base/psym-external-decl.exp: New file.
+ * gdb.threads/tls.exp: Add PR25807 kfail.
+
2020-04-22 Tom de Vries <tdevries@suse.de>
PR symtab/25801
--- /dev/null
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2020 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
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int aaa = 33;
--- /dev/null
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2020 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
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+extern int aaa;
+
+int
+main (void)
+{
+ return 0;
+}
+
--- /dev/null
+# Copyright 2020 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
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+standard_testfile .c psym-external-decl-2.c
+
+set srcfiles [list $srcfile $srcfile2]
+
+if { [build_executable_from_specs \
+ "failed to prepare" \
+ $testfile [list] \
+ $srcfile [list debug] \
+ $srcfile2 [list]] == -1 } {
+ return -1
+}
+
+clean_restart $testfile
+
+gdb_test "print aaa" " = 33"
clean_restart ${binfile}
-gdb_test "print a_thread_local" \
- "Cannot read .a_thread_local. without registers"
+gdb_test_multiple "print a_thread_local" "" {
+ -re -wrap "Cannot find thread-local variables on this target" {
+ kfail "gdb/25807" $gdb_test_name
+ }
+ -re -wrap "Cannot read .a_thread_local. without registers" {
+ pass $gdb_test_name
+ }
+}
if ![runto_main] then {
fail "can't run to main"