From patchwork Mon Oct 27 03:16:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 39541 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1317F24026 for ; Mon, 27 Oct 2014 03:16:46 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id c13sf731844eek.4 for ; Sun, 26 Oct 2014 20:16:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:cc:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results; bh=5b6ImZWOYU80yisVo4JPWJejEOw+IgtKsMhqdfHyHQY=; b=IcWJHDq63AxxQuA5QqC8bzB+v4XGWJgE2buNBbMFQ5zkPmU9oD9hFDNWuaJ6kvYzT8 xXnTRjpglRrqgq3wcdH1FIogqmy6xK/L1m/B8QQ19t3j7A8GNXVoHUMZPweIRjtT2ZQN cTN3GoFz7dCG0ghSyF/E5DO+i/oPNvd2gWkO/SrCHk6IwVi9NtD0aHo90KqL3XSFMOlL FmZ4dt2Zr/Vn5aK7d6+NF39AsmhSzsDAhGj+l2YBVqaPmYARqlqA7BVZZZQ+nSCmLNx9 BQuofPm9xxO+tHGfKutBfX+fQhMaX2J2jkXRnXmk/mLtk6DySvN6l26t+fnf4blSk7eo Q5Ew== X-Gm-Message-State: ALoCoQl4etkgy1d39YFyr3tGQxg7QK4AaN2KJqfAsK7ZzsXrqpwQhVUtcNMd1wpNCx9Or6fkTlUO X-Received: by 10.112.137.202 with SMTP id qk10mr28571lbb.11.1414379806003; Sun, 26 Oct 2014 20:16:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.170 with SMTP id d10ls609418lad.75.gmail; Sun, 26 Oct 2014 20:16:45 -0700 (PDT) X-Received: by 10.112.142.33 with SMTP id rt1mr6295421lbb.85.1414379805779; Sun, 26 Oct 2014 20:16:45 -0700 (PDT) Received: from mail-la0-x230.google.com (mail-la0-x230.google.com. [2a00:1450:4010:c03::230]) by mx.google.com with ESMTPS id lf2si17853802lac.52.2014.10.26.20.16.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 Oct 2014 20:16:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::230 as permitted sender) client-ip=2a00:1450:4010:c03::230; Received: by mail-la0-f48.google.com with SMTP id gi9so5002392lab.7 for ; Sun, 26 Oct 2014 20:16:45 -0700 (PDT) X-Received: by 10.153.7.107 with SMTP id db11mr20481438lad.35.1414379805585; Sun, 26 Oct 2014 20:16:45 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp224297lbz; Sun, 26 Oct 2014 20:16:44 -0700 (PDT) X-Received: by 10.70.44.70 with SMTP id c6mr820152pdm.141.1414379803956; Sun, 26 Oct 2014 20:16:43 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id lz2si9495610pdb.43.2014.10.26.20.16.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Oct 2014 20:16:43 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-return-117041-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 11495 invoked by alias); 27 Oct 2014 03:16:33 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 11318 invoked by uid 89); 27 Oct 2014 03:16:32 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f181.google.com Received: from mail-pd0-f181.google.com (HELO mail-pd0-f181.google.com) (209.85.192.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 27 Oct 2014 03:16:31 +0000 Received: by mail-pd0-f181.google.com with SMTP id y10so430971pdj.40 for ; Sun, 26 Oct 2014 20:16:29 -0700 (PDT) X-Received: by 10.68.65.10 with SMTP id t10mr24452pbs.156.1414379789764; Sun, 26 Oct 2014 20:16:29 -0700 (PDT) Received: from kamensky-w530.cisco.com (128-107-239-233.cisco.com. [128.107.239.233]) by mx.google.com with ESMTPSA id sq2sm2509238pbc.73.2014.10.26.20.16.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Oct 2014 20:16:29 -0700 (PDT) From: Victor Kamensky To: gdb-patches@sourceware.org, Yao Qi Cc: Andrew Pinski , victor.kamensky@linaro.org Subject: [RFC PATCH 1/2] fix implptrpiece.exp test for big endian target Date: Sun, 26 Oct 2014 20:16:17 -0700 Message-Id: <1414379778-5478-2-git-send-email-victor.kamensky@linaro.org> In-Reply-To: <1414379778-5478-1-git-send-email-victor.kamensky@linaro.org> References: <1414379778-5478-1-git-send-email-victor.kamensky@linaro.org> X-Original-Sender: victor.kamensky@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::230 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 Currently on any big endian target implptrpiece.exp test fails like this: FAIL: gdb.dwarf2/implptrpiece.exp: print/d p[-1] (gdb) print/d p[-1] $1 = 1 (gdb) FAIL: gdb.dwarf2/implptrpiece.exp: print/d p[-1] Test expects that value of p[-1] should be 0. This test creates special DWARF construct with DW_OP_GNU_implicit_pointer: <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_GNU_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. Fix the test by checking endianity of the target and selecting proper index to get most significant byte of first piece. gdb/testsuite/ChangeLog: 2014-10-24 Victor Kamensky * 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/gdb.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 } -gdb_test "print/d p\[-1\]" " = 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\]" " = 0"