This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH [2/2] Convert the unavailable vector to be bit, not byte, based.
- From: Andrew Burgess <aburgess at broadcom dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Tue, 17 Dec 2013 17:29:41 +0000
- Subject: Re: [PATCH [2/2] Convert the unavailable vector to be bit, not byte, based.
- Authentication-results: sourceware.org; auth=none
- References: <529F489F dot 7070805 at broadcom dot com> <529F498F dot 7060909 at broadcom dot com> <52A8929E dot 20608 at broadcom dot com> <52A8B2B3 dot 2060901 at redhat dot com>
On 11/12/2013 6:45 PM, Pedro Alves wrote:
> On 12/11/2013 04:28 PM, Andrew Burgess wrote:
>> +
>> + It is assumed that memory can be accessed from:
>> + PTR + (OFFSET_BITS / TARGET_CHAR_BIT)
>> + to:
>> + PTR + ((OFFSET_BITS + TARGET_CHAR_BIT - 1)/ TARGET_CHAR_BIT) */
>
> The "to:" part doesn't look right -- LENGTH_BITS seems to be
> missing somewhere? Also, missing space before second "/".
Fixed as:
+ It is assumed that memory can be accessed from:
+ PTR + (OFFSET_BITS / TARGET_CHAR_BIT)
+ to:
+ PTR + ((OFFSET_BITS + LENGTH_BITS + TARGET_CHAR_BIT - 1)
+ / TARGET_CHAR_BIT) */
>
>> + bits = TARGET_CHAR_BIT - (offset1_bits % TARGET_CHAR_BIT);
>
> Unnecessary parens.
Tightened up on this throughout.
>
>> + b1 = *((bfd_byte *) ((uintptr_t) ptr1 + (o1 / TARGET_CHAR_BIT)));
>> + b2 = *((bfd_byte *) ((uintptr_t) ptr2 + (o2 / TARGET_CHAR_BIT)));
>
> No need for uintptr_t, nor the rightmost set of parens:
Fixed.
>
> Otherwise looks OK. Thanks a lot for doing this!
I've pushed a version with those minor fixes.
Thanks for all your reviews.
Andrew