From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 526 invoked by alias); 27 Oct 2014 08:48:26 -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 496 invoked by uid 89); 27 Oct 2014 08:48:25 -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 08:48:23 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1XifyO-0005wB-7x from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Mon, 27 Oct 2014 01:48:20 -0700 Received: from qiyao.dyndns.org.com (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.181.6; Mon, 27 Oct 2014 01:48:19 -0700 From: Yao Qi To: Subject: [PATCH] Fix trace file fails on powerpc64 Date: Mon, 27 Oct 2014 08:48:00 -0000 Message-ID: <1414399382-25800-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00732.txt.bz2 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 =thread-group-started,id="i1",pid="1"^M =thread-created,id="1",group-id="i1"^M &"warning: Uploaded tracepoint 1 has no source location, using raw address\n"^M =breakpoint-created,bkpt={number="1",type="tracepoint",disp="keep",enabled="y", addr="0x0000000010012358",at="",thread-groups=["i1"], times="0",installed="y",original-location="*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__]: 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; #else return func_addr; #endif -- 1.9.3