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 2/2] record-full.h: rename record_ into record_full_


On Thu, 21 Feb 2013 13:52:30 +0100, markus.t.metzger@intel.com wrote:
> --- a/gdb/amd64-linux-tdep.c
> +++ b/gdb/amd64-linux-tdep.c
[...]
> @@ -1203,8 +1203,9 @@ amd64_linux_syscall_record (struct regcache *regcache)
>  	    regcache_raw_read_unsigned (regcache,
>  					amd64_linux_record_tdep.arg2,
>  					&addr);
> -	    if (record_arch_list_add_mem (addr,
> -					  amd64_linux_record_tdep.size_ulong))
> +	    if (record_full_arch_list_add_mem
> +		(addr,
> +		 amd64_linux_record_tdep.size_ulong))

Needless line wrap, it can be then:
		(addr,  amd64_linux_record_tdep.size_ulong))


>  	      return -1;
>  	  }
>  	goto record_regs;
[...]
> --- a/gdb/arm-tdep.c
> +++ b/gdb/arm-tdep.c
> @@ -12601,13 +12601,14 @@ arm_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
>    if (0 == ret)
>      {
>        /* Record registers.  */
> -      record_arch_list_add_reg (arm_record.regcache, ARM_PC_REGNUM);
> +      record_full_arch_list_add_reg (arm_record.regcache, ARM_PC_REGNUM);
>        if (arm_record.arm_regs)
>          {
>            for (no_of_rec = 0; no_of_rec < arm_record.reg_rec_count; no_of_rec++)
>              {
> -              if (record_arch_list_add_reg (arm_record.regcache , 
> -                                            arm_record.arm_regs[no_of_rec]))
> +              if (record_full_arch_list_add_reg
> +		  (arm_record.regcache ,
> +		   arm_record.arm_regs[no_of_rec]))

again:
		  (arm_record.regcache, arm_record.arm_regs[no_of_rec]))

>                ret = -1;
>              }
>          }
[...]
> --- a/gdb/i386-tdep.c
> +++ b/gdb/i386-tdep.c
[...]
> @@ -5726,7 +5726,7 @@ Do you want to stop the program?"),
>              case 0xdf:
>                if (0xe0 == ir.modrm)
>                  {
> -		  if (record_arch_list_add_reg (ir.regcache, I386_EAX_REGNUM))
> +		  if (record_full_arch_list_add_reg (ir.regcache, I386_EAX_REGNUM))

Exceeds 80 columns.


>  		    return -1;
>                  }
>                else if ((0x0f == ir.modrm >> 4) || (0x0e == ir.modrm >> 4))
[...]
>              for (i = I387_XMM0_REGNUM (tdep);
>                   i386_xmm_regnum_p (gdbarch, i); i++)
> -              record_arch_list_add_reg (ir.regcache, i);
> +              record_full_arch_list_add_reg (ir.regcache, i);
>  
>              if (i386_mxcsr_regnum_p (gdbarch, I387_MXCSR_REGNUM(tdep)))
> -              record_arch_list_add_reg (ir.regcache, I387_MXCSR_REGNUM(tdep));
> +              record_full_arch_list_add_reg (ir.regcache, I387_MXCSR_REGNUM(tdep));

Exceeds 80 columns.


>  
>              for (i = I387_ST0_REGNUM (tdep);
>                   i386_fp_regnum_p (gdbarch, i); i++)
> -              record_arch_list_add_reg (ir.regcache, i);
> +              record_full_arch_list_add_reg (ir.regcache, i);
>  
[...]
> --- a/gdb/linux-record.c
> +++ b/gdb/linux-record.c
[...]
> @@ -156,10 +156,11 @@ record_linux_msghdr (struct regcache *regcache,
>    /* msg_name msg_namelen */
>    addr = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
>    a += tdep->size_pointer;
> -  if (record_arch_list_add_mem ((CORE_ADDR) addr,
> -                                (int) extract_unsigned_integer (a,
> -				                                tdep->size_int,
> -				                                byte_order)))

FYI this was the usual indentation (I cannot find a rule for it) - rightmost,
indented under the opening parenthesis; record.c just rather used some more
non-standsrd style.

Not much a problem as record.c if full of this style you used here:


> +  if (record_full_arch_list_add_mem
> +      ((CORE_ADDR) addr,
> +       (int) extract_unsigned_integer (a,
> +				       tdep->size_int,
> +				       byte_order)))
>      return -1;
>    a += tdep->size_int;
>  
[...]
> @@ -1940,8 +1962,9 @@ Do you want to stop the program?"),
>            ULONGEST maxevents;
>  
>            regcache_raw_read_unsigned (regcache, tdep->arg3, &maxevents);
> -          if (record_arch_list_add_mem ((CORE_ADDR) tmpulongest,
> -                                        maxevents * tdep->size_epoll_event))
> +          if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
> +					     maxevents *
> +					     tdep->size_epoll_event))

Multi-line expressions should use parentheses and operators should be at the
beginning of lines, therefore:

# +          if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
# +					     (maxevents
# +					      * tdep->size_epoll_event)))


http://www.gnu.org/prep/standards/standards.html#Formatting
# but Emacs would alter it. Adding a set of parentheses produces something that looks equally nice, and which Emacs will preserve:
# 
# v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
#      + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000);


>              return -1;
>          }
>        break;
[...]


Thanks,
Jan


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