aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-10-09 18:37:27 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-10-09 18:37:27 +0000
commit741f5e3c63f81da03e3c73b09c0205c3bcac0658 (patch)
tree3ad292810ad0114f7a9d4720cf2a40e21cafa0e6 /gdb/testsuite/gdb.cp
parenta73d2258a7f0bd52aa9a4df764109c9df7f02e26 (diff)
downloadgdb-741f5e3c63f81da03e3c73b09c0205c3bcac0658.zip
gdb-741f5e3c63f81da03e3c73b09c0205c3bcac0658.tar.gz
gdb-741f5e3c63f81da03e3c73b09c0205c3bcac0658.tar.bz2
gdb/
Fix initial language detection with -readnow. * dwarf2read.c (dw2_find_symbol_file): Handle OBJF_READNOW case. * symfile.h (struct quick_symbol_functions): State find_symbol_file searches only for global symbols. gdb/testsuite/ Fix initial language detection with -readnow. * gdb.cp/readnow-language.cc: New file. * gdb.cp/readnow-language.exp: New file.
Diffstat (limited to 'gdb/testsuite/gdb.cp')
-rw-r--r--gdb/testsuite/gdb.cp/readnow-language.cc21
-rw-r--r--gdb/testsuite/gdb.cp/readnow-language.exp28
2 files changed, 49 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/readnow-language.cc b/gdb/testsuite/gdb.cp/readnow-language.cc
new file mode 100644
index 0000000..32c4fbd
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/readnow-language.cc
@@ -0,0 +1,21 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2011 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
+main ()
+{
+}
diff --git a/gdb/testsuite/gdb.cp/readnow-language.exp b/gdb/testsuite/gdb.cp/readnow-language.exp
new file mode 100644
index 0000000..d6d3646
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/readnow-language.exp
@@ -0,0 +1,28 @@
+# Copyright 2011 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/>.
+
+set testfile readnow-language
+set srcfile ${testfile}.cc
+set executable ${testfile}
+if {[build_executable ${testfile}.exp $executable ${testfile}.cc {c++ debug}] == -1} {
+ return -1
+}
+
+set old_gdbflags $GDBFLAGS
+set GDBFLAGS "$GDBFLAGS -readnow"
+clean_restart $executable
+set GDBFLAGS $old_gdbflags
+
+gdb_test "show language" {The current source language is "auto; currently c\+\+"\.}