public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: yao@codesourcery.com (Yao Qi)
Cc: anton@samba.org, gdb-patches@sourceware.org
Subject: Re: [PATCH] Detect 64-bit-ness in PowerPC Book III-E
Date: Fri, 19 Dec 2014 15:49:00 -0000	[thread overview]
Message-ID: <201412191549.sBJFnfPW030448@d03av02.boulder.ibm.com> (raw)
In-Reply-To: <87ioh8qd0w.fsf@codesourcery.com> from "Yao Qi" at Dec 19, 2014 04:06:39 PM

Yao Qi wrote:
> Ulrich Weigand <uweigand@de.ibm.com> writes:
> > Anton, what would you suggest a user program to use to safely detect
> > whether a ptrace-attached child is 64-bit or not, on either Book III-S
> > or Book III-E systems?
> 
> Maybe, we can first detect the Book III-S vs. Book III-E, and then
> detect 64-bit-ness.  However, I go through PowerISA, but don't find a
> way to differentiate Book III-S and Book III-E.

Well, on Linux a reliable way should be to check HWCAP for the bit:
#define PPC_FEATURE_BOOKE         0x00008000
This should be true if and only if we're running on any Book E
machine.

Of course, we cannot use the *inferior* process' HWCAP to decide
this, since we need to know the inferior process' wordsize in order
to decode its auxv.  We could use gdbserver's (or native GDB's)
*own* HWCAP to check for Book E, I guess, since this is an
invariant for the whole machine ...


Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

  reply	other threads:[~2014-12-19 15:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11 11:15 Yao Qi
2014-12-11 15:31 ` Ulrich Weigand
2014-12-19  8:06   ` Yao Qi
2014-12-19 15:49     ` Ulrich Weigand [this message]
2015-01-11  8:27       ` [PATCH 0/2, V2] " Yao Qi
2015-01-11  8:27         ` [PATCH 1/2] Move some ppc macros to nat/ppc-linux.h Yao Qi
2015-01-13 16:57           ` Ulrich Weigand
2015-01-11  8:27         ` [PATCH 2/2] Detect 64-bit-ness in PowerPC Book III-E Yao Qi
2015-01-13 17:00           ` Ulrich Weigand
2015-01-14  2:54             ` Yao Qi
2015-01-14 12:47               ` Ulrich Weigand
2015-01-14 14:22                 ` Yao Qi

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=201412191549.sBJFnfPW030448@d03av02.boulder.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=anton@samba.org \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.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).