public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix length calculation in aarch64_linux_set_debug_regs
Date: Mon, 02 Nov 2015 16:51:00 -0000	[thread overview]
Message-ID: <56379498.1040109@gmail.com> (raw)
In-Reply-To: <1446475684-31936-1-git-send-email-simon.marchi@ericsson.com>

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 (齐尧)

  parent reply	other threads:[~2015-11-02 16:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-02 14:48 Simon Marchi
2015-11-02 16:00 ` Pedro Alves
2015-11-02 17:09   ` Simon Marchi
2015-11-02 17:57     ` Pedro Alves
2015-11-02 18:17       ` Simon Marchi
2015-11-02 18:19         ` Pedro Alves
2015-11-02 18:25         ` Andreas Schwab
2015-11-02 16:51 ` Yao Qi [this message]
2015-11-19 11:52 ` Yao Qi
2015-11-19 13:32   ` Simon Marchi
2015-11-19 13:51     ` Yao Qi
2015-11-19 15:20       ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56379498.1040109@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).