public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: "H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: PATCH: 6/6 [2nd try]: Add AVX support (gdbserver changes)
Date: Sun, 28 Mar 2010 07:55:00 -0000	[thread overview]
Message-ID: <201003280855.44473.pedro@codesourcery.com> (raw)
In-Reply-To: <6dc9ffc81003271811t5be04ef9yf888edbce6d85236@mail.gmail.com>

On Sunday 28 March 2010 02:11:31, H.J. Lu wrote:
> > I guess you haven't tested this one :-)  You may want to add an AVX
> > test to the testsuite, if it's not too much trouble.  You're checking
> > for the "x86=xml" feature in the target, but only calling the target
> > method for "x86:xstate=...".  I don't see how it could work.
> >
> > The problem we're solving by modifying qSupported is that older
> > versions of GDB, which do not support XML registers at all, assume
> > a specific layout for the g/G packet.  Newer versions, which do
> > support XML, will use whatever the target supplies.  So, you only want
> > the target to supply the registers via XML if GDB will understand
> > them.  Is that accurate?
> 
> Yes,
> 
> > If that's the scope of the problem, then how about we handle
> > this in a way we can reuse for other targets?  That doesn't have
> > to change the implementation; just rename the feature to
> > "xmlRegisters+".
> 
> I will make the change.

This (and the gdbarch_qsupported mechanism) worries me multi-arch
design wise.  There's a bootstrapping problem here.  GDB sends qSupported
to the target before knowing the target's target description.  The target
sends the target description based on qSupported.
As is, things only work correctly, when GDB already somehow knows the
arch is some sort of x86 _before_ connecting to the target.  That's
usually true if you give GDB a binary, but may not be true in some
use cases.

As a matter of example, if you have, say, a PPC --enable-targets=all
GDB build, and you simply do:

 $ gdb
 (gdb) tar rem :9999

to connect to a x86 linux gdbserver, then, the x86 target will not
be sending the registers target description, because GDB wouldn't
be sending the "x86=xml" feature (the target_gdbarch would be
set to something not-x86 early in the connection, at the point
gdbarch_qsupported it called).  With the "xmlRegisters+" change,
it would be slightly even worse, as GDB would be sending a generic
"xmlRegisters+", meaning "Hello target, I understand xml register
descriptions for your arch", but, at a point when it may be
mistaken what is the target's arch, and the target would
have no way of knowing that.

It seems to me that GDB should be sending "x86=xml" or something
similar to the target unconditionally of whatever target_gdbarch is
before having fetched the target description.

What do you guys think?  Did I miss this being discussed?

-- 
Pedro Alves

  reply	other threads:[~2010-03-28  7:55 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04 18:02 PATCH: 1/6: Add AVX support H.J. Lu
2010-03-04 18:05 ` PATCH: 2/6: Add AVX support (Update document) H.J. Lu
2010-03-04 18:06   ` PATCH: 3/6: Add AVX support (i386 changes) H.J. Lu
2010-03-06 22:21     ` PATCH: 3/6 [2nd try]: " H.J. Lu
2010-03-07 21:32       ` H.J. Lu
2010-03-11 22:37         ` Mark Kettenis
2010-03-12  0:00           ` H.J. Lu
2010-03-27 14:55             ` Mark Kettenis
2010-03-27 15:30               ` Daniel Jacobowitz
2010-03-27 16:05                 ` Mark Kettenis
2010-03-27 15:33               ` H.J. Lu
2010-03-27 16:09                 ` Mark Kettenis
2010-03-28  1:39                   ` H.J. Lu
2010-03-12 16:49       ` H.J. Lu
2010-03-13  1:38         ` H.J. Lu
2010-03-29  1:11         ` PATCH: 3/6 [3rd " H.J. Lu
2010-04-02 14:31           ` H.J. Lu
2010-04-02 14:42             ` Mark Kettenis
2010-04-02 15:28               ` H.J. Lu
2010-04-07 10:13                 ` Mark Kettenis
2010-04-07 14:56                   ` H.J. Lu
2010-04-07 15:04                     ` H.J. Lu
2010-04-07 15:19                       ` Mark Kettenis
2010-04-07 16:55             ` H.J. Lu
2010-04-07 18:34               ` Mark Kettenis
2010-04-07 18:50                 ` H.J. Lu
2010-03-27 15:48       ` PATCH: 3/6 [2nd " Mark Kettenis
2010-03-28  1:37         ` H.J. Lu
2010-03-28 11:55           ` Mark Kettenis
2010-03-28 14:25             ` H.J. Lu
2010-03-29 20:32               ` Mark Kettenis
2010-03-29 21:41                 ` H.J. Lu
2010-03-04 18:08   ` PATCH: 4/6: Add AVX support (amd64 changes) H.J. Lu
2010-03-04 18:09     ` PATCH: 5/6: Add AVX support (i387 changes) H.J. Lu
2010-03-04 18:10       ` PATCH: 6/6: Add AVX support (gdbserver changes) H.J. Lu
2010-03-06 22:23         ` PATCH: 6/6 [2nd try]: " H.J. Lu
2010-03-12 17:25           ` H.J. Lu
2010-03-27 16:07             ` Daniel Jacobowitz
2010-03-28  1:11               ` H.J. Lu
2010-03-28  7:55                 ` Pedro Alves [this message]
2010-03-28 14:56                   ` H.J. Lu
2010-03-28 16:17                     ` Pedro Alves
2010-03-28 16:37                       ` H.J. Lu
2010-03-28 16:40                   ` Daniel Jacobowitz
2010-03-28 16:47                     ` Pedro Alves
2010-03-28 20:53                       ` H.J. Lu
2010-03-28 21:27                         ` Pedro Alves
2010-03-28 16:39                 ` Daniel Jacobowitz
2010-03-28 19:31                   ` H.J. Lu
2010-03-29  1:09             ` PATCH: 6/6 [3rd " H.J. Lu
2010-03-29 14:08               ` Eli Zaretskii
2010-03-29 14:42                 ` H.J. Lu
2010-03-29 15:11                   ` Eli Zaretskii
2010-03-29 15:42                     ` H.J. Lu
2010-03-29 15:51                       ` Eli Zaretskii
2010-03-30 16:48               ` H.J. Lu
2010-04-02 17:39                 ` Daniel Jacobowitz
2010-04-07  4:37                   ` H.J. Lu
2010-04-03 21:57                 ` Jan Kratochvil
2010-04-07  4:12                   ` H.J. Lu
2010-04-07 16:59                 ` H.J. Lu
2010-03-05  3:20       ` PATCH: 5/6: Add AVX support (i387 changes) Hui Zhu
2010-03-05  3:54         ` H.J. Lu
2010-03-06 22:22       ` PATCH: 5/6 [2nd try]: " H.J. Lu
2010-03-12 17:24         ` H.J. Lu
2010-04-07 16:57           ` PATCH: 5/6 [3rd " H.J. Lu
2010-03-27 15:08         ` PATCH: 5/6 [2nd " Mark Kettenis
2010-03-27 15:15           ` H.J. Lu
2010-03-06 22:21     ` PATCH: 4/6 [2nd try]: Add AVX support (amd64 changes) H.J. Lu
2010-03-07 21:33       ` H.J. Lu
2010-03-12 17:01         ` H.J. Lu
2010-03-13  1:38           ` H.J. Lu
2010-03-29  1:07           ` PATCH: 4/6 [3rd " H.J. Lu
2010-04-02 14:32             ` H.J. Lu
2010-04-07 16:54               ` H.J. Lu
2010-03-05 10:33   ` PATCH: 2/6: Add AVX support (Update document) Eli Zaretskii
2010-03-05 14:08     ` H.J. Lu
2010-03-06 22:19   ` PATCH: 2/6 [2nd try]: " H.J. Lu
2010-03-12 11:11     ` Eli Zaretskii
2010-03-12 14:17       ` H.J. Lu
2010-03-12 15:28         ` Eli Zaretskii
2010-03-12 15:27     ` Eli Zaretskii
2010-03-12 16:46     ` H.J. Lu
2010-03-12 18:15       ` Eli Zaretskii
2010-03-29  0:18     ` PATCH: 2/6 [3rd " H.J. Lu
2010-03-30 16:41       ` H.J. Lu
2010-03-30 18:27         ` Eli Zaretskii
2010-03-30 18:37           ` H.J. Lu
2010-03-04 19:09 ` PATCH: 1/6: Add AVX support Daniel Jacobowitz
2010-03-04 19:29   ` H.J. Lu
2010-03-04 19:47     ` Daniel Jacobowitz
2010-03-04 21:27       ` H.J. Lu
2010-03-04 21:34         ` Nathan Froyd
2010-03-04 21:41           ` H.J. Lu
2010-03-04 21:59             ` Nathan Froyd
2010-03-04 21:47         ` Daniel Jacobowitz
2010-03-05  2:06           ` H.J. Lu
2010-03-05  7:29             ` Mark Kettenis
2010-03-06 22:16 ` PATCH: 0/6 [2nd try]: " H.J. Lu
2010-03-06 22:18   ` PATCH: 1/6 [2nd try]: Add AVX support (AVX XML files) H.J. Lu
2010-03-07 14:16   ` PATCH: 0/6 [2nd try]: Add AVX support Mark Kettenis
2010-03-07 14:37     ` H.J. Lu
2010-03-07 16:31       ` H.J. Lu
2010-03-07 16:40         ` H.J. Lu
2010-03-07 17:04           ` H.J. Lu
2010-03-07 17:39             ` H.J. Lu
2010-03-07 20:00               ` Mark Kettenis
2010-03-07 19:10           ` Nathan Froyd
2010-03-07 19:49             ` Mark Kettenis
2010-03-07 21:07               ` Nathan Froyd
2010-03-07 21:17                 ` H.J. Lu
2010-03-07 20:29           ` Mark Kettenis
2010-03-07 21:04             ` H.J. Lu
2010-03-27 16:16   ` Daniel Jacobowitz
2010-03-29  0:16   ` PATCH: 0/6 [3nd " 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=201003280855.44473.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=hjl.tools@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).