From patchwork Sun Nov 2 21:41:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 39993 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 79AF42405B for ; Sun, 2 Nov 2014 21:42:03 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id q1sf5608627lam.8 for ; Sun, 02 Nov 2014 13:42:02 -0800 (PST) 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=JxtmGbybKLO2037gLFKE1IJoS4unzCe/Tb2zrlExzTQ=; b=QVuTX0AEr6epouBEgxEI20EegHfO4UCTl+NnZU9JHQhwT/ZG8O8dPYk/vgYWmvxL4D k0p9umk0A+FbGY3aBEp9I0IHKS9hSgK4s9Q9ml/oRKYpPH03+Gyvmm3uVaZPUU/+sH0c 78gBGDkeORpyCEfRtyTUu3FPJzDNVRiyevwYKrqrBha1J6bslyAuVMDGbFw1unU5hLLi 7ewXqNxxquVGZgru/7WoftWqRIQwnmGYW3y22QOqhCj5HQl30/pm9aHg9MwC3j+ORR2H ssYegswDVA8IHxwZoZK6KpnonQmG8V1rZdm0DuL/Med9J5479pWBhNTR8zLaa+oUVSp6 Kvjg== X-Gm-Message-State: ALoCoQnfngWCmlC8UURMijQWcWyWFRG8qdYErtNyVNtceeq2NJptYu12htS1XxiESMm+vhDXZq8y X-Received: by 10.152.3.168 with SMTP id d8mr6478182lad.0.1414964522038; Sun, 02 Nov 2014 13:42:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.33 with SMTP id cb1ls731718lad.89.gmail; Sun, 02 Nov 2014 13:42:01 -0800 (PST) X-Received: by 10.152.87.18 with SMTP id t18mr41834550laz.0.1414964521677; Sun, 02 Nov 2014 13:42:01 -0800 (PST) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com. [2a00:1450:4010:c03::231]) by mx.google.com with ESMTPS id ms6si29797700lbb.19.2014.11.02.13.42.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Nov 2014 13:42:01 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::231 as permitted sender) client-ip=2a00:1450:4010:c03::231; Received: by mail-la0-f49.google.com with SMTP id ge10so8466615lab.22 for ; Sun, 02 Nov 2014 13:42:01 -0800 (PST) X-Received: by 10.152.29.8 with SMTP id f8mr46058990lah.56.1414964521090; Sun, 02 Nov 2014 13:42:01 -0800 (PST) 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 c5csp162517lbz; Sun, 2 Nov 2014 13:42:00 -0800 (PST) X-Received: by 10.70.46.137 with SMTP id v9mr39653891pdm.78.1414964519512; Sun, 02 Nov 2014 13:41:59 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id d7si13963104pds.56.2014.11.02.13.41.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Nov 2014 13:41:59 -0800 (PST) Received-SPF: pass (google.com: domain of gdb-patches-return-117239-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 3758 invoked by alias); 2 Nov 2014 21:41:48 -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 3739 invoked by uid 89); 2 Nov 2014 21:41:47 -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-pa0-f42.google.com Received: from mail-pa0-f42.google.com (HELO mail-pa0-f42.google.com) (209.85.220.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 02 Nov 2014 21:41:46 +0000 Received: by mail-pa0-f42.google.com with SMTP id bj1so11015191pad.1 for ; Sun, 02 Nov 2014 13:41:44 -0800 (PST) X-Received: by 10.70.127.199 with SMTP id ni7mr39882812pdb.39.1414964504768; Sun, 02 Nov 2014 13:41:44 -0800 (PST) Received: from kamensky-w530.hsd1.ca.comcast.net ([24.6.79.41]) by mx.google.com with ESMTPSA id ej7sm7913403pdb.88.2014.11.02.13.41.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Nov 2014 13:41:44 -0800 (PST) From: Victor Kamensky To: gdb-patches@sourceware.org Cc: Yao Qi , Victor Kamensky Subject: [COMMITTED PATCH 2/3] ARM: arm_breakpoint should be little endian form in case for arm BE8 Date: Sun, 2 Nov 2014 13:41:23 -0800 Message-Id: <1414964484-6270-2-git-send-email-victor.kamensky@linaro.org> In-Reply-To: <1414964484-6270-1-git-send-email-victor.kamensky@linaro.org> References: <1414964484-6270-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::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 tdep->arm_breakpoint, tdep->thumb_breakpoint, tdep->thumb2_breakpoint should be set le_ variants in case of arm BE8 code. Those instruciton sequences are writen to target with simple write_memory, without regarding gdbarch_byte_order_for_code. But in BE8 case even data memory is in big endian form, instructions are still in little endian form. Because of this issue there are many issues while running gdb test case in armv7b mode. For example gdb.arch/arm-disp-step.exp test fails because it gets SIGILL when displaced instrucion sequence reaches break instruction, which is in wrong byte order. Solution is to set tdep->xxx_breakpoint sequences in BE8 case (i.e when gdbarch_byte_order_for_code is BFD_ENDIAN_BIG. gdb/ChangeLog: 2014-11-02 Victor Kamensky * arm-linux-tdep.c (arm_linux_init_abi): Use info.byte_order_for_code to choose endianity of breakpoint instructions snippets. --- gdb/arm-linux-tdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index e3587f3..2e79658 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -1361,7 +1361,7 @@ arm_linux_init_abi (struct gdbarch_info info, linux_init_abi (info, gdbarch); tdep->lowest_pc = 0x8000; - if (info.byte_order == BFD_ENDIAN_BIG) + if (info.byte_order_for_code == BFD_ENDIAN_BIG) { if (tdep->arm_abi == ARM_ABI_AAPCS) tdep->arm_breakpoint = eabi_linux_arm_be_breakpoint;