This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] GDB: Work around buggy Dwarf lineinfo produced by third party compiler.
- From: Simon Marchi <simark at simark dot ca>
- To: John Darrington <john at darrington dot wattle dot id dot au>, gdb-patches at sourceware dot org
- Date: Sun, 7 Oct 2018 18:21:17 -0400
- Subject: Re: [PATCH] GDB: Work around buggy Dwarf lineinfo produced by third party compiler.
- References: <20181003084907.29538-1-john@darrington.wattle.id.au>
On 2018-10-03 4:49 a.m., John Darrington wrote:
> * gdb/dwarf2read.c (producer_is_codewarrior): New function.
> * gdb/dwarf2read.c (lnp_state_machine::record_line): Ignore is_stmt
> flag for records produced by codewarrior.
Hi John,
The code looks good to me, but could you mention (both in the commit log and the
code) what compiler version you are using? If somebody comes up later and says
this workaround breaks their debugging of codewarrior-generated code, we'll have
a bit of data to sort it out.
I think we've talked about it on IRC, but if I understand correctly, this is not
a maintained product anymore, so there's no use of notifying the publisher so they
fix the problem in the compiler?
On nit, you could use "bool" as a return type for producer_is_codewarrior (the other
producer_is_* functions were written pre-switch-to-C++).
For the ChangeLog, the paths should be relative to the ChangeLog (gdb/ChangeLog)
in this case, so you would remove the leading gdb/. Also, you would not repeat
the same filename, just put the entries in the same file after. Finally, there
are some entries missing. Overall, it could look like this:
* dwarf2read.c (dwarf2_cu) <producer_is_codewarrior>: New field.
(check_producer): Check if the producer is codewarrior.
(producer_is_codewarrior): New function.
(lnp_state_machine::record_line): Ignore is_stmt flag for records
produced by codewarrior.
(dwarf2_cu::dwarf2_cu): Initialize producer_is_codewarrior.
Thanks,
Simon