From patchwork Wed Oct 22 05:26:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 39242 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 42138202DB for ; Wed, 22 Oct 2014 05:26:57 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id fb4sf178746wid.4 for ; Tue, 21 Oct 2014 22:26:56 -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=J/wsCr8dtsbkyOMcf0qenz5+I4p0cexcdsMweMASaLPrMPRtgrZNxxMLuS1oSYOTLC Aa+cjTlXkOF5di+A0wjEVP+UBLZMCmD1s2yH+5ISkbxl5kmPixI8dCGJDLCS5ED88nGj KNgPLNssgsfs74Oi6Wc0pU+EAzhbS692iMEvAUkOncNBTyI6yB6BEo5hdLZyqTTb6/Vj 6sJhuHK4K+r7nEn/zpXhYbjxcij/fz/pynRRDdKfS51Ly/s/tCWxNm8tnpmC5xFotxRx /DA/gjPR/UVAZ+Fk0eXz0lkEVWyg+D7PyNP5WgdYNz3pqfGP35t/snlCY4FkE0z2ZFG3 9XRA== X-Gm-Message-State: ALoCoQlDSPk3d4ysKpjZH2+Erb8mSLapiaZFtwi/GXaCyEEBUW5TbloB2KYItGG+xJul2GNrj23W X-Received: by 10.180.72.141 with SMTP id d13mr4416395wiv.6.1413955616480; Tue, 21 Oct 2014 22:26:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.41 with SMTP id s9ls149721lae.41.gmail; Tue, 21 Oct 2014 22:26:56 -0700 (PDT) X-Received: by 10.153.7.170 with SMTP id dd10mr39483521lad.45.1413955616205; Tue, 21 Oct 2014 22:26:56 -0700 (PDT) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com. [2a00:1450:4010:c04::229]) by mx.google.com with ESMTPS id b6si21776897lbv.138.2014.10.21.22.26.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 22:26:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::229 as permitted sender) client-ip=2a00:1450:4010:c04::229; Received: by mail-lb0-f169.google.com with SMTP id 10so2226064lbg.28 for ; Tue, 21 Oct 2014 22:26:55 -0700 (PDT) X-Received: by 10.112.167.38 with SMTP id zl6mr39168317lbb.34.1413955615865; Tue, 21 Oct 2014 22:26:55 -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 c5csp14042lbz; Tue, 21 Oct 2014 22:26:55 -0700 (PDT) X-Received: by 10.69.31.1 with SMTP id ki1mr88594pbd.156.1413955614307; Tue, 21 Oct 2014 22:26:54 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id of4si13247979pbc.79.2014.10.21.22.26.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Oct 2014 22:26:54 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-return-116883-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 30247 invoked by alias); 22 Oct 2014 05:26:42 -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 30226 invoked by uid 89); 22 Oct 2014 05:26:41 -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; Wed, 22 Oct 2014 05:26:41 +0000 Received: by mail-pd0-f171.google.com with SMTP id ft15so2817162pdb.30 for ; Tue, 21 Oct 2014 22:26:39 -0700 (PDT) X-Received: by 10.70.45.110 with SMTP id l14mr85561pdm.157.1413955599285; Tue, 21 Oct 2014 22:26:39 -0700 (PDT) Received: from kamensky-w530.hsd1.ca.comcast.net ([24.6.79.41]) by mx.google.com with ESMTPSA id i16sm13364690pdk.66.2014.10.21.22.26.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Oct 2014 22:26:38 -0700 (PDT) From: Victor Kamensky To: gdb-patches@sourceware.org, Yao Qi Cc: Andrew Pinski , victor.kamensky@linaro.org Subject: [PATCH V2 1/4] ARM: extract_arm_insn function need to read instrs correctly in be8 case Date: Tue, 21 Oct 2014 22:26:26 -0700 Message-Id: <1413955589-5054-2-git-send-email-victor.kamensky@linaro.org> In-Reply-To: <1413955589-5054-1-git-send-email-victor.kamensky@linaro.org> References: <1413955589-5054-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::229 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; }