This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 19/19] read/write_pieced_value: Merge into one function
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 12 Jun 2017 16:34:52 +0200
- Subject: Re: [PATCH v2 19/19] read/write_pieced_value: Merge into one function
- Authentication-results: sourceware.org; auth=none
- References: <1494352015-10465-1-git-send-email-arnez@linux.vnet.ibm.com> <1494352015-10465-20-git-send-email-arnez@linux.vnet.ibm.com> <86vao18g1y.fsf@gmail.com>
On Mon, Jun 12 2017, Yao Qi wrote:
> Andreas Arnez <arnez@linux.vnet.ibm.com> writes:
>
>> + if (from == NULL)
>> + {
>> + /* Read mode. */
>> + read_value_memory (v, offset,
>> + p->v.mem.in_stack_memory,
>> + p->v.mem.addr + bits_to_skip / 8,
>> + buffer.data (), this_size);
>> + copy_bitwise (v_contents, offset,
>> + buffer.data (), bits_to_skip % 8,
>> + this_size_bits, bits_big_endian);
>> + break;
>> + }
>> +
>> + /* Write mode. */
>
> I feel it is more clear to add "else" here, like
>
> if (from == NULL)
> {
> /* Read mode. */
> }
> else
> {
> /* Write mode. */
> }
>
> then, we don't need the "break" above.
Yeah, I agree. Will change.
Thanks for reviewing so far! I think the only patch you haven't
approved yet is patch #17 "Fix bit-/byte-offset mismatch in parameter to
read_value_memory". Do you want to have a look at that as well?
--
Andreas