Blame SOURCES/gdb-test-expr-cumulative-archer.patch

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