Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>, GDB <gdb-patches@sourceware.org>
Subject: Re: PATCH: Extend gdb remote protocol for AVX
Date: Thu, 18 Sep 2008 20:13:00 -0000	[thread overview]
Message-ID: <6dc9ffc80809181312m5b0b47edqf2484dc98f428a6@mail.gmail.com> (raw)
In-Reply-To: <20080918193858.GA26337@caradoc.them.org>

On Thu, Sep 18, 2008 at 12:38 PM, Daniel Jacobowitz <drow@false.org> wrote:
> On Thu, Sep 18, 2008 at 12:03:11PM -0700, H.J. Lu wrote:
>> On Thu, Sep 18, 2008 at 11:34 AM, Daniel Jacobowitz
>> <dan@codesourcery.com> wrote:
>> > On Thu, Sep 18, 2008 at 10:27:28AM -0700, H.J. Lu wrote:
>> >>    b. If remote target supports AVX:
>> >>       i. Don't send xmlarch.
>> >>       ii. Replace 128bit xmm registers with 256bit ymm registers in
>> >>         the g/G packet.
>> >>       iii. Gdb will auto-detect SSE unit on remote target, based on the
>> >>          the g/G packet size.
>> >
>> > Just a general note: I would much prefer you use the XML mechanism for
>> > this, either by an architecture name or a property or an explicit
>> > register description, than add more guesses to the g/G packet checks;
>> > they're a heuristic for existing remote targets.
>> >
>>
>> I tried adding xmlarch to regformats files. But I don't want to add new
>> xmlarch entry for AVX since I had to create a new arch entry in BFD for it. It
>> isn't necessary for this purpose. If I use the existing xmlarch, like
>> i386:x86-64, it will match regformats/reg-x86-64.dat. Using
>> the g/G packet size allows me not to add a new arch entry in BFD.
>> Is there a way to do it with XML without changing BFD?
>
> Yes, either of the other two options I described.  MIPS uses both of
> them; search for PROPERTY_GP32 or tdesc_has_registers.
>

I took a similar approach for remote AVX debug.  MIPS uses the
size of g/G packet to set PROPERTY_GPXX:

static void
mips_register_g_packet_guesses (struct gdbarch *gdbarch)
{
  /* If the size matches the set of 32-bit or 64-bit integer registers,
     assume that's what we've got.  */
  register_remote_g_packet_guess (gdbarch, 38 * 4, mips_tdesc_gp32);
  register_remote_g_packet_guess (gdbarch, 38 * 8, mips_tdesc_gp64);

  /* If the size matches the full set of registers GDB traditionally
     knows about, including floating point, for either 32-bit or
     64-bit, assume that's what we've got.  */
  register_remote_g_packet_guess (gdbarch, 90 * 4, mips_tdesc_gp32);
  register_remote_g_packet_guess (gdbarch, 90 * 8, mips_tdesc_gp64);

  /* Otherwise we don't have a useful guess.  */
}

AVX uses:

void
i386_register_g_packet_guesses (struct gdbarch *gdbarch,
                                int sse_unit_bytes,
                                int avx_unit_bytes)
{
  /* If the size matches the set of SSE registers, we are talking to
     an SSE remote target.  */
  register_remote_g_packet_guess (gdbarch,
                                  sse_unit_bytes,
                                  i386_tdesc_sse);

  /* If the size matches the set of AVX registers, we are talking to
     an AVX remote target.  */
  register_remote_g_packet_guess (gdbarch,
                                  avx_unit_bytes,
                                  i386_tdesc_avx);
}

Did I miss something?



-- 
H.J.


  reply	other threads:[~2008-09-18 20:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-18 17:28 H.J. Lu
2008-09-18 17:51 ` Mark Kettenis
2008-09-18 18:20   ` Mark Kettenis
2008-09-18 18:31     ` H.J. Lu
2008-09-18 18:34 ` Daniel Jacobowitz
2008-09-18 19:03   ` H.J. Lu
2008-09-18 19:39     ` Daniel Jacobowitz
2008-09-18 20:13       ` H.J. Lu [this message]
2008-09-18 20:24         ` Daniel Jacobowitz
2008-10-02 10:29 ` Mark Kettenis
2008-10-02 14:16   ` H.J. Lu
2008-10-04 20:52     ` Mark Kettenis
2008-10-04 22:14       ` Daniel Jacobowitz
2008-10-05 14:37         ` H.J. Lu
2008-10-06 21:35           ` Mark Kettenis
2008-10-07 19:22             ` H.J. Lu
2008-10-12 13:39               ` Mark Kettenis
2008-10-12 22:18                 ` H.J. Lu
2008-10-28 14:11                   ` H.J. Lu
2008-10-28 14:18                     ` Daniel Jacobowitz
2008-10-28 17:29                       ` Mark Kettenis
2008-10-29  7:41                         ` H.J. Lu
2008-10-29 16:45                           ` Mark Kettenis
2008-10-29  2:00                       ` H.J. Lu
2008-10-29  2:16                         ` Daniel Jacobowitz
2008-10-04 22:22       ` H.J. Lu

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=6dc9ffc80809181312m5b0b47edqf2484dc98f428a6@mail.gmail.com \
    --to=hjl.tools@gmail.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