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: Victor Kamensky X-Patchwork-Id: 3315 Received: (qmail 30247 invoked by alias); 22 Oct 2014 05:26:42 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk 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 Authentication-Results: sourceware.org; auth=none 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z0dW5OHmzykQcajEaQx+j0HHhTzTqbYzbJUACnYch28=; b=IkqeMtA2bQWAcF+oQy8jO4YAFHjTFCaOGx3ojqWNpvQ3IyAKYysG77Te3mW4zsp4Xu 9j2QaWdGtK1dLjrkNSCSEAs0QFRoAzKhY+/FIwQrbkbijmgf9g+da9tTr9ZdqGMDlxtk 8xdBuiQhsPNCb4pVSCoXH+iw04ct9Q1vsfIywuQeaANIvT9WY48NL7KA6IDuESDni/nL WHwqpMXUz0a8gUle2HO2YH+6f7p/OkNBTjgqw9UMPjzbKLITmzMGrBkKUNF/+4oetC6n 5mdE6WjM9fZGiWiANIymy8egG2r+NPb0cfmMlEWRQQGPHe/tYuBNG8elzDPx1FX+NDCf bsHg== X-Gm-Message-State: ALoCoQlCPrCcel/biSGOG0BturB3TU/RuUnKXk4wtcAF+cw8cqB1kruvpEqLEvNsKMONV15z9Qey 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> 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; }