From patchwork Tue Jul 5 14:54:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 13661 Received: (qmail 4085 invoked by alias); 5 Jul 2016 14:55:10 -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 4067 invoked by uid 89); 5 Jul 2016 14:55:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Tcl, 865, testfile, catches X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 05 Jul 2016 14:54:59 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 15D1BC05B1F9 for ; Tue, 5 Jul 2016 14:54:58 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u65EstpN017513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 5 Jul 2016 10:54:57 -0400 Date: Tue, 5 Jul 2016 16:54:54 +0200 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [testsuite patch] [ppc64] +kfail: gdb_target_symbol does not support function descriptors Message-ID: <20160705145454.GA26978@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.1 (2016-04-27) X-IsSubscribed: yes Hi, Marin Cermak has found various testcases (or one of them) of GDB FAIL on ppc64. https://sourceware.org/bugzilla/show_bug.cgi?id=20328 # powerpc64-unknown-linux-gnu: # FAIL: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype f # FAIL: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype g # FAIL: gdb.dwarf2/dw2-lexical-block-bare.exp: p testvar # FAIL: gdb.dwarf2/atomic-type.exp: ptype f # # but: # powerpc64le-unknown-linux-gnu does PASS them (ppc64le does not use function # descriptors anymore) I do not see how to really fix it, DWARF needs to contain PC addresses, not function descriptor addresses. But .o contains only the function descriptor address. The DWARF as produced by Tcl Dwarf::assemble: <1><27>: Abbrev Number: 4 (DW_TAG_subprogram) <28> DW_AT_name : main <2d> DW_AT_external : 1 <2e> DW_AT_low_pc : 0x1001ff98 <36> DW_AT_high_pc : 0x1002ff98 <2><3e>: Abbrev Number: 5 (DW_TAG_lexical_block) Runtime info: $2 = {} 0x10000674 <.main> $3 = {void ()} 0x1001ff98
I haven't tried to use for DW_AT_low_pc (normally using DW_FORM_addr) to use DW_FORM_block* with DW_OP_deref as IIRC that is unsupported by GDB's dwarf2read.c et al.; if anyone thinks it could work I can try that. Also I am not sure whether "powerpc64-*linux*" really catches all and only all function descriptor platforms. OK for check-in? Jan gdb/testsuite/ChangeLog 2016-07-05 Jan Kratochvil * gdb.dwarf2/atomic-type.exp (ptype f): Add kfail testsuite/20328. * gdb.dwarf2/dw2-bad-mips-linkage-name.exp (ptype f, ptype g): Likewise. * gdb.dwarf2/dw2-lexical-block-bare.exp (p testvar): Likewise. diff --git a/gdb/testsuite/gdb.dwarf2/atomic-type.exp b/gdb/testsuite/gdb.dwarf2/atomic-type.exp index 7b35cad..f6557e5 100644 --- a/gdb/testsuite/gdb.dwarf2/atomic-type.exp +++ b/gdb/testsuite/gdb.dwarf2/atomic-type.exp @@ -86,4 +86,5 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \ return -1 } +setup_kfail "powerpc64-*linux*" "testsuite/20328" gdb_test "ptype f" "int \\(const _Atomic char \\\* volatile _Atomic\\)" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp index b1041fa..24cba04 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp @@ -68,5 +68,7 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \ # much matter what we test here, so long as we do something to make # sure that the DWARF is read. +setup_kfail "powerpc64-*linux*" "testsuite/20328" gdb_test "ptype f" " = bool \\(\\)" +setup_kfail "powerpc64-*linux*" "testsuite/20328" gdb_test "ptype g" " = bool \\(\\)" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp b/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp index 3f9411e..1c8f868 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp @@ -67,4 +67,5 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \ runto_main # FAILing GDB did print: No symbol "testvar" in current context. +setup_kfail "powerpc64-*linux*" "testsuite/20328" gdb_test "p testvar" { = -?[0-9]+}