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>,
	Mark Kettenis <mark.kettenis@xs4all.nl>,
	 	gdb-patches@sourceware.org
Subject: Re: PATCH: Enable x86 XML target descriptions
Date: Mon, 22 Feb 2010 15:58:00 -0000	[thread overview]
Message-ID: <6dc9ffc81002220757v5e9b48bdnba56a260f0f3c0a8@mail.gmail.com> (raw)
In-Reply-To: <20100222155243.GC30100@caradoc.them.org>

On Mon, Feb 22, 2010 at 7:52 AM, Daniel Jacobowitz <dan@codesourcery.com> wrote:
> On Mon, Feb 22, 2010 at 07:34:01AM -0800, H.J. Lu wrote:
>> I just need to know if the inferior is 32bit or 64bit. Why shouldn't
>> target_gdbarch be used? At this point, target_gdbarch should have
>> the correct bfd cpu info. Is that correct?
>
> Not if, for instance, we did not find the executable.

How do you debug if you can't find executable? I am not sure if
you can get that far.

> If you are just guessing based on the gdbarch, what value does this
> function add?
>

AVX version is

static const struct target_desc *
amd64_linux_read_description (struct target_ops *ops)
{
  gdb_assert (i386_xstate.status != XSTATE_UNKNOWN);

  if (have_ptrace_getregset == -1)
    {
      int tid;
      unsigned long long xstateregs[i386_xstate.n_of_int64];
      struct iovec iov;

      /* GNU/Linux LWP ID's are process ID's.  */
      tid = TIDGET (inferior_ptid);
      if (tid == 0)
        tid = PIDGET (inferior_ptid); /* Not a threaded program.  */

      iov.iov_base = xstateregs;
      iov.iov_len = i386_xstate.size;

      /* Check if PTRACE_GETREGSET works.  */
      if (ptrace (PTRACE_GETREGSET, tid,
                  (unsigned int) NT_X86_XSTATE, (long) &iov) < 0)
        have_ptrace_getregset = 0;
      else
        have_ptrace_getregset = 1;
    }

  /* Check the native XCR0 only if PTRACE_GETREGSET is available.  */
  if (have_ptrace_getregset &&
      (i386_xstate.xcr0 & XSTATE_AVX_MASK) == XSTATE_AVX_MASK)
    {
      if (gdbarch_ptr_bit (target_gdbarch) == 64)
        return tdesc_amd64_avx_linux;
      else
        return tdesc_i386_avx_linux;
    }
  else
    {
      if (gdbarch_ptr_bit (target_gdbarch) == 64)
        return tdesc_amd64_linux;
      else
        return tdesc_i386_linux;
    }
}

That is we use AVX target only if kernel and hardware support it.


-- 
H.J.


  reply	other threads:[~2010-02-22 15:58 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
2010-02-22 15:34           ` H.J. Lu
2010-02-22 15:52             ` Daniel Jacobowitz
2010-02-22 15:58               ` H.J. Lu [this message]
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=6dc9ffc81002220757v5e9b48bdnba56a260f0f3c0a8@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --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