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/11] Add IA64_MAX_REGISTER_SIZE


Alan Hayward <Alan.Hayward@arm.com> writes:

> @@ -2308,8 +2305,11 @@ ia64_sigtramp_frame_prev_register (struct frame_info *this_frame,
>
>        if (addr != 0)
>  	{
> -	  read_memory (addr, buf, register_size (gdbarch, IA64_IP_REGNUM));
> -	  pc = extract_unsigned_integer (buf, 8, byte_order);
> +	  gdb_byte buf[8];
> +	  struct gdbarch *gdbarch = get_frame_arch (this_frame);
> +	  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
> +	  read_memory (addr, buf, sizeof (buf));
> +	  pc = extract_unsigned_integer (buf, sizeof (buf), byte_order);

I just realize that we can use read_memory_unsigned_integer.

>  	}
>        pc &= ~0xf;
>        return frame_unwind_got_constant (this_frame, regnum, pc);

> @@ -2570,12 +2563,11 @@ ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum,
>  		     unw_word_t *val, int write, void *arg)
>  {
>    int regnum = ia64_uw2gdb_regnum (uw_regnum);
> -  unw_word_t bsp, sof, sol, cfm, psr, ip;
> +  ULONGEST bsp, sof, cfm, psr, ip;
>    struct regcache *regcache = (struct regcache *) arg;
>    struct gdbarch *gdbarch = get_regcache_arch (regcache);
>    enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
>    long new_sof, old_sof;
> -  gdb_byte buf[MAX_REGISTER_SIZE];
>
>    /* We never call any libunwind routines that need to write registers.  */
>    gdb_assert (!write);
> @@ -2585,10 +2577,8 @@ ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum,
>        case UNW_REG_IP:
>  	/* Libunwind expects to see the pc value which means the slot number
>  	   from the psr must be merged with the ip word address.  */
> -	regcache_cooked_read (regcache, IA64_IP_REGNUM, buf);
> -	ip = extract_unsigned_integer (buf, 8, byte_order);
> -	regcache_cooked_read (regcache, IA64_PSR_REGNUM, buf);
> -	psr = extract_unsigned_integer (buf, 8, byte_order);
> +	ip = get_frame_register_unsigned (this_frame, IA64_IP_REGNUM);

In my last review, I suggested,

regcache_cooked_read_unsigned (regcache, IA64_IP_REGNUM, &ip);

but you still use get_frame_register_unsigned.  There is no variable
"this_frame" at all.

> +	psr = get_frame_register_unsigned (this_frame, IA64_PSR_REGNUM);
>  	*val = ip | ((psr >> 41) & 0x3);
>  	break;
>

-- 
Yao (齐尧)


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