Skip to content

Commit 195de55

Browse files
ivanivanov884jeffmahoney
authored andcommitted
gdb-physname-pr11734-test.patch
;; Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). ;;=fedoratest http://sourceware.org/ml/gdb-patches/2010-12/msg00263.html
1 parent 4256651 commit 195de55

File tree

6 files changed

+194
-0
lines changed

6 files changed

+194
-0
lines changed

gdb/testsuite/gdb.cp/pr11734-1.cc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* This testcase is part of GDB, the GNU debugger.
2+
3+
Copyright 2010 Free Software Foundation, Inc.
4+
5+
This program is free software; you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation; either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
Please email any bugs, comments, and/or additions to this file to:
19+
bug-gdb@gnu.org */
20+
21+
#include "pr11734.h"
22+
23+
int
24+
main ()
25+
{
26+
pr11734 *p = new pr11734;
27+
p->foo ();
28+
return 0;
29+
}
30+

gdb/testsuite/gdb.cp/pr11734-2.cc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* This testcase is part of GDB, the GNU debugger.
2+
3+
Copyright 2010 Free Software Foundation, Inc.
4+
5+
This program is free software; you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation; either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
Please email any bugs, comments, and/or additions to this file to:
19+
bug-gdb@gnu.org */
20+
21+
#include "pr11734.h"
22+
23+
void
24+
pr11734::foo(void)
25+
{
26+
}
27+

gdb/testsuite/gdb.cp/pr11734-3.cc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* This testcase is part of GDB, the GNU debugger.
2+
3+
Copyright 2010 Free Software Foundation, Inc.
4+
5+
This program is free software; you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation; either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
Please email any bugs, comments, and/or additions to this file to:
19+
bug-gdb@gnu.org */
20+
21+
#include "pr11734.h"
22+
23+
void
24+
pr11734::foo (int a)
25+
{
26+
}
27+

gdb/testsuite/gdb.cp/pr11734-4.cc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* This testcase is part of GDB, the GNU debugger.
2+
3+
Copyright 2010 Free Software Foundation, Inc.
4+
5+
This program is free software; you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation; either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
Please email any bugs, comments, and/or additions to this file to:
19+
bug-gdb@gnu.org */
20+
21+
#include "pr11734.h"
22+
23+
void
24+
pr11734::foo (char *a)
25+
{
26+
}
27+

gdb/testsuite/gdb.cp/pr11734.exp

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright 2010 Free Software Foundation, Inc.
2+
#
3+
# Contributed by Red Hat, originally written by Keith Seitz.
4+
#
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
# This file is part of the gdb testsuite.
19+
20+
if { [skip_cplus_tests] } { continue }
21+
22+
set testfile "pr11734"
23+
set class $testfile
24+
25+
set srcfiles {}
26+
for {set i 1} {$i < 5} {incr i} {
27+
lappend srcfiles $testfile-$i.cc
28+
}
29+
30+
prepare_for_testing pr11734 $testfile $srcfiles {c++ debug}
31+
32+
if {![runto_main]} {
33+
perror "couldn't run to breakpoint"
34+
continue
35+
}
36+
37+
# An array holding the overload types for the method pr11734::foo. The
38+
# first element is the overloaded method parameter. The second element
39+
# is the expected source file number, e.g. "pr11734-?.cc".
40+
array set tests {
41+
"char*" 4
42+
"int" 3
43+
"" 2
44+
}
45+
46+
# Test each overload instance twice: once quoted, once unquoted
47+
foreach ovld [array names tests] {
48+
set method "${class}::foo\($ovld\)"
49+
set result "Breakpoint (\[0-9\]).*file .*/$class-$tests($ovld).*"
50+
gdb_test "break $method" $result
51+
gdb_test "break '$method'" $result
52+
}
53+
54+
gdb_exit
55+
return 0

gdb/testsuite/gdb.cp/pr11734.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* This testcase is part of GDB, the GNU debugger.
2+
3+
Copyright 2010 Free Software Foundation, Inc.
4+
5+
This program is free software; you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation; either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
Please email any bugs, comments, and/or additions to this file to:
19+
bug-gdb@gnu.org */
20+
21+
class pr11734
22+
{
23+
public:
24+
void foo ();
25+
void foo (int);
26+
void foo (char *);
27+
};
28+

0 commit comments

Comments
 (0)