[patch] Re: Advice on fixing gdb/12528

Paul Pluzhnikov ppluzhnikov@google.com
Wed Mar 16 17:43:00 GMT 2011


On Tue, Mar 15, 2011 at 11:06 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:

>> Maybe like this:
>>
>>                 if (address == 0 && !dwarf2_per_objfile->has_section_at_zero)
>>                   {
>>                     /* This line table is for a function which has been
>>                        GCd by the linker.  Ignore it.  PR gdb/12528 */
>>
>>                     long line_offset
>>                       = line_ptr - bytes_read - dwarf2_per_objfile->line.buffer;
>>
>>                     complaint (&symfile_complaints,
>>                                _(".debug_line offset 0x%lx uses address 0 "
>>                                  "[in module %s]"),
>>                                line_offset, cu->objfile->name);
>>                     p_record_line = noop_record_line;
>>                   }
>
> BYTES_READ is here just for the ADDRESS size.

Right. So the offset printed above is the offset of the address itself.

> I do not think the displayed offset is so importatnt but at least the module
> gets shown.

I think it's still (slightly) better to print offset to the start of address,
rather than just after it.

How about this then:

		  if (address == 0 && !dwarf2_per_objfile->has_section_at_zero)
		    {
		      /* This line table is for a function which has been
			 GCd by the linker.  Ignore it.  PR gdb/12528 */

		      long line_offset
			= line_ptr - bytes_read - dwarf2_per_objfile->line.buffer;

		      complaint (&symfile_complaints,
				 _(".debug_line address at offset 0x%lx is 0 "
				   "[in module %s]"),
				 line_offset, cu->objfile->name);
		      p_record_line = noop_record_line;
		    }

Thanks,
-- 
Paul Pluzhnikov



More information about the Gdb-patches mailing list