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: [PATCH v2 19/19] read/write_pieced_value: Merge into one function


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


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