Blame SOURCES/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch

e1d87d
Comments from Sergio Durigan Junior:
e1d87d
e1d87d
  The "proper" fix for this whole problem would be to backport the
e1d87d
  "ambiguous linespec" patch series.  However, it is really not
e1d87d
  recommended to do that for RHEL GDB, because the patch series is too
e1d87d
  big and could introduce unwanted regressions.  Instead, what we
e1d87d
  chose to do was to replace the gdb_assert call by a warning (which
e1d87d
  allows the user to continue the debugging session), and tell the
e1d87d
  user that, although more than one location was found for his/her
e1d87d
  breakpoint, only one will be used.
e1d87d
e1d87d
Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc	2016-10-20 21:06:31.849854180 +0200
e1d87d
@@ -0,0 +1,22 @@
e1d87d
+/* This testcase is part of GDB, the GNU debugger.
e1d87d
+
e1d87d
+   Copyright 2015 Free Software Foundation, Inc.
e1d87d
+
e1d87d
+   This program is free software; you can redistribute it and/or modify
e1d87d
+   it under the terms of the GNU General Public License as published by
e1d87d
+   the Free Software Foundation; either version 3 of the License, or
e1d87d
+   (at your option) any later version.
e1d87d
+
e1d87d
+   This program is distributed in the hope that it will be useful,
e1d87d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+   GNU General Public License for more details.
e1d87d
+
e1d87d
+   You should have received a copy of the GNU General Public License
e1d87d
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
e1d87d
+
e1d87d
+int
e1d87d
+main (int argc, char *argv[])
e1d87d
+{
e1d87d
+  return 0;
e1d87d
+}
e1d87d
Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc	2016-10-20 21:06:31.850854188 +0200
e1d87d
@@ -0,0 +1,26 @@
e1d87d
+/* This testcase is part of GDB, the GNU debugger.
e1d87d
+
e1d87d
+   Copyright 2015 Free Software Foundation, Inc.
e1d87d
+
e1d87d
+   This program is free software; you can redistribute it and/or modify
e1d87d
+   it under the terms of the GNU General Public License as published by
e1d87d
+   the Free Software Foundation; either version 3 of the License, or
e1d87d
+   (at your option) any later version.
e1d87d
+
e1d87d
+   This program is distributed in the hope that it will be useful,
e1d87d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+   GNU General Public License for more details.
e1d87d
+
e1d87d
+   You should have received a copy of the GNU General Public License
e1d87d
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
e1d87d
+
e1d87d
+class C
e1d87d
+  {
e1d87d
+    public:
e1d87d
+      C () {}
e1d87d
+      C (int x) {}
e1d87d
+  };
e1d87d
+
e1d87d
+C a;
e1d87d
+C b (1);
e1d87d
Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp	2016-10-20 21:09:33.408270526 +0200
e1d87d
@@ -0,0 +1,51 @@
e1d87d
+# Copyright 2015 Free Software Foundation, Inc.
e1d87d
+
e1d87d
+# This program is free software; you can redistribute it and/or modify
e1d87d
+# it under the terms of the GNU General Public License as published by
e1d87d
+# the Free Software Foundation; either version 3 of the License, or
e1d87d
+# (at your option) any later version.
e1d87d
+#
e1d87d
+# This program is distributed in the hope that it will be useful,
e1d87d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+# GNU General Public License for more details.
e1d87d
+#
e1d87d
+# You should have received a copy of the GNU General Public License
e1d87d
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
e1d87d
+
e1d87d
+if { [skip_cplus_tests] } { continue }
e1d87d
+if { [skip_shlib_tests] } { continue }
e1d87d
+if { [is_remote target] } { continue }
e1d87d
+if { [target_info exists use_gdb_stub] } { continue }
e1d87d
+
e1d87d
+set testfile gdb-rhbz1186476-internal-error-unqualified-name-re-set-main
e1d87d
+set srcfile $testfile.cc
e1d87d
+set executable $testfile
e1d87d
+set binfile [standard_output_file $executable]
e1d87d
+
e1d87d
+set libtestfile gdb-rhbz1186476-internal-error-unqualified-name-re-set
e1d87d
+set libsrcfile $libtestfile.cc
e1d87d
+set sofile [standard_output_file lib$libtestfile.so]
e1d87d
+
e1d87d
+# Create and source the file that provides information about the compiler
e1d87d
+# used to compile the test case.
e1d87d
+if [get_compiler_info "c++"] {
e1d87d
+    return -1
e1d87d
+}
e1d87d
+
e1d87d
+if { [gdb_compile_shlib $srcdir/$subdir/$libsrcfile $sofile {debug c++ "additional_flags=-fPIC"}] != ""
e1d87d
+     || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list additional_flags=-Wl,-rpath,[file dirname ${sofile}] "c++" shlib=${sofile} ]] != ""} {
e1d87d
+    untested $libtestfile.exp
e1d87d
+    return -1
e1d87d
+}
e1d87d
+
e1d87d
+clean_restart $executable
e1d87d
+
e1d87d
+gdb_test_no_output "set breakpoint pending on"
e1d87d
+# gdb_breakpoint would print a failure because of some warning messages
e1d87d
+gdb_test "break C::C" "Breakpoint $decimal \\(C::C\\) pending."
e1d87d
+
e1d87d
+#gdb_test "run" "warning: Found more than one location for breakpoint #$decimal; only the first location will be used.(\r\n)+Breakpoint $decimal, C::C.*"
e1d87d
+gdb_test "run"
e1d87d
+
e1d87d
+gdb_test "info break" " in C::C\\(\\) at .* in C::C\\(int\\) at .*"