From patchwork Tue Oct 21 00:56:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 39086 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E8130202DB for ; Tue, 21 Oct 2014 00:57:49 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id y10sf101364wgg.2 for ; Mon, 20 Oct 2014 17:57:49 -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=75Nf82GKnua9fWCGd6zXCyRlwWYZ4rBpiwnL5HN6MK0=; b=lbzEuw+baOxp8VXctQE+jLUkeLRQvFns2MuY6EUEYNVuzYMsxLM0S2jogbP8YLy+Pr 0SF6P77T1ILBN5l3zSEBccgnWFpt5+0fW05u4OEmagbIgbf4WCjsFf7w66CKeZF1MJgU 6AsKoMkm/KmfcMBamnjjhOP91RYVD1qhUhsZZHGyZdAZ5jkYh9gE/aPPB1Szv5zGVKHK kkf7BfkHLNAUZIyuKBIwhkXiG2DGl9vd8Bp7oVyK5Mosz7xOTzXNFGf/+JNNFrz9FN5Q hBhS6SIIY7p9evRkGgfhQQYQmvODaw/SbQdAEs2rMr091ykZfn5X/s4D9iA4dj+X8GIg gpfg== X-Gm-Message-State: ALoCoQmjczn7tbjNCGZbf/9vRBZqblmTO49bU3WAXjtzwWXEYw2657RWNYHd44YJzXszTwM3/FEW X-Received: by 10.112.154.194 with SMTP id vq2mr20205lbb.10.1413853069114; Mon, 20 Oct 2014 17:57:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.193 with SMTP id x1ls4381lae.53.gmail; Mon, 20 Oct 2014 17:57:48 -0700 (PDT) X-Received: by 10.152.9.201 with SMTP id c9mr30533891lab.38.1413853068768; Mon, 20 Oct 2014 17:57:48 -0700 (PDT) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com. [2a00:1450:4010:c03::22e]) by mx.google.com with ESMTPS id h5si16471308lam.129.2014.10.20.17.57.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Oct 2014 17:57:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22e as permitted sender) client-ip=2a00:1450:4010:c03::22e; Received: by mail-la0-f46.google.com with SMTP id gi9so123307lab.33 for ; Mon, 20 Oct 2014 17:57:48 -0700 (PDT) X-Received: by 10.112.210.102 with SMTP id mt6mr14041006lbc.73.1413853068346; Mon, 20 Oct 2014 17:57:48 -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 c5csp412113lbz; Mon, 20 Oct 2014 17:57:47 -0700 (PDT) X-Received: by 10.68.219.35 with SMTP id pl3mr6327645pbc.143.1413853066891; Mon, 20 Oct 2014 17:57:46 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z12si9422299pdi.23.2014.10.20.17.57.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Oct 2014 17:57:46 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-return-116852-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 12427 invoked by alias); 21 Oct 2014 00:57:30 -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 12177 invoked by uid 89); 21 Oct 2014 00:57:28 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f171.google.com Received: from mail-pd0-f171.google.com (HELO mail-pd0-f171.google.com) (209.85.192.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 21 Oct 2014 00:57:27 +0000 Received: by mail-pd0-f171.google.com with SMTP id ft15so195221pdb.16 for ; Mon, 20 Oct 2014 17:57:25 -0700 (PDT) X-Received: by 10.68.233.166 with SMTP id tx6mr1118573pbc.89.1413853045777; Mon, 20 Oct 2014 17:57:25 -0700 (PDT) Received: from kamensky-w530.cisco.com.net ([24.6.79.41]) by mx.google.com with ESMTPSA id g15sm10230692pdm.68.2014.10.20.17.57.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Oct 2014 17:57:25 -0700 (PDT) From: Victor Kamensky To: gdb-patches@sourceware.org Cc: victor.kamensky@linaro.org Subject: [PATCH 2/5] ARM: extract_arm_insn function need to read instrs correctly in be8 case Date: Mon, 20 Oct 2014 17:56:58 -0700 Message-Id: <1413853021-4393-3-git-send-email-victor.kamensky@linaro.org> In-Reply-To: <1413853021-4393-1-git-send-email-victor.kamensky@linaro.org> References: <1413853021-4393-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::22e as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 extract_arm_insn function needs to read instructions in gdbarch_byte_order_for_code byte order, because in case armv7b, even data is big endian, instructions are still little endian. Currently function uses gdbarch_byte_order which would be big endian in armv7b case. Because of this issue pretty much all gdb.reverse/ tests are failing with 'Process record does not support instruction' message. Fix is to change gdbarch_byte_order to gdbarch_byte_order_for_code, when passed to extract_unsigned_integer that reads instruction. --- gdb/ChangeLog | 5 +++++ gdb/arm-tdep.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c967a93..2aef5dc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-10-13 Victor Kamensky + + * arm-tdep.c (extract_arm_insn): use dbarch_byte_order_for_code + to read arm instruction. + 2014-09-30 Don Breazeal * inf-ptrace.c (inf_ptrace_follow_fork): Remove target-independent diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index e2559ec..e7a1ec5 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -13860,7 +13860,7 @@ extract_arm_insn (insn_decode_record *insn_record, uint32_t insn_size) return 1; insn_record->arm_insn = (uint32_t) extract_unsigned_integer (&buf[0], insn_size, - gdbarch_byte_order (insn_record->gdbarch)); + gdbarch_byte_order_for_code (insn_record->gdbarch)); return 0; }