From: Jan Kratochvil Date: Sat, 2 Jul 2011 19:51:28 +0000 (+0000) Subject: commit 3c8211c0eb27b1490ebef317c8bedd2eff783c7d X-Git-Tag: gdb_7_3-2011-07-26-release~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd290ca0bc1b9a3786fe6691828d1a7febe816c3;p=thirdparty%2Fbinutils-gdb.git commit 3c8211c0eb27b1490ebef317c8bedd2eff783c7d Author: Jan Kratochvil Date: Fri Jul 1 18:32:06 2011 +0000 gdb/testsuite/ Test GCC PR debug/49546. * gdb.cp/temargs.exp (set sixth breakpoint for temargs) (test type of F in k3_m, test value of F in k3_m): New. * gdb.cp/temargs.cc (struct S3, struct K3): New. (main): New variable k3. Call k3.k3_m. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index ad5617ec5d4..fcab0026651 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2011-07-02 Jan Kratochvil + + Test GCC PR debug/49546. + * gdb.cp/temargs.exp (set sixth breakpoint for temargs) + (test type of F in k3_m, test value of F in k3_m): New. + * gdb.cp/temargs.cc (struct S3, struct K3): New. + (main): New variable k3. Call k3.k3_m. + 2011-06-10 Jan Kratochvil * gdb.dwarf2/dw2-filename.exp (info sources): New testcase. diff --git a/gdb/testsuite/gdb.cp/temargs.cc b/gdb/testsuite/gdb.cp/temargs.cc index a97486f1619..9198a09f040 100644 --- a/gdb/testsuite/gdb.cp/temargs.cc +++ b/gdb/testsuite/gdb.cp/temargs.cc @@ -55,17 +55,35 @@ void func () // Breakpoint 3. } +// GCC PR debug/49546 +struct S3 +{ + static void m (int x) {} +}; +template +// or: template +struct K3 +{ + void k3_m () + { + F (0); // Breakpoint 6. + } +}; + int main () { Base base; // Note that instantiating with P==0 does not work with g++. // That would be worth testing, once g++ is fixed. Base::Inner inner; + K3<&S3::m> k3; +// or: K3 k3; base.base_m (); inner.inner_m (); func (); base.templ_m (); + k3.k3_m (); return 0; } diff --git a/gdb/testsuite/gdb.cp/temargs.exp b/gdb/testsuite/gdb.cp/temargs.exp index ed31deb8e39..6ef69c166b0 100644 --- a/gdb/testsuite/gdb.cp/temargs.exp +++ b/gdb/testsuite/gdb.cp/temargs.exp @@ -80,6 +80,10 @@ gdb_test "print P == &a_global" " = true" "test value of P in base_m" setup_kfail "gcc/41736" *-*-* gdb_test "print MP" "&S::f" "test value of MP in base_m" +set line [gdb_get_line_number "Breakpoint 6" $srcfile] +gdb_test "break $srcfile:$line" "Breakpoint 6.*" \ + "set sixth breakpoint for temargs" + # # Tests in Inner::inner_m. # @@ -139,3 +143,19 @@ gdb_test "print MP" "&S::f" "test value of MP in templ_m" if $have_older_template_gcc { setup_xfail "*-*-*" } gdb_test "whatis Q" "short" "test type of Q in templ_m" + +# +# Tests in K3::k3_m, GCC PR debug/49546. +# The problem reproduces with DW_AT_MIPS_linkage_name. It does not happen with +# GDB physname - GDB's own computation of the linkage name based on +# (incorrectly output by GCC) DW_AT_name. +# + +gdb_continue_to_breakpoint "continue to sixth breakpoint for temargs" + +if $have_older_template_gcc { setup_xfail "*-*-*" } +gdb_test "ptype F" {type = void \(\*\)\(int\)} "test type of F in k3_m" + +if $have_older_template_gcc { setup_xfail "*-*-*" } +gdb_test "print F" { = \(void \(\*\)\(int\)\) 0x[0-9a-f]+ } \ + "test value of F in k3_m"