|
|
26bbde |
archer archer-keiths-expr-cumulative
|
|
|
26bbde |
b5a7497340b24199f0c7ba7fdf0d54d4df44d6bc
|
|
|
26bbde |
|
|
|
be09dc |
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.cc
|
|
|
be09dc |
===================================================================
|
|
|
be09dc |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
|
|
be09dc |
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.cc 2016-02-15 23:34:32.196402773 +0100
|
|
|
26bbde |
@@ -0,0 +1,36 @@
|
|
|
26bbde |
+namespace A
|
|
|
26bbde |
+{
|
|
|
26bbde |
+ namespace B
|
|
|
26bbde |
+ {
|
|
|
26bbde |
+ int ab = 11;
|
|
|
26bbde |
+ }
|
|
|
26bbde |
+}
|
|
|
26bbde |
+
|
|
|
26bbde |
+namespace C
|
|
|
26bbde |
+{
|
|
|
26bbde |
+ namespace D
|
|
|
26bbde |
+ {
|
|
|
26bbde |
+ using namespace A::B;
|
|
|
26bbde |
+
|
|
|
26bbde |
+ int
|
|
|
26bbde |
+ second()
|
|
|
26bbde |
+ {
|
|
|
26bbde |
+ ab;
|
|
|
26bbde |
+ return 0;
|
|
|
26bbde |
+ }
|
|
|
26bbde |
+ }
|
|
|
26bbde |
+
|
|
|
26bbde |
+ int
|
|
|
26bbde |
+ first()
|
|
|
26bbde |
+ {
|
|
|
26bbde |
+ //ab;
|
|
|
26bbde |
+ return D::second();
|
|
|
26bbde |
+ }
|
|
|
26bbde |
+}
|
|
|
26bbde |
+
|
|
|
26bbde |
+int
|
|
|
26bbde |
+main()
|
|
|
26bbde |
+{
|
|
|
26bbde |
+ //ab;
|
|
|
26bbde |
+ return C::first();
|
|
|
26bbde |
+}
|
|
|
be09dc |
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.exp
|
|
|
be09dc |
===================================================================
|
|
|
be09dc |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
|
|
be09dc |
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-nested-imports.exp 2016-02-15 23:34:51.926542859 +0100
|
|
|
26bbde |
@@ -0,0 +1,50 @@
|
|
|
26bbde |
+# Copyright 2008 Free Software Foundation, Inc.
|
|
|
26bbde |
+
|
|
|
26bbde |
+# This program is free software; you can redistribute it and/or modify
|
|
|
26bbde |
+# it under the terms of the GNU General Public License as published by
|
|
|
26bbde |
+# the Free Software Foundation; either version 3 of the License, or
|
|
|
26bbde |
+# (at your option) any later version.
|
|
|
26bbde |
+#
|
|
|
26bbde |
+# This program is distributed in the hope that it will be useful,
|
|
|
26bbde |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
26bbde |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
26bbde |
+# GNU General Public License for more details.
|
|
|
26bbde |
+#
|
|
|
26bbde |
+# You should have received a copy of the GNU General Public License
|
|
|
26bbde |
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
26bbde |
+
|
|
|
26bbde |
+set testfile namespace-nested-imports
|
|
|
26bbde |
+set srcfile ${testfile}.cc
|
|
|
be09dc |
+set binfile [standard_output_file ${testfile}]
|
|
|
26bbde |
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
|
|
|
26bbde |
+ untested "Couldn't compile test program"
|
|
|
26bbde |
+ return -1
|
|
|
26bbde |
+}
|
|
|
26bbde |
+
|
|
|
26bbde |
+# Get things started.
|
|
|
26bbde |
+
|
|
|
26bbde |
+gdb_exit
|
|
|
26bbde |
+gdb_start
|
|
|
26bbde |
+gdb_reinitialize_dir $srcdir/$subdir
|
|
|
26bbde |
+gdb_load ${binfile}
|
|
|
26bbde |
+
|
|
|
26bbde |
+############################################
|
|
|
26bbde |
+if ![runto_main] then {
|
|
|
26bbde |
+ perror "couldn't run to breakpoint main"
|
|
|
26bbde |
+ continue
|
|
|
26bbde |
+}
|
|
|
26bbde |
+
|
|
|
26bbde |
+gdb_test "print ab" "No symbol .* in current context."
|
|
|
26bbde |
+
|
|
|
26bbde |
+############################################
|
|
|
26bbde |
+gdb_breakpoint C::first
|
|
|
26bbde |
+gdb_continue_to_breakpoint "C::first"
|
|
|
26bbde |
+
|
|
|
26bbde |
+gdb_test "print ab" "No symbol .* in current context."
|
|
|
26bbde |
+gdb_test "print C::D::ab" "= 11"
|
|
|
26bbde |
+
|
|
|
26bbde |
+############################################
|
|
|
26bbde |
+gdb_breakpoint C::D::second
|
|
|
26bbde |
+gdb_continue_to_breakpoint "C::D::second"
|
|
|
26bbde |
+
|
|
|
26bbde |
+gdb_test "print ab" "= 11"
|
|
|
be09dc |
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.cc
|
|
|
be09dc |
===================================================================
|
|
|
be09dc |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
|
|
be09dc |
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.cc 2016-02-15 23:34:32.196402773 +0100
|
|
|
26bbde |
@@ -0,0 +1,37 @@
|
|
|
26bbde |
+
|
|
|
26bbde |
+namespace A
|
|
|
26bbde |
+{
|
|
|
26bbde |
+ int _a = 11;
|
|
|
26bbde |
+
|
|
|
26bbde |
+ namespace B{
|
|
|
26bbde |
+
|
|
|
26bbde |
+ int ab = 22;
|
|
|
26bbde |
+
|
|
|
26bbde |
+ namespace C{
|
|
|
26bbde |
+
|
|
|
26bbde |
+ int abc = 33;
|
|
|
26bbde |
+
|
|
|
26bbde |
+ int second(){
|
|
|
26bbde |
+ return 0;
|
|
|
26bbde |
+ }
|
|
|
26bbde |
+
|
|
|
26bbde |
+ }
|
|
|
26bbde |
+
|
|
|
26bbde |
+ int first(){
|
|
|
26bbde |
+ _a;
|
|
|
26bbde |
+ ab;
|
|
|
26bbde |
+ C::abc;
|
|
|
26bbde |
+ return C::second();
|
|
|
26bbde |
+ }
|
|
|
26bbde |
+ }
|
|
|
26bbde |
+}
|
|
|
26bbde |
+
|
|
|
26bbde |
+
|
|
|
26bbde |
+int
|
|
|
26bbde |
+main()
|
|
|
26bbde |
+{
|
|
|
26bbde |
+ A::_a;
|
|
|
26bbde |
+ A::B::ab;
|
|
|
26bbde |
+ A::B::C::abc;
|
|
|
26bbde |
+ return A::B::first();
|
|
|
26bbde |
+}
|
|
|
be09dc |
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.exp
|
|
|
be09dc |
===================================================================
|
|
|
be09dc |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
|
|
be09dc |
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.cp/namespace-no-imports.exp 2016-02-15 23:34:51.926542859 +0100
|
|
|
26bbde |
@@ -0,0 +1,69 @@
|
|
|
26bbde |
+# Copyright 2008 Free Software Foundation, Inc.
|
|
|
26bbde |
+
|
|
|
26bbde |
+# This program is free software; you can redistribute it and/or modify
|
|
|
26bbde |
+# it under the terms of the GNU General Public License as published by
|
|
|
26bbde |
+# the Free Software Foundation; either version 3 of the License, or
|
|
|
26bbde |
+# (at your option) any later version.
|
|
|
26bbde |
+#
|
|
|
26bbde |
+# This program is distributed in the hope that it will be useful,
|
|
|
26bbde |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
26bbde |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
26bbde |
+# GNU General Public License for more details.
|
|
|
26bbde |
+#
|
|
|
26bbde |
+# You should have received a copy of the GNU General Public License
|
|
|
26bbde |
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
26bbde |
+
|
|
|
26bbde |
+set testfile namespace-no-imports
|
|
|
26bbde |
+set srcfile ${testfile}.cc
|
|
|
be09dc |
+set binfile [standard_output_file ${testfile}]
|
|
|
26bbde |
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
|
|
|
26bbde |
+ untested "Couldn't compile test program"
|
|
|
26bbde |
+ return -1
|
|
|
26bbde |
+}
|
|
|
26bbde |
+
|
|
|
26bbde |
+# Get things started.
|
|
|
26bbde |
+
|
|
|
26bbde |
+gdb_exit
|
|
|
26bbde |
+gdb_start
|
|
|
26bbde |
+gdb_reinitialize_dir $srcdir/$subdir
|
|
|
26bbde |
+gdb_load ${binfile}
|
|
|
26bbde |
+
|
|
|
26bbde |
+############################################
|
|
|
26bbde |
+if ![runto_main] then {
|
|
|
26bbde |
+ perror "couldn't run to breakpoint main"
|
|
|
26bbde |
+ continue
|
|
|
26bbde |
+}
|
|
|
26bbde |
+
|
|
|
26bbde |
+gdb_test "print A::_a" "= 11"
|
|
|
26bbde |
+gdb_test "print A::B::ab" "= 22"
|
|
|
26bbde |
+gdb_test "print A::B::C::abc" "= 33"
|
|
|
26bbde |
+
|
|
|
26bbde |
+gdb_test "print _a" "No symbol .* in current context."
|
|
|
26bbde |
+gdb_test "print ab" "No symbol .* in current context."
|
|
|
26bbde |
+gdb_test "print abc" "No symbol .* in current context."
|
|
|
26bbde |
+
|
|
|
26bbde |
+############################################
|
|
|
26bbde |
+gdb_breakpoint A::B::first
|
|
|
26bbde |
+gdb_continue_to_breakpoint "A::B::first"
|
|
|
26bbde |
+
|
|
|
26bbde |
+gdb_test "print A::_a" "= 11"
|
|
|
26bbde |
+gdb_test "print A::B::ab" "= 22"
|
|
|
26bbde |
+gdb_test "print A::B::C::abc" "= 33"
|
|
|
26bbde |
+
|
|
|
26bbde |
+gdb_test "print _a" "= 11"
|
|
|
26bbde |
+gdb_test "print ab" "= 22"
|
|
|
26bbde |
+gdb_test "print C::abc" "= 33"
|
|
|
26bbde |
+
|
|
|
26bbde |
+gdb_test "print abc" "No symbol .* in current context."
|
|
|
26bbde |
+
|
|
|
26bbde |
+############################################
|
|
|
26bbde |
+gdb_breakpoint A::B::C::second
|
|
|
26bbde |
+gdb_continue_to_breakpoint "A::B::C::second"
|
|
|
26bbde |
+
|
|
|
26bbde |
+gdb_test "print A::_a" "= 11"
|
|
|
26bbde |
+gdb_test "print A::B::ab" "= 22"
|
|
|
26bbde |
+gdb_test "print A::B::C::abc" "= 33"
|
|
|
26bbde |
+
|
|
|
26bbde |
+gdb_test "print _a" "= 11"
|
|
|
26bbde |
+gdb_test "print ab" "= 22"
|
|
|
26bbde |
+gdb_test "print abc" "= 33"
|