From patchwork Mon Oct 27 03:14:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 39540 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1545124026 for ; Mon, 27 Oct 2014 03:15:12 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id r20sf1401273wiv.10 for ; Sun, 26 Oct 2014 20:15:11 -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=Al9FWsWqu2N4rOpM/0ecpksRr1ZsYwgT2hcsGYlpWIA=; b=FXdSU/wFWDncX81Hd95+3ggReSYvaT54j6Vjm1GTXEu0nkd7QR1dkhICLc3ZgillaD tOVwe9OVHmXQAp1GJDKK4WGc2lj/9i9UtWx9bhqBED7aQw334Xye6x5pVSgC2gtvgPNA 2xXDrgBpKf91LEp4nWSEV3fH7aobeGywUonW1sNN7nuZOBkM6d5tJO+NNGUkxUCN+Lyw C66/5C8Vp/B7W9JQFMHnleQXI/QxQiRpCyoq9THw5Ijq5N9PZOFUbXQa3h1fRRJAcfY/ xn+MDaNRmElWebdpvQTajJdJTrDbZp2iC97edf0M3CN/yZD96b5aoC/KOGg78kW23A88 1aCg== X-Gm-Message-State: ALoCoQnHCB2cVDrbB+FIozNg3C6S4WWVivbqIjr8qFs89sU+kq2qHavaTHVmmmBZr0CEPrN1IBwW X-Received: by 10.180.72.141 with SMTP id d13mr3388218wiv.6.1414379711281; Sun, 26 Oct 2014 20:15:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.33 with SMTP id cb1ls158382lad.89.gmail; Sun, 26 Oct 2014 20:15:11 -0700 (PDT) X-Received: by 10.152.45.2 with SMTP id i2mr20502473lam.7.1414379711132; Sun, 26 Oct 2014 20:15:11 -0700 (PDT) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com. [2a00:1450:4010:c04::231]) by mx.google.com with ESMTPS id t17si17811902laz.81.2014.10.26.20.15.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 Oct 2014 20:15:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::231 as permitted sender) client-ip=2a00:1450:4010:c04::231; Received: by mail-lb0-f177.google.com with SMTP id b6so1112162lbj.22 for ; Sun, 26 Oct 2014 20:15:11 -0700 (PDT) X-Received: by 10.112.201.201 with SMTP id kc9mr20886637lbc.76.1414379711042; Sun, 26 Oct 2014 20:15:11 -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 c5csp224187lbz; Sun, 26 Oct 2014 20:15:10 -0700 (PDT) X-Received: by 10.70.101.234 with SMTP id fj10mr21965949pdb.22.1414379709389; Sun, 26 Oct 2014 20:15:09 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id ix4si9365720pac.198.2014.10.26.20.15.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Oct 2014 20:15:09 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-return-117039-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 9304 invoked by alias); 27 Oct 2014 03:14:54 -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 9201 invoked by uid 89); 27 Oct 2014 03:14:54 -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-pa0-f49.google.com Received: from mail-pa0-f49.google.com (HELO mail-pa0-f49.google.com) (209.85.220.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 27 Oct 2014 03:14:52 +0000 Received: by mail-pa0-f49.google.com with SMTP id lj1so425006pab.8 for ; Sun, 26 Oct 2014 20:14:50 -0700 (PDT) X-Received: by 10.70.46.137 with SMTP id v9mr21531963pdm.78.1414379690473; Sun, 26 Oct 2014 20:14:50 -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 te2sm2220682pbc.51.2014.10.26.20.14.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Oct 2014 20:14:49 -0700 (PDT) From: Victor Kamensky To: gdb-patches@sourceware.org Cc: Yao Qi , Andrew Pinski , victor.kamensky@linaro.org Subject: [PATCH 2/2] aarch64: tramp_frame_start function need to read instrs correctly in be8 case Date: Sun, 26 Oct 2014 20:14:28 -0700 Message-Id: <1414379668-5351-3-git-send-email-victor.kamensky@linaro.org> In-Reply-To: <1414379668-5351-1-git-send-email-victor.kamensky@linaro.org> References: <1414379668-5351-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:c04::231 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 tramp_frame_start function needs to read instructions in gdbarch_byte_order_for_code byte order, because in case aarch64_be, even data is big endian, instructions are still little endian. Currently function uses gdbarch_byte_order which would be big endian in aarch64_be case. Because of this issue pretty much all tests that involve backtrace of stack with signal frame are failing on aarch64_be target. Fix is to change gdbarch_byte_order to gdbarch_byte_order_for_code, when passed to extract_unsigned_integer that reads instruction. gdb/ChangeLog: 2014-10-24 Victor Kamensky * gdb/tramp-frame.c (tramp_frame_start): Use gdbarch_byte_order_for_code to read aarch64 instruction. --- gdb/tramp-frame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/tramp-frame.c b/gdb/tramp-frame.c index 0fd6ddc..41dcd94 100644 --- a/gdb/tramp-frame.c +++ b/gdb/tramp-frame.c @@ -83,7 +83,7 @@ tramp_frame_start (const struct tramp_frame *tramp, struct frame_info *this_frame, CORE_ADDR pc) { struct gdbarch *gdbarch = get_frame_arch (this_frame); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); + enum bfd_endian byte_order = gdbarch_byte_order_for_code (gdbarch); int ti; /* Search through the trampoline for one that matches the