From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31119 invoked by alias); 27 Jan 2017 19:35:35 -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 30996 invoked by uid 89); 27 Jan 2017 19:35:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_40,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=exhibit, H*o:Research, *0xaa551234, UD:dw2-op-stack-value.exp X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Jan 2017 19:35:31 +0000 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v0RJXbis012603 for ; Fri, 27 Jan 2017 14:35:30 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2888y27yb7-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 27 Jan 2017 14:35:30 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Jan 2017 19:35:28 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 27 Jan 2017 19:35:27 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id AB75517D8056; Fri, 27 Jan 2017 19:38:25 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v0RJZRdO262502; Fri, 27 Jan 2017 19:35:27 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A40242047; Fri, 27 Jan 2017 19:35:24 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2C19642041; Fri, 27 Jan 2017 19:35:24 +0000 (GMT) Received: from oc1027705133.ibm.com (unknown [9.152.212.222]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 27 Jan 2017 19:35:24 +0000 (GMT) From: Andreas Arnez To: Yao Qi Cc: gdb-patches@sourceware.org, Jan Kratochvil Subject: Re: [PATCH] Big-endian targets: don't ignore offset into DW_OP_implicit_value References: <20170125221223.hsitc46wy462cb4b@localhost> Date: Fri, 27 Jan 2017 19:35:00 -0000 In-Reply-To: <20170125221223.hsitc46wy462cb4b@localhost> (Yao Qi's message of "Wed, 25 Jan 2017 22:12:23 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17012719-0012-0000-0000-000004C28B28 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17012719-0013-0000-0000-0000170E0614 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-27_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701270190 X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00634.txt.bz2 On Wed, Jan 25 2017, Yao Qi wrote: > On 17-01-12 20:24:27, Andreas Arnez wrote: >> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp >> index c28dcca..808f983 100644 >> --- a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp >> +++ b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp >> @@ -45,7 +45,7 @@ gdb_test_multiple $test $test { >> -re ":\[ \t\]*0xaa551234\r\n$gdb_prompt $" { >> # big endian >> pass $test >> - gdb_test "p/x implicit4to2" " = 0x3344" >> + gdb_test "p/x implicit4to2" " = 0x1122" >> gdb_test "p/x implicit4to4" " = 0x11223344" > > It takes me a while to understand this. I am wondering is it a valid > test case? how does compiler generate a DIE for a 2-byte variable > from a 4-byte implicit value. AFAIK never. I don't know why a compiler should emit a larger immediate value than necessary. So this is an artificial test. > DWARF spec isn't clear on this case to me. Right, DWARF does not specify this. Even so, we may want GDB to exhibit defined behavior for such corner cases as well. I probably wouldn't have added such a test, but I didn't want remove it either, because it could be considered useful in the sense that it tests GDB's "implementation-defined" behavior for this case. > It has nothing to do with your patch, but I just raise this > question when I read your patch. > >> +# Byte-aligned objects with simple location descriptions. >> +switch $endian { big {set val 0x345678} little {set val 0x785634} } >> +gdb_test "print/x def_implicit_s" " = \\{a = 0x12, b = $val\\}" >> +gdb_test "print/x def_implicit_s.b" " = $val" >> +gdb_test "print/x def_implicit_a" \ >> + " = \\{0x1, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89\\}" > > All these values are from debug information rather than inferior memory, > does it make sense to run these tests above with both big and little > endianess? I've tried, but I don't know to make it work. Switching to the opposite endianness affects more than just the byte order of variable contents; the variables are not even found any more. Any idea? > Otherwise, patch is good to me. Thanks! -- Andreas