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 V3] read_pieced_value do big endian processing only in case of valid gdb_regnum


Victor Kamensky <victor.kamensky@linaro.org> writes:

> gdb/ChangeLog:
>
> 2014-10-21  Victor Kamensky  <victor.kamensky@linaro.org>
>
> 	* dwarf2loc.c (read_pieced_value): Do BE processing only if

s/BE/big endian/

> @@ -1876,15 +1876,15 @@ write_pieced_value (struct value *to, struct value *from)
>  	  {
>  	    struct gdbarch *arch = get_frame_arch (frame);
>  	    int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, p->v.regno);
> -	    int reg_offset = dest_offset;
> -
> -	    if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG
> -		&& this_size <= register_size (arch, gdb_regnum))
> -	      /* Big-endian, and we want less than full size.  */
> -	      reg_offset = register_size (arch, gdb_regnum) - this_size;
>  
>  	    if (gdb_regnum != -1)
>  	      {
> +		int reg_offset = dest_offset;

Add an empty line between local declaration and first statement.  See
https://sourceware.org/gdb/wiki/JoelsCodingStyleCheatSheet

> +		if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG
> +		    && this_size <= register_size (arch, gdb_regnum))
> +		  /* Big-endian, and we want less than full size.  */
> +		  reg_offset = register_size (arch, gdb_regnum) - this_size;
> +

Could you please add braces to the if block, which has more than one
lines? (braces are not needed if the block only has one line.)

		if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG
		    && this_size <= register_size (arch, gdb_regnum))
                    {
		      /* Big-endian, and we want less than full size.  */
                      reg_offset = register_size (arch, gdb_regnum) - this_size;
                    }

This patch is OK to me.  If there is no comments from other people in
three days, you can push it in.  I'd like this patch stay here for a
while, and another pair of eyes may have a chance to take a look.

-- 
Yao (éå)


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