Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@codesourcery.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: hjl.tools@gmail.com, gdb-patches@sourceware.org
Subject: Re: PATCH: Enable x86 XML target descriptions
Date: Mon, 22 Feb 2010 14:41:00 -0000	[thread overview]
Message-ID: <20100222144141.GA30100@caradoc.them.org> (raw)
In-Reply-To: <201002221342.o1MDgSZA029705@glazunov.sibelius.xs4all.nl>

On Mon, Feb 22, 2010 at 02:42:28PM +0100, Mark Kettenis wrote:
> > +/* Get Linux/x86 target description from running target.  */
> > +
> > +static const struct target_desc *
> > +amd64_linux_read_description (struct target_ops *ops)
> > +{
> > +  if (gdbarch_ptr_bit (target_gdbarch) == 64)
> > +    return tdesc_amd64_linux;
> > +  else
> > +    return tdesc_i386_linux;
> > +}
> > +
> 
> This made me wonder what happens if you attach to a process without
> loading an executable first.  Currently this works, since GDB can
> figure out what executable belongs to the the process and load the
> executable automatically.  But I fear a chicken & egg problem here:
> the gdbarch is derviced from the tdesc, but in order to determine the
> tdesc you need a gdbarch.

Yes, I'm not comfortable having this function respond based on the
gdbarch.  It's supposed to query the target.  For instance, if you had
a ptrace request that failed if the target was 32-bit, you could use
that.  If that's not possible, it probably shouldn't be implemented.

> I didn't realize these functions would effectively be moved into
> target-descriptions.c.  That feels wrong.

For avoidance of doubt, that's true of the flags functions and the
builtin FP type; the vector type goes into the data files.  The FP
type there's no real way around.  The flags types could (I think
should) be transfered to the data files too - but it would require a
new element in the XML files.

I happen to have that patch sitting around somewhere... let me find
it.

-- 
Daniel Jacobowitz
CodeSourcery


  parent reply	other threads:[~2010-02-22 14:41 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-10 20:03 H.J. Lu
2010-02-17 14:59 ` H.J. Lu
2010-02-17 15:23   ` Mark Kettenis
2010-02-17 15:42     ` H.J. Lu
2010-02-17 15:46       ` Daniel Jacobowitz
2010-02-17 16:19         ` Mark Kettenis
2010-02-18  5:44 ` H.J. Lu
2010-02-18 15:37   ` H.J. Lu
2010-02-18 23:01     ` H.J. Lu
2010-02-22 13:42       ` Mark Kettenis
2010-02-22 14:17         ` H.J. Lu
2010-02-22 15:01           ` Mark Kettenis
2010-02-22 15:27             ` H.J. Lu
2010-02-22 15:30               ` Daniel Jacobowitz
2010-02-22 15:39                 ` H.J. Lu
2010-02-28 20:30           ` Mark Kettenis
2010-02-28 20:58             ` H.J. Lu
2010-02-28 22:23               ` Daniel Jacobowitz
2010-02-22 14:41         ` Daniel Jacobowitz [this message]
2010-02-22 15:34           ` H.J. Lu
2010-02-22 15:52             ` Daniel Jacobowitz
2010-02-22 15:58               ` H.J. Lu
2010-02-22 16:10                 ` Daniel Jacobowitz
2010-02-22 16:58                   ` Mark Kettenis
2010-02-22 17:03                     ` Daniel Jacobowitz
2010-02-22 19:52                       ` Mark Kettenis
2010-02-22 21:06                         ` H.J. Lu
2010-02-22 21:31                           ` Mark Kettenis
2010-02-22 21:41                             ` H.J. Lu
2010-02-22 22:05                               ` H. Peter Anvin
2010-02-22 22:07                                 ` H.J. Lu
2010-02-22 22:15                                   ` H. Peter Anvin
2010-02-22 22:21                                     ` H.J. Lu
2010-02-28 20:12                               ` Mark Kettenis
2010-02-22 21:04       ` H.J. Lu
2010-02-28 21:16         ` H.J. Lu
2010-03-01 14:49           ` Mark Kettenis
2010-03-01 17:07             ` Daniel Jacobowitz
2010-03-01 17:09               ` 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=20100222144141.GA30100@caradoc.them.org \
    --to=dan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=mark.kettenis@xs4all.nl \
    /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