From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9801 invoked by alias); 29 Oct 2014 08:15: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 9787 invoked by uid 89); 29 Oct 2014 08:15: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; Wed, 29 Oct 2014 08:15:21 +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 1XjOPV-0001Cd-Ov from Yao_Qi@mentor.com ; Wed, 29 Oct 2014 01:15:17 -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; Wed, 29 Oct 2014 01:15:16 -0700 From: Yao Qi To: Victor Kamensky CC: , Andrew Pinski Subject: Re: [RFC PATCH 1/2] fix implptrpiece.exp test for big endian target References: <1414379778-5478-1-git-send-email-victor.kamensky@linaro.org> <1414379778-5478-2-git-send-email-victor.kamensky@linaro.org> Date: Wed, 29 Oct 2014 08:15:00 -0000 In-Reply-To: <1414379778-5478-2-git-send-email-victor.kamensky@linaro.org> (Victor Kamensky's message of "Sun, 26 Oct 2014 20:16:17 -0700") Message-ID: <87k33jthxe.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/msg00791.txt.bz2 Victor Kamensky writes: > <1><25c>: Abbrev Number: 10 (DW_TAG_variable) > <25d> DW_AT_name : s > <25f> DW_AT_type : <0x21d> > <263> DW_AT_location : 15 byte block: 8 1 9f 93 2 8 2 9f 93 1 8 = 3 9f 93 1 (DW_OP_const1u: 1; DW_OP_stack_value; DW_OP_piece: 2; DW_OP_= const1u: 2; DW_OP_stack_value > ; DW_OP_piece: 1; DW_OP_const1u: 3; DW_OP_stack_value; DW_OP_piece: 1) > <1><273>: Abbrev Number: 11 (DW_TAG_variable) > <274> DW_AT_name : p > <276> DW_AT_type : <0x256> > <27a> DW_AT_location : 6 byte block: f2 0 0 2 5c 2 (DW_OP_GN= U_implicit_pointer: <0x25c> 2) > > In description of 's' variable note byte constant value of 1, that > will be used as first piece of size 2 bytes, followed by 1 byte > piece with 2, and 1 byte piece with 3. Variable 'p' is implicit > pointer with offset 2 within 's', i.e it points right in the middle > of s. Test looks at p[-1] and expects to get most significant > byte of short type of value 1, which is 0. But in big > endian case such index points to least significant byte which > is 1. So test fails. That sounds right to me. > gdb/testsuite/ChangeLog: > > 2014-10-24 Victor Kamensky An empty line is needed here. > * gdb.dwarf2/implptrpiece.exp: Fix handling of big > endian target. > --- > gdb/testsuite/gdb.dwarf2/implptrpiece.exp | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.dwarf2/implptrpiece.exp b/gdb/testsuite/gd= b.dwarf2/implptrpiece.exp > index 60a3d9f..5dcc6ea 100644 > --- a/gdb/testsuite/gdb.dwarf2/implptrpiece.exp > +++ b/gdb/testsuite/gdb.dwarf2/implptrpiece.exp > @@ -119,4 +119,15 @@ if ![runto_main] { > return -1 > } >=20=20 > -gdb_test "print/d p\[-1\]" " =3D 0" > +gdb_test_multiple "show endian" "getting target endian" { > + -re ".*little endian.*$gdb_prompt $" { > + set check_index "-1" > + # pass silently > + } > + -re ".*big endian.*$gdb_prompt $" { > + set check_index "-2" > + # pass silently > + } > +} > + > +gdb_test "print/d p\[$check_index\]" " =3D 0" I'd like to check both p[-1] and [-2] on two endianness, like, gdb_test_multiple "show endian" "getting target endian" { -re ".*little endian.*$gdb_prompt $" { gdb_test "print/d p\[-1\]" " =3D 0" gdb_test "print/d p\[-2\]" " =3D 1" # pass silently } -re ".*big endian.*$gdb_prompt $" { gdb_test "print/d p\[-1\]" " =3D 1" gdb_test "print/d p\[-2\]" " =3D 0" # pass silently } } --=20 Yao (=E9=BD=90=E5=B0=A7)