This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Detect 64-bit-ness in PowerPC Book III-E
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: yao at codesourcery dot com (Yao Qi)
- Cc: anton at samba dot org, gdb-patches at sourceware dot org
- Date: Fri, 19 Dec 2014 16:49:40 +0100 (CET)
- Subject: Re: [PATCH] Detect 64-bit-ness in PowerPC Book III-E
- Authentication-results: sourceware.org; auth=none
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