From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@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 12:15:00 -0000 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00736.txt.bz2 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 !=3D 2 OK, fixed. > > OK with that change. Patch below is pushed in. --=20 Yao (=E9=BD=90=E5=B0=A7) Subject: [PATCH] Fix trace file fails on powerpc64 I see the following fails on powerpc64-linux, (gdb) target tfile tfile-basic.tf^M warning: Uploaded tracepoint 1 has no source location, using raw address^M Tracepoint 1 at 0x10012358^M Created tracepoint 1 for target's tracepoint 1 at 0x10012358.^M (gdb) PASS: gdb.trace/tfile.exp: target tfile tfile-basic.tf info trace^M Num Type Disp Enb Address What^M 1 tracepoint keep y 0x0000000010012358 = ^M installed on target^M (gdb) FAIL: gdb.trace/tfile.exp: info tracepoints on trace file -target-select tfile tfile-basic.tf^M =3Dthread-group-started,id=3D"i1",pid=3D"1"^M =3Dthread-created,id=3D"1",group-id=3D"i1"^M &"warning: Uploaded tracepoint 1 has no source location, using raw address\= n"^M =3Dbreakpoint-created,bkpt=3D{number=3D"1",type=3D"tracepoint",disp=3D"keep= ",enabled=3D"y", addr=3D"0x0000000010012358",at=3D"",thread-groups= =3D["i1"], times=3D"0",installed=3D"y",original-location=3D"*0x10012358"}^M ~"Created tracepoint 1 for target's tracepoint 1 at 0x10012358.\n"^M ^connected^M (gdb) ^M FAIL: gdb.trace/mi-traceframe-changed.exp: tfile: select trace file 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__ && _CALL_ELF !=3D 2]: Get function address from function descriptor. 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 !=3D 2]: Get function address from + function descriptor. + 2014-10-24 Don Breazeal =20 * gdb.base/foll-fork.exp (test_follow_fork, diff --git a/gdb/testsuite/gdb.trace/tfile.c b/gdb/testsuite/gdb.trace/tfil= e.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 !=3D 2 + /* Get function address from function descriptor. */ + return *(uintptr_t *) func_addr; #else return func_addr; #endif