From patchwork Wed Oct 22 05:26:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 39243 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4FA05202DB for ; Wed, 22 Oct 2014 05:27:03 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id d49sf1176766eek.3 for ; Tue, 21 Oct 2014 22:27: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=AdpdJlmAGmdBeGYCzvZRgTsV79AFnn7+9dJOcG9te28=; b=OAk+N6Z5UkFxD/8GH5bOyttrFxzF+GBZ1KkHurHE3mdv4YdytprQkQ/Xxew5PfKGTe IE/5HC+gA4B1uv0Zo/ya/xqRcJAeziwJoB+SSkXzO1bOKFxHzMLX6LzW09horkG5Jn1N KH7pp0v7IFDDywsPGGyGdrdG3/x2v14MR5uVEVCP09Wv1AqT5i7b/RGujQUSXPFA65VO ++XVLkGc5huEysAk1QY2eSaVe6soWon6FfTGRrSkIQa2+u1CK/jHGac53ydF20ztUWyO 125LcR26G1OUW9VzE4yCeVruh7+I+bXSGI1JkV6OjIJLTqnjohorg9YIl33b8rE8ZZsC IKxw== X-Gm-Message-State: ALoCoQlyTfXoAq0/1ibr9gGoYTBu5t3KjkyfZvbhmjfwC5WSeUSFVXwjUwahhwoTDCcO0OhWCK9Y X-Received: by 10.180.72.141 with SMTP id d13mr4416477wiv.6.1413955622480; Tue, 21 Oct 2014 22:27:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.131 with SMTP id w3ls160402lad.79.gmail; Tue, 21 Oct 2014 22:27:02 -0700 (PDT) X-Received: by 10.112.26.71 with SMTP id j7mr446960lbg.96.1413955622330; Tue, 21 Oct 2014 22:27:02 -0700 (PDT) Received: from mail-lb0-x22c.google.com (mail-lb0-x22c.google.com. [2a00:1450:4010:c04::22c]) by mx.google.com with ESMTPS id az19si17321195lab.0.2014.10.21.22.27.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 22:27:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22c as permitted sender) client-ip=2a00:1450:4010:c04::22c; Received: by mail-lb0-f172.google.com with SMTP id b6so2198623lbj.3 for ; Tue, 21 Oct 2014 22:27:01 -0700 (PDT) X-Received: by 10.112.130.41 with SMTP id ob9mr38546936lbb.74.1413955621902; Tue, 21 Oct 2014 22:27: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 c5csp14048lbz; Tue, 21 Oct 2014 22:27:01 -0700 (PDT) X-Received: by 10.70.134.197 with SMTP id pm5mr39964075pdb.90.1413955620390; Tue, 21 Oct 2014 22:27:00 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id ix4si13181552pac.198.2014.10.21.22.26.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Oct 2014 22:27:00 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-return-116884-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 30544 invoked by alias); 22 Oct 2014 05:26:44 -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 30403 invoked by uid 89); 22 Oct 2014 05:26:42 -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:42 +0000 Received: by mail-pd0-f171.google.com with SMTP id ft15so2820038pdb.2 for ; Tue, 21 Oct 2014 22:26:40 -0700 (PDT) X-Received: by 10.70.10.33 with SMTP id f1mr40136541pdb.1.1413955600418; Tue, 21 Oct 2014 22:26:40 -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.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Oct 2014 22:26:39 -0700 (PDT) From: Victor Kamensky To: gdb-patches@sourceware.org, Yao Qi Cc: Andrew Pinski , victor.kamensky@linaro.org Subject: [PATCH V2 2/4] ARM: arm_breakpoint should be little endian form in case for arm BE8 Date: Tue, 21 Oct 2014 22:26:27 -0700 Message-Id: <1413955589-5054-3-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::22c 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-10-21 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;