From patchwork Mon Oct 27 12:11:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 3432 Received: (qmail 11938 invoked by alias); 27 Oct 2014 12:15:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 11922 invoked by uid 89); 27 Oct 2014 12:15:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Oct 2014 12:15:43 +0000 Received: from svr-orw-fem-02x.mgc.mentorg.com ([147.34.96.206] helo=SVR-ORW-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XijD2-0004uj-70 from Yao_Qi@mentor.com ; Mon, 27 Oct 2014 05:15:40 -0700 Received: from GreenOnly (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.3.181.6; Mon, 27 Oct 2014 05:15:39 -0700 From: Yao Qi To: Ulrich Weigand CC: Subject: Re: [PATCH] Fix trace file fails on powerpc64 References: <201410271107.s9RB7xto005844@d06av02.portsmouth.uk.ibm.com> Date: Mon, 27 Oct 2014 20:11:03 +0800 In-Reply-To: <201410271107.s9RB7xto005844@d06av02.portsmouth.uk.ibm.com> (Ulrich Weigand's message of "Mon, 27 Oct 2014 12:07:59 +0100") Message-ID: <87vbn5vhk8.fsf@codesourcery.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes Ulrich Weigand writes: > 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, fixed. > > OK with that change. Patch below is pushed in. diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 036da6d..2eea791 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-10-27 Yao Qi + + * gdb.trace/tfile.c (adjust_function_address) + [__powerpc64__ && _CALL_ELF != 2]: Get function address from + function descriptor. + 2014-10-24 Don Breazeal * gdb.base/foll-fork.exp (test_follow_fork, diff --git a/gdb/testsuite/gdb.trace/tfile.c b/gdb/testsuite/gdb.trace/tfile.c index e69240a..b673211 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__ && _CALL_ELF != 2 + /* Get function address from function descriptor. */ + return *(uintptr_t *) func_addr; #else return func_addr; #endif