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] Fix length calculation in aarch64_linux_set_debug_regs


Hi Simon,

On 02/11/15 14:48, Simon Marchi wrote:
 From what I understand, the dbg_regs array in the user_hwdebug_state structure
is 16 elements long, but we don't use all of them.  We want iov_len to reflect
only the used bytes.  If that's true, I don't think that the current code is
correct.  Instead, it can be computed simply with:

Your understand is correct, but the code is correct too.


   offsetof (struct user_hwdebug_state, dbg_regs) + count * sizeof (regs.dbg_reg[0]);


Your code must get the same value as the old code does.

Does it make sense?

Yes, but I think Pedro's suggestion is better.

--
Yao (éå)


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