On Mon, Mar 14, 2011 at 5:41 PM, Jan Kratochvil wrote: > On Mon, 14 Mar 2011 22:01:44 +0100, Paul Pluzhnikov wrote: >> --- /dev/null 1 Jan 1970 00:00:00 -0000 >> +++ testsuite/gdb.cp/pr12528.exp      14 Mar 2011 20:52:11 -0000 > > I would prefer any non-numeric name of the testfile. How does "break-on-linker-gcd-function.exp" sound? >> +set additional_flags {-ffunction-sections -Wl,--gc-sections} >> +if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ >> +        [list debug c++ additional_flags=$additional_flags]] != "" } { >> +    untested $srcfile >> +    return -1 >> +} > > This testfile correctly breaks without the fix applied with: >        g++ (GCC) 4.4.6 20110314 (prerelease) > > but it gives false PASS even without the fix applied with: >        g++ (GCC) 4.5.3 20110314 (prerelease) >        g++ (GCC) 4.6.0 20110312 (experimental) > > as recent GCCs no longer create multiple ctors in such case. Yes: I noted that in gdb/12568. I am not sure how I can trigger the bug with newer GCC versions... Ah yes, I can. > For a real testcase it should be in gdb.dwarf2/ (and then the special > compilation options are sure no longer needed). Sorry, I didn't follow that part. Why special options wouldn't be needed? >> +if { ![runto_main] } { >> +    fail "Can't run to main" >> +    return >> +} > > It could check the `info break' output without running the testcase at all. Done. Thanks, -- Paul Pluzhnikov ChangeLog: 2011-03-14 Paul Pluzhnikov PR gdb/12528 * dwarf2read.c (noop_record_line): New function. (dwarf_decode_lines): Ignore line tables for GCd functions. testsuite/ChangeLog: 2011-03-14 Paul Pluzhnikov PR gdb/12528 * gdb.dwarf2/break-on-linker-gcd-function.exp: New test. * gdb.dwarf2/break-on-linker-gcd-function.cc: New file.