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: [commit][obv] Use TYPE_LENGTH directly where possible


On Thu, 27 Sep 2012 11:59:17 +0200, Joel wrote:
> > Index: gdb/amd64-tdep.c
> [...]
> >    gdb_assert (class[1] != AMD64_MEMORY);
> > -  gdb_assert (len <= 16);
> > +  gdb_assert (TYPE_LENGTH (type) <= 16);
> 
> Add a comment here to warn us against replacing the expression
> with asserting on len, with an explanation as to why. This needs
> to be done at every location where this trick is used.
> 
> Do you think it's better to do things this way rather than declare
> len with the correct type?

I'd rather just revert the whole patch. This is the only patch where I
have used this trick.  I'll post it for review in a while...

... or I can revert the commit as obvious if it's OK ;)

Regards,
Siddhesh


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