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: [RFA] 64-bit range types in GDB


>>>>> "Paul" == Paul Hilfinger <Hilfinger@adacore.com> writes:

Paul> Here is the 64-bit range patch, revised per Tom's suggestions.
Paul> For now, I have eliminated the fixup_range_type_hack routine until
Paul> such time if ever that I find the failing cases that required
Paul> it. (Besides which, I see that the first patch didn't (ahem)
Paul> bother to call it anyway).

:-)

Paul> In check_typedef, I have handled the overflow situation by setting the
Paul> array length to 0.  I decided against using UINT_MAX given the likely
Paul> consequences of having such a value actually used to allocate a value
Paul> structure.

Thanks.

Paul> OK to commit?

One nit...

Paul> +	    /* For now, we conservatively take the array length to be 0
Paul> +	     * if its length exceeds UINT_MAX.  The code below assumes
Paul> +	     * that for x < 0, (ULONGEST) x == -x + ULONGEST_MAX + 1,
Paul> +	     * which is technically not guaranteed by C, but is usually true
Paul> +	     * (because it would be true if x were unsigned with its
Paul> +	     * high-order bit on). It uses the fact that
Paul> +	     * high_bound-low_bound is always representable in
Paul> +	     * ULONGEST and that if high_bound-low_bound+1 overflows,
Paul> +	     * it overflows to 0.  We must change these tests if we 
Paul> +	     * decide to increase the representation of TYPE_LENGTH
Paul> +	     * from unsigned int to ULONGEST.  FIXME: pnh/2009-12-07. */

The GNU style is not to put a "*" at the start of each line.  Also we
currently eschew new FIXME comments.  I think you could just remove the
FIXME.  I personally also am not in favor of putting one's initials in
comments -- gdb has several such comments where I have no clue at all
who the person might be.

Ok with that change.

Tom


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