From patchwork Mon Oct 27 03:10:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 39536 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6930C24026 for ; Mon, 27 Oct 2014 03:11:03 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf552219lab.3 for ; Sun, 26 Oct 2014 20:11:02 -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=z0dW5OHmzykQcajEaQx+j0HHhTzTqbYzbJUACnYch28=; b=gShbatnpLEu3dBge6jfrkKe0f68h7tXTrrchLDuQcxGqI+jE5w5qIZEkVU6UVyvOws jE3mSfJcGU20j2s5qeCKAKBua2seQBBTSI+nI8MKntfDYwLw1PEVrkKwPsNXP36lAZRN E5VRsIrNgJI8tEz/2kTvUMNcpsCqLDUpF0gm2/o56Wi9FcAP6ef5LP8Ro3uCAxfAJ17F hBI4yzywSiZ6qWEPyiz3i0rsmxHUnxRTYbVZbcSXEtJvqUhoF82g3mZevW3VzpvVCpOC DrW/bEDoVBWxFkhMIt41VR5S8kxyMJElekgyG+3fMxqg4/kNsSRZbiEi6mv2LT0k0p5N au7w== X-Gm-Message-State: ALoCoQkt2FY85YI5XXqBy+usI0gshhYwqJtnPBOinLHm2SOdTofmENvcCTYZ/rz0RT+Sz3C5upt3 X-Received: by 10.180.98.165 with SMTP id ej5mr4743673wib.1.1414379462021; Sun, 26 Oct 2014 20:11:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.33 with SMTP id cb1ls158220lad.89.gmail; Sun, 26 Oct 2014 20:11:01 -0700 (PDT) X-Received: by 10.112.11.201 with SMTP id s9mr20093592lbb.79.1414379461873; Sun, 26 Oct 2014 20:11:01 -0700 (PDT) Received: from mail-la0-x22a.google.com (mail-la0-x22a.google.com. [2a00:1450:4010:c03::22a]) by mx.google.com with ESMTPS id ri5si17770548lbb.115.2014.10.26.20.11.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 Oct 2014 20:11:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22a as permitted sender) client-ip=2a00:1450:4010:c03::22a; Received: by mail-la0-f42.google.com with SMTP id gf13so5677164lab.29 for ; Sun, 26 Oct 2014 20:11:01 -0700 (PDT) X-Received: by 10.153.7.107 with SMTP id db11mr20460524lad.35.1414379461209; Sun, 26 Oct 2014 20:11:01 -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 c5csp223910lbz; Sun, 26 Oct 2014 20:11:00 -0700 (PDT) X-Received: by 10.66.220.197 with SMTP id py5mr29001pac.140.1414379459582; Sun, 26 Oct 2014 20:10:59 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id uq1si9518137pac.4.2014.10.26.20.10.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Oct 2014 20:10:59 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-return-117034-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 5326 invoked by alias); 27 Oct 2014 03:10:47 -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 5293 invoked by uid 89); 27 Oct 2014 03:10:45 -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:10:44 +0000 Received: by mail-pd0-f181.google.com with SMTP id y10so421650pdj.26 for ; Sun, 26 Oct 2014 20:10:43 -0700 (PDT) X-Received: by 10.66.118.201 with SMTP id ko9mr16916278pab.46.1414379443225; Sun, 26 Oct 2014 20:10:43 -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 sb2sm9410723pbc.24.2014.10.26.20.10.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Oct 2014 20:10:42 -0700 (PDT) From: Victor Kamensky To: gdb-patches@sourceware.org, Yao Qi Cc: Andrew Pinski , victor.kamensky@linaro.org Subject: [PATCH V4 1/3] ARM: extract_arm_insn function need to read instrs correctly in be8 case Date: Sun, 26 Oct 2014 20:10:32 -0700 Message-Id: <1414379434-5217-2-git-send-email-victor.kamensky@linaro.org> In-Reply-To: <1414379434-5217-1-git-send-email-victor.kamensky@linaro.org> References: <1414379434-5217-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::22a 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: 2014-10-21 Victor Kamensky * arm-tdep.c (extract_arm_insn): Use gdbarch_byte_order_for_code to read arm instruction. --- gdb/arm-tdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }