Jan Kratochvil 29d49d9
http://sourceware.org/ml/gdb-patches/2010-12/msg00263.html
Jan Kratochvil 29d49d9
Jan Kratochvil 29d49d9
Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-1.cc
Jan Kratochvil 29d49d9
===================================================================
Jan Kratochvil 29d49d9
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 29d49d9
+++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-1.cc	2011-02-03 22:28:01.000000000 +0100
Jan Kratochvil 29d49d9
@@ -0,0 +1,30 @@
Jan Kratochvil 29d49d9
+/* This testcase is part of GDB, the GNU debugger.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   Copyright 2010 Free Software Foundation, Inc.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   This program is free software; you can redistribute it and/or modify
Jan Kratochvil 29d49d9
+   it under the terms of the GNU General Public License as published by
Jan Kratochvil 29d49d9
+   the Free Software Foundation; either version 3 of the License, or
Jan Kratochvil 29d49d9
+   (at your option) any later version.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   This program is distributed in the hope that it will be useful,
Jan Kratochvil 29d49d9
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
Jan Kratochvil 29d49d9
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Jan Kratochvil 29d49d9
+   GNU General Public License for more details.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   You should have received a copy of the GNU General Public License
Jan Kratochvil 29d49d9
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   Please email any bugs, comments, and/or additions to this file to:
Jan Kratochvil 29d49d9
+   bug-gdb@gnu.org  */
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+#include "pr11734.h"
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+int
Jan Kratochvil 29d49d9
+main ()
Jan Kratochvil 29d49d9
+{
Jan Kratochvil 29d49d9
+  pr11734 *p = new pr11734;
Jan Kratochvil 29d49d9
+  p->foo ();
Jan Kratochvil 29d49d9
+  return 0;
Jan Kratochvil 29d49d9
+}
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-2.cc
Jan Kratochvil 29d49d9
===================================================================
Jan Kratochvil 29d49d9
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 29d49d9
+++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-2.cc	2011-02-03 22:28:01.000000000 +0100
Jan Kratochvil 29d49d9
@@ -0,0 +1,27 @@
Jan Kratochvil 29d49d9
+/* This testcase is part of GDB, the GNU debugger.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   Copyright 2010 Free Software Foundation, Inc.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   This program is free software; you can redistribute it and/or modify
Jan Kratochvil 29d49d9
+   it under the terms of the GNU General Public License as published by
Jan Kratochvil 29d49d9
+   the Free Software Foundation; either version 3 of the License, or
Jan Kratochvil 29d49d9
+   (at your option) any later version.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   This program is distributed in the hope that it will be useful,
Jan Kratochvil 29d49d9
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
Jan Kratochvil 29d49d9
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Jan Kratochvil 29d49d9
+   GNU General Public License for more details.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   You should have received a copy of the GNU General Public License
Jan Kratochvil 29d49d9
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   Please email any bugs, comments, and/or additions to this file to:
Jan Kratochvil 29d49d9
+   bug-gdb@gnu.org  */
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+#include "pr11734.h"
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+void
Jan Kratochvil 29d49d9
+pr11734::foo(void)
Jan Kratochvil 29d49d9
+{
Jan Kratochvil 29d49d9
+}
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-3.cc
Jan Kratochvil 29d49d9
===================================================================
Jan Kratochvil 29d49d9
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 29d49d9
+++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-3.cc	2011-02-03 22:28:01.000000000 +0100
Jan Kratochvil 29d49d9
@@ -0,0 +1,27 @@
Jan Kratochvil 29d49d9
+/* This testcase is part of GDB, the GNU debugger.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   Copyright 2010 Free Software Foundation, Inc.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   This program is free software; you can redistribute it and/or modify
Jan Kratochvil 29d49d9
+   it under the terms of the GNU General Public License as published by
Jan Kratochvil 29d49d9
+   the Free Software Foundation; either version 3 of the License, or
Jan Kratochvil 29d49d9
+   (at your option) any later version.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   This program is distributed in the hope that it will be useful,
Jan Kratochvil 29d49d9
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
Jan Kratochvil 29d49d9
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Jan Kratochvil 29d49d9
+   GNU General Public License for more details.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   You should have received a copy of the GNU General Public License
Jan Kratochvil 29d49d9
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   Please email any bugs, comments, and/or additions to this file to:
Jan Kratochvil 29d49d9
+   bug-gdb@gnu.org  */
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+#include "pr11734.h"
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+void
Jan Kratochvil 29d49d9
+pr11734::foo (int a)
Jan Kratochvil 29d49d9
+{
Jan Kratochvil 29d49d9
+}
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-4.cc
Jan Kratochvil 29d49d9
===================================================================
Jan Kratochvil 29d49d9
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 29d49d9
+++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-4.cc	2011-02-03 22:28:01.000000000 +0100
Jan Kratochvil 29d49d9
@@ -0,0 +1,27 @@
Jan Kratochvil 29d49d9
+/* This testcase is part of GDB, the GNU debugger.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   Copyright 2010 Free Software Foundation, Inc.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   This program is free software; you can redistribute it and/or modify
Jan Kratochvil 29d49d9
+   it under the terms of the GNU General Public License as published by
Jan Kratochvil 29d49d9
+   the Free Software Foundation; either version 3 of the License, or
Jan Kratochvil 29d49d9
+   (at your option) any later version.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   This program is distributed in the hope that it will be useful,
Jan Kratochvil 29d49d9
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
Jan Kratochvil 29d49d9
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Jan Kratochvil 29d49d9
+   GNU General Public License for more details.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   You should have received a copy of the GNU General Public License
Jan Kratochvil 29d49d9
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   Please email any bugs, comments, and/or additions to this file to:
Jan Kratochvil 29d49d9
+   bug-gdb@gnu.org  */
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+#include "pr11734.h"
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+void
Jan Kratochvil 29d49d9
+pr11734::foo (char *a)
Jan Kratochvil 29d49d9
+{
Jan Kratochvil 29d49d9
+}
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734.exp
Jan Kratochvil 29d49d9
===================================================================
Jan Kratochvil 29d49d9
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 29d49d9
+++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734.exp	2011-02-03 22:28:01.000000000 +0100
Jan Kratochvil 29d49d9
@@ -0,0 +1,55 @@
Jan Kratochvil 29d49d9
+# Copyright 2010 Free Software Foundation, Inc.
Jan Kratochvil 29d49d9
+#
Jan Kratochvil 29d49d9
+# Contributed by Red Hat, originally written by Keith Seitz.
Jan Kratochvil 29d49d9
+#
Jan Kratochvil 29d49d9
+# This program is free software; you can redistribute it and/or modify
Jan Kratochvil 29d49d9
+# it under the terms of the GNU General Public License as published by
Jan Kratochvil 29d49d9
+# the Free Software Foundation; either version 3 of the License, or
Jan Kratochvil 29d49d9
+# (at your option) any later version.
Jan Kratochvil 29d49d9
+#
Jan Kratochvil 29d49d9
+# This program is distributed in the hope that it will be useful,
Jan Kratochvil 29d49d9
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
Jan Kratochvil 29d49d9
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Jan Kratochvil 29d49d9
+# GNU General Public License for more details.
Jan Kratochvil 29d49d9
+#
Jan Kratochvil 29d49d9
+# You should have received a copy of the GNU General Public License
Jan Kratochvil 29d49d9
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+# This file is part of the gdb testsuite.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+if { [skip_cplus_tests] } { continue }
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+set testfile "pr11734"
Jan Kratochvil 29d49d9
+set class $testfile
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+set srcfiles {}
Jan Kratochvil 29d49d9
+for {set i 1} {$i < 5} {incr i} {
Jan Kratochvil 29d49d9
+    lappend srcfiles $testfile-$i.cc
Jan Kratochvil 29d49d9
+}
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+prepare_for_testing pr11734 $testfile $srcfiles {c++ debug}
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+if {![runto_main]} {
Jan Kratochvil 29d49d9
+    perror "couldn't run to breakpoint"
Jan Kratochvil 29d49d9
+    continue
Jan Kratochvil 29d49d9
+}
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+# An array holding the overload types for the method pr11734::foo.  The
Jan Kratochvil 29d49d9
+# first element is the overloaded method parameter.  The second element
Jan Kratochvil 29d49d9
+# is the expected source file number, e.g. "pr11734-?.cc".
Jan Kratochvil 29d49d9
+array set tests {
Jan Kratochvil 29d49d9
+    "char*"  4
Jan Kratochvil 29d49d9
+    "int"    3
Jan Kratochvil 29d49d9
+    ""       2
Jan Kratochvil 29d49d9
+}
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+# Test each overload instance twice: once quoted, once unquoted
Jan Kratochvil 29d49d9
+foreach ovld [array names tests] {
Jan Kratochvil 29d49d9
+    set method "${class}::foo\($ovld\)"
Jan Kratochvil 29d49d9
+    set result "Breakpoint (\[0-9\]).*file .*/$class-$tests($ovld).*"
Jan Kratochvil 29d49d9
+    gdb_test "break $method" $result
Jan Kratochvil 29d49d9
+    gdb_test "break '$method'" $result
Jan Kratochvil 29d49d9
+}
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+gdb_exit
Jan Kratochvil 29d49d9
+return 0
Jan Kratochvil 29d49d9
Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734.h
Jan Kratochvil 29d49d9
===================================================================
Jan Kratochvil 29d49d9
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 29d49d9
+++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734.h	2011-02-03 22:28:01.000000000 +0100
Jan Kratochvil 29d49d9
@@ -0,0 +1,28 @@
Jan Kratochvil 29d49d9
+/* This testcase is part of GDB, the GNU debugger.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   Copyright 2010 Free Software Foundation, Inc.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   This program is free software; you can redistribute it and/or modify
Jan Kratochvil 29d49d9
+   it under the terms of the GNU General Public License as published by
Jan Kratochvil 29d49d9
+   the Free Software Foundation; either version 3 of the License, or
Jan Kratochvil 29d49d9
+   (at your option) any later version.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   This program is distributed in the hope that it will be useful,
Jan Kratochvil 29d49d9
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
Jan Kratochvil 29d49d9
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Jan Kratochvil 29d49d9
+   GNU General Public License for more details.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   You should have received a copy of the GNU General Public License
Jan Kratochvil 29d49d9
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+   Please email any bugs, comments, and/or additions to this file to:
Jan Kratochvil 29d49d9
+   bug-gdb@gnu.org  */
Jan Kratochvil 29d49d9
+
Jan Kratochvil 29d49d9
+class pr11734
Jan Kratochvil 29d49d9
+{
Jan Kratochvil 29d49d9
+ public:
Jan Kratochvil 29d49d9
+  void foo ();
Jan Kratochvil 29d49d9
+  void foo (int);
Jan Kratochvil 29d49d9
+  void foo (char *);
Jan Kratochvil 29d49d9
+};
Jan Kratochvil 29d49d9
+