Fix magic number in arm-tdep.c

Ulrich Weigand uweigand@de.ibm.com
Wed Mar 2 14:12:00 GMT 2011


Yao Qi wrote:

> 	* gdb/arm-tdep.c (shifted_reg_val): Replace magic number 15 with
> 	ARM_PC_REGNUM.
> 	(thumb_get_next_pc_raw, arm_get_next_pc_raw): Likewise.
> 	(displaced_write_reg, displaced_read_reg): Likewise.
> 	(copy_ldr_str_ldrb_strb, cleanup_block_load_all): Likewise.
> 	(cleanup_block_load_pc, copy_block_xfer): Likewise.
> 	(cleanup_branch): Replace magic number 14 and 15 with
> 	ARM_LR_REGNUM and ARM_PC_REGNUM respectively.

This is OK, but please keep the indentation in cases like:

> -		nextpc = (rn == 15) ? pc_val + 8
> +		nextpc = (rn == ARM_PC_REGNUM) ? pc_val + 8
>  				    : get_frame_register_unsigned (frame, rn);

(? and : should remain in the same column).

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com



More information about the Gdb-patches mailing list