From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22489 invoked by alias); 27 Oct 2014 11:08:17 -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 22479 invoked by uid 89); 27 Oct 2014 11:08:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: e06smtp16.uk.ibm.com Received: from e06smtp16.uk.ibm.com (HELO e06smtp16.uk.ibm.com) (195.75.94.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 27 Oct 2014 11:08:14 +0000 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 27 Oct 2014 11:08:07 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 27 Oct 2014 11:08:04 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 2DF4A1B08067 for ; Mon, 27 Oct 2014 11:08:06 +0000 (GMT) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s9RB83aj61538476 for ; Mon, 27 Oct 2014 11:08:03 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s9RB816v005971 for ; Mon, 27 Oct 2014 05:08:02 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id s9RB7xto005844; Mon, 27 Oct 2014 05:07:59 -0600 Message-Id: <201410271107.s9RB7xto005844@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 27 Oct 2014 12:07:59 +0100 Subject: Re: [PATCH] Fix trace file fails on powerpc64 To: yao@codesourcery.com (Yao Qi) Date: Mon, 27 Oct 2014 11:08:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <1414399382-25800-1-git-send-email-yao@codesourcery.com> from "Yao Qi" at Oct 27, 2014 04:43:02 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: 14102711-0025-0000-0000-000002153AF1 X-SW-Source: 2014-10/txt/msg00735.txt.bz2 Yao Qi wrote: > These fails are caused by writing function descriptor address into trace > file instead of function address. This patch is to teach tfile.c to > write function address on powerpc64 target. With this patch applied, > fails in tfile.exp and mi-traceframe-changed.exp are fixed. Is it > OK? > > gdb/testsuite: > > 2014-10-27 Yao Qi > > * gdb.trace/tfile.c (adjust_function_address) [__powerpc64__]: > Get function address from function descriptor. > --- > gdb/testsuite/gdb.trace/tfile.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gdb/testsuite/gdb.trace/tfile.c b/gdb/testsuite/gdb.trace/tfile.c > index e69240a..e9c347c 100644 > --- a/gdb/testsuite/gdb.trace/tfile.c > +++ b/gdb/testsuite/gdb.trace/tfile.c > @@ -130,6 +130,9 @@ adjust_function_address (uintptr_t func_addr) > /* Although Thumb functions are two-byte aligned, function > pointers have the Thumb bit set. Clear it. */ > return func_addr & ~1; > +#elif defined __powerpc64__ > + /* Get function address from function descriptor. */ > + return *(uintptr_t *) func_addr; This will break powerpc64le, which uses the ELFv2 ABI without function descriptors. The correct test should be something like #elif defined __powerpc64__ && _CALL_ELF != 2 OK with that change. Thanks, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com