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: [rfc] Detect dwarf address size mismatch


Daniel Jacobowitz <drow@false.org> writes:
> I just fixed a gas bug which caused MIPS64 Linux kernels to have
> corrupt DWARF information.  The .debug_info compilation unit header
> listed the address size as 4, but the .debug_line section used 64-bit
> addresses.  This caused GDB to parse the last four bits of each
> address as if they were instructions in the line number program.
>
> That version of GDB crashed when it got a bogus DW_LNS_set_file with
> an out-of-bounds file number (which has already been fixed in HEAD).
> But I think this patch is still useful, to detect the mismatch
> promptly instead of going off into the woods parsing bad data.
> I think I did get HEAD to crash once while testing.
>
> A more intrusive patch could let GDB handle the bad files as their
> producer intended, by reading an address of size extended_len - 1,
> but I don't think it's worth it when we can fix gas.
>
> Any comments on this patch, or shall I commit it?

Would it make sense to move the check after the extended_op switch
altogether, and always use extended_len to advance line_ptr?  This
would make GDB more robust against new extended opcodes.

The complaint is definitely appropriate, though.


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