public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Antoine Tremblay <antoine.tremblay@ericsson.com>,
	       gdb-patches@sourceware.org
Subject: Re: [PATCH] Map registers to remote numbers when encoding an ax_reg or ax_reg_mask operation
Date: Thu, 25 Feb 2016 14:26:00 -0000	[thread overview]
Message-ID: <56CF0EF9.70807@redhat.com> (raw)
In-Reply-To: <1456406745-27854-1-git-send-email-antoine.tremblay@ericsson.com>

On 02/25/2016 01:25 PM, Antoine Tremblay wrote:
> When encoding the agent expression operation ax_reg or ax_reg_mask, the
> register number used is internal to GDB. However GDBServer expects a tdesc
> based number.
> 
> This usually does not cause a problem since at the moment, for raw
> registers GDBServer R trace action ignores the register mask and just
> collects all registers.
> 
> It can be a problem, however with pseudo registers on some platforms if the
> tdesc number doesn't match the GDB internal register number.
> 
> This is the case with ARM, the upcoming ARM tracepoint support, fails
> these test cases without this patch:
> 
> gdb.trace/collection.exp: collect register locals collectively:*
> 
> GDBSever would exit with: unhandled register size
> Since the register number is not mapped.
> 
> This patch fixes these issues by calling gdbarch_remote_register_number
> before encoding the register number in the ax_reg or ax_reg_mask operation.
> 
> Tested on x86 native-gdbserver no regressions observed.

>    else
>      {
> -      int byte = reg / 8;
> +      int byte = 0;

No need to zero initialize.

> +
> +      /* Get the remote register number.  */
> +      reg = gdbarch_remote_register_number (ax->gdbarch, reg);
> +      byte = reg / 8;
>  
>        /* Grow the bit mask if necessary.  */
>        if (byte >= ax->reg_mask_len)
> 

OK with ChangeLog entry.

Thanks,
Pedro Alves

  reply	other threads:[~2016-02-25 14:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25 13:25 Antoine Tremblay
2016-02-25 14:26 ` Pedro Alves [this message]
2016-02-25 14:30   ` Antoine Tremblay
2016-02-25 14:37     ` Antoine Tremblay

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=56CF0EF9.70807@redhat.com \
    --to=palves@redhat.com \
    --cc=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    /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).