This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Re: Advice on fixing gdb/12528


On Mon, Mar 14, 2011 at 5:41 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> 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  <ppluzhnikov@google.com>

       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  <ppluzhnikov@google.com>

       PR gdb/12528
       * gdb.dwarf2/break-on-linker-gcd-function.exp: New test.
       * gdb.dwarf2/break-on-linker-gcd-function.cc: New file.

Attachment: gdb-pr12528-20110314a.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]