Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Marcin Kościelnicki" <koriakin@0x04.net>
To: Yao Qi <qiyaoltc@gmail.com>,
	Antoine Tremblay <antoine.tremblay@ericsson.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/4] Enable tracing of pseudo-registers on ARM
Date: Fri, 12 Feb 2016 15:54:00 -0000	[thread overview]
Message-ID: <56BE002F.7050305@0x04.net> (raw)
In-Reply-To: <86egcineq0.fsf@gmail.com>

On 12/02/16 16:13, Yao Qi wrote:
> Antoine Tremblay <antoine.tremblay@ericsson.com> writes:
>
>> +/* Map the pseudo register number REG to the proper register number.  */
>> +
>> +static int
>> +arm_pseudo_register_to_register (struct gdbarch *gdbarch, int reg)
>> +{
>> +  int rawnum = 0;
>> +  int num_regs = gdbarch_num_regs (gdbarch);
>> +
>> +  /* Single precision pseudo registers. s0-s31.  */
>> +  if (reg >= num_regs && reg < num_regs + 32)
>> +    {
>> +      rawnum = (reg - num_regs) / 2 + 26;
>
> We should get double register number via user_reg_map_name_to_regnum,
>
>        xsnprintf (name_buf, sizeof (name_buf), "d%d", (reg - num_regs) / 2);
>        double_regnum = user_reg_map_name_to_regnum (gdbarch, name_buf,
> 						   strlen (name_buf));
> .
>> +    }
>> +  /* Quadruple precision pseudo regisers. q0-q15.  */
>> +  else if (reg >= num_regs + 32 && reg < num_regs + 32 + 16)
>> +    {
>> +      rawnum = (reg - num_regs - 32) * 2 + 26;
>
> Likewise,
>
>        xsnprintf (name_buf, sizeof (name_buf), "d%d", (reg - num_regs) * 2);
>        double_regnum = user_reg_map_name_to_regnum (gdbarch, name_buf,
> 						   strlen (name_buf));
>
> additionally, we need to check gdbarch_tdep (gdbarch)->have_neon_pseudos,
>
>> +    }
>> +  /* Error bad register number.  */
>> +  else
>> +    return -1;
>> +
>> +  return rawnum;
>> +}
>
> We also need a test case, and you can extend gdb.trace/tfile-avx.exp.
> Probably, it can be renamed to gdb.trace/tracefile-pseudo-reg.exp, and
> put x86 and arm tests in it.
>

I'd like to point out that this testcase is near-useless for testing 
ax_pseudo_register_collect or pseudo_register_to_register at the moment 
- while gdb computes a mask of what registers need to be collected, 
gdbserver just ignores it and collects all registers if any register at 
all is to be collected.  In turn, gdb allows you to display the state of 
all registers, even ones not included in the mask.  In fact, the 
tfile-avx.exp test passes just fine if you change it to collect any 
unrelated register.  My commit with ax_pseudo_register_collect only made 
it work because gdb needs to have that function return success, the 
actual returned mask could just as well be wrong...

The other hook, pseudo_register_push_stack, is much easier to test - 
it's invoked when a pseudo is used in an actual agent expression, eg. if 
you use it in a tracepoint condition, or as part of the address of 
collected memory area.  However, it cannot be used on SIMD registers (at 
least on x86, I don't know much about arm), as they don't fit in an 
ULONGEST...

Matter of fact, our support for >64-bit quantities in tracepoints is 
very poor at the moment - they can only be collected wholesale when 
they're single registers or contig memory areas.  Use in expressions is 
out (if you happen to have something interesting in low 32 bits of a 
vector reg, sorry).  Likewise, stiching them together with DW_op_piece 
(or whatever that was called) also fails (see 
https://sourceware.org/bugzilla/show_bug.cgi?id=17015).  We could 
definitely use some improvement there...


  reply	other threads:[~2016-02-12 15:54 UTC|newest]

Thread overview: 64+ 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 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 [this message]
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
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-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-01-11 12:17 ` [PATCH 0/4] " 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=56BE002F.7050305@0x04.net \
    --to=koriakin@0x04.net \
    --cc=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --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