RFA: handle zero-length types in value_from_register

Jim Blandy jimb@redhat.com
Wed Jan 28 05:49:00 GMT 2004


Andrew Cagney <cagney@gnu.org> writes:
> > Andrew Cagney <cagney@gnu.org> writes:
> >
> >> > 2004-01-27  Jim Blandy  <jimb@redhat.com>
> >> > 	* findvar.c (value_from_register): If the type has no length,
> >> > just
> >> > 	return an acceptable value --- don't report an internal error.
> >> >
> >
> >> This looks to need a test case.
> > I tried to put one together, but the bug only occurs when the
> > zero-length value is allocated to a register.  I couldn't find any way
> > to make that happen at all.  So the only known instance of this bug
> > depends on bad debug info.
> 
> The commentary should really reflect this important detail (also
> mention the compiler that's broken for instance).  Should GDB also
> complain about the bogus info?

Seems reasonable.  I've attached a revision of the original patch,
with an expanded comment, and a separate patch that makes GDB complain
when it sees the bogus info.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: jimb.gdb-zero-length-type.patch
Type: text/x-patch
Size: 2124 bytes
Desc: tolerate reading zero-length values from registers
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20040128/b0d36b10/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jimb.gdb-stabsread-check-for-undefined-types.patch
Type: text/x-patch
Size: 2207 bytes
Desc: check that forward reference type numbers are resolved
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20040128/b0d36b10/attachment-0001.bin>


More information about the Gdb-patches mailing list