From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24882 invoked by alias); 19 Dec 2014 15:49:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 24870 invoked by uid 89); 19 Dec 2014 15:49:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e31.co.us.ibm.com Received: from e31.co.us.ibm.com (HELO e31.co.us.ibm.com) (32.97.110.149) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 19 Dec 2014 15:49:48 +0000 Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 Dec 2014 08:49:46 -0700 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 19 Dec 2014 08:49:44 -0700 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id DB57C1FF001E for ; Fri, 19 Dec 2014 08:38:27 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sBJFnhtg47841384 for ; Fri, 19 Dec 2014 08:49:43 -0700 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sBJFnh1R030623 for ; Fri, 19 Dec 2014 08:49:43 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id sBJFnfPW030448; Fri, 19 Dec 2014 08:49:41 -0700 Message-Id: <201412191549.sBJFnfPW030448@d03av02.boulder.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 19 Dec 2014 16:49:40 +0100 Subject: Re: [PATCH] Detect 64-bit-ness in PowerPC Book III-E To: yao@codesourcery.com (Yao Qi) Date: Fri, 19 Dec 2014 15:49:00 -0000 From: "Ulrich Weigand" Cc: anton@samba.org, gdb-patches@sourceware.org In-Reply-To: <87ioh8qd0w.fsf@codesourcery.com> from "Yao Qi" at Dec 19, 2014 04:06:39 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14121915-8236-0000-0000-000007ED7687 X-SW-Source: 2014-12/txt/msg00580.txt.bz2 Yao Qi wrote: > Ulrich Weigand 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