public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: Pedro Alves <palves@redhat.com>
Cc: "Marcin Kościelnicki" <koriakin@0x04.net>,
	"Antoine Tremblay" <antoine.tremblay@ericsson.com>,
	gdb-patches@sourceware.org, qiyaoltc@gmail.com
Subject: Re: [PATCH v3] Enable tracing of pseudo-registers on ARM
Date: Wed, 24 Feb 2016 18:55:00 -0000	[thread overview]
Message-ID: <wwokfuwi7xal.fsf@ericsson.com> (raw)
In-Reply-To: <56CDF792.3040604@redhat.com>


Pedro Alves writes:

> On 02/24/2016 06:20 PM, Marcin Kościelnicki wrote:
>> On 24/02/16 19:11, Pedro Alves wrote:
>>> On 02/22/2016 04:51 PM, Antoine Tremblay wrote:
>>>>
>
>>>> While looking at fixing this for all the archs involved it would be
>>>> much simpler to test if gdbserver would make use of it.
>>>>
>>>> As it is now, I'm concerned that calling gdbarch_remote_register_number
>>>> in ax_reg, ax_mask_reg could break things if the arch already considers
>>>> the gdb raw -> target raw mapping like s390 and x86 do already (I'm not
>>>> 100% sure the mapping is already ok)?
>>>
>>> WDTM?  Where do they do this already?
>> 
>> FWIW, I failed to look at the numbering used when I wrote the x86 and 
>> s390 ax functions, so they're most likely wrong (I just copied the 
>> regnum computation logic from pseudo_read/write, which uses gdb 
>> numbers).  s390 hasn't landed yet, so it's only x86 that you'd have to 
>> fix now (and mips, I think, but that doesn't support tracepoints yet...).
>
> I don't think there's anything that needs fixing in the i386 implementation.
>
> The x86 implementation maps gdb pseudo register numbers to whatever
> raw gdb registers back the former up, like:
>
>       ax_reg_mask (ax, I387_FSTAT_REGNUM (tdep));
>
> That OK.
>
> The trouble is that in the end we send gdb numbers to the target in the
> ax, instead of tdesc/remote numbers.
>
> We never noticed because gdbserver always collects all raw registers
> anyway.
>
> Seems to me that the fix is to make ax_reg / ax_reg_mask take gdb raw
> numbers as input (as it does today), and then make it map those to
> tdesc/remote number just before it puts the reg number in the agent
> expression bytecode / reg mask.  And that covers all archs.
>
>> 
>> Testing this is possible if you write some conditions that involve 
>> reading pseudo-registers (since ax_pseudo_register_push_stack will be 
>> called), the problem is that I only implemented 
>> ax_pseudo_register_collect for x86...
>> 
>> Are you going to make some higher-level patch that will magically fix it 
>> for my s390 patch, or do I have to fix that on my own?
>
> I haven't memorized your s390 patch :-) but there's probably nothing to
> do on the s390-specific bits.
>

The only requirement for this to work properly is that the arch uses
tdesc_use_registers, otherwise the default mapping function to tdesc is
identity to GDB numbers.

s390 uses that so it should be fine.

Thanks,
Antoine

  reply	other threads:[~2016-02-24 18:55 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 17:45 [PATCH 0/4] Support tracepoints for ARM linux in GDBServer Antoine Tremblay
2016-01-07 17:45 ` [PATCH 1/4] Teach arm unwinders to terminate gracefully Antoine Tremblay
2016-02-12 14:46   ` Yao Qi
2016-02-24 17:57     ` Antoine Tremblay
2016-02-25 11:44     ` Pedro Alves
2016-02-25 13:15       ` Antoine Tremblay
2016-02-26  9:12         ` Yao Qi
2016-02-26 12:26           ` Antoine Tremblay
2016-02-26 14:25             ` Yao Qi
2016-02-26 20:10               ` Antoine Tremblay
2016-04-06 15:54       ` Yao Qi
2016-04-06 16:30         ` Pedro Alves
2016-04-07 16:33           ` Yao Qi
2016-05-04 16:24       ` Yao Qi
2016-01-07 17:45 ` [PATCH 2/4] Use the target architecture when encoding tracepoint actions Antoine Tremblay
2016-02-06 20:58   ` Marcin Kościelnicki
2016-02-11 13:02   ` Pedro Alves
2016-02-11 13:21     ` Antoine Tremblay
2016-01-07 17:45 ` [PATCH 4/4] Support tracepoints for ARM linux in GDBServer Antoine Tremblay
2016-02-08 14:45   ` Antoine Tremblay
2016-01-07 17:45 ` [PATCH 3/4] Enable tracing of pseudo-registers on ARM Antoine Tremblay
2016-02-12 15:14   ` Yao Qi
2016-02-12 15:54     ` Marcin Kościelnicki
2016-02-15 10:27       ` Yao Qi
2016-02-15 10:57         ` Pedro Alves
2016-02-15 14:46     ` [PATCH v2] " Antoine Tremblay
2016-02-19 16:33       ` Antoine Tremblay
2016-02-19 19:29         ` [PATCH v3] " Antoine Tremblay
2016-02-19 20:06           ` [PATCH v4] " Antoine Tremblay
2016-02-19 20:22           ` [PATCH v3] " Pedro Alves
2016-02-19 20:32             ` Antoine Tremblay
2016-02-22 11:51             ` Yao Qi
2016-02-22 16:51             ` Antoine Tremblay
2016-02-24 18:11               ` Pedro Alves
2016-02-24 18:21                 ` Marcin Kościelnicki
2016-02-24 18:33                   ` Pedro Alves
2016-02-24 18:55                     ` Antoine Tremblay [this message]
2016-02-24 19:02                       ` Pedro Alves
2016-02-24 19:02                     ` Antoine Tremblay
2016-02-23 19:34             ` Antoine Tremblay
2016-02-24 18:20               ` Pedro Alves
2016-02-24 18:47                 ` Antoine Tremblay
2016-02-23 19:41             ` [PATCH v5] " Antoine Tremblay
2016-02-24 19:12               ` Pedro Alves
2016-02-24 19:25                 ` Antoine Tremblay
2016-02-25 10:35               ` Yao Qi
2016-02-25 15:33                 ` [PATCH v6] " Antoine Tremblay
2016-02-25 17:59                   ` Pedro Alves
2016-02-25 18:19                     ` Antoine Tremblay
2016-02-26  8:34                   ` Yao Qi
2016-02-26 13:00                     ` Antoine Tremblay
2016-02-26 13:03                       ` [PATCH v7] " Antoine Tremblay
2016-02-26 14:14                         ` Yao Qi
2016-02-26 14:57                           ` Antoine Tremblay
2016-02-26 14:59                             ` [PATCH v8] " Antoine Tremblay
2016-02-26 15:57                               ` Yao Qi
2016-02-26 17:45                                 ` Antoine Tremblay
2016-01-11 12:17 ` [PATCH 0/4] Support tracepoints for ARM linux in GDBServer Yao Qi
2016-01-11 12:56   ` Antoine Tremblay
2016-01-11 13:41     ` Yao Qi
2016-04-26 19:11   ` Antoine Tremblay
2016-04-27  8:00     ` Yao Qi
2016-04-27 12:07       ` Antoine Tremblay
2016-04-27 13:57         ` Yao Qi
2016-04-27 14:41           ` 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=wwokfuwi7xal.fsf@ericsson.com \
    --to=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=koriakin@0x04.net \
    --cc=palves@redhat.com \
    --cc=qiyaoltc@gmail.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).