From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55872 invoked by alias); 19 Nov 2015 18:12:32 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 55860 invoked by uid 89); 19 Nov 2015 18:12:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.6 required=5.0 tests=AWL,BAYES_20,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f182.google.com Received: from mail-ig0-f182.google.com (HELO mail-ig0-f182.google.com) (209.85.213.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 19 Nov 2015 18:12:30 +0000 Received: by igl9 with SMTP id 9so130523935igl.0 for ; Thu, 19 Nov 2015 10:12:28 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.51.17.35 with SMTP id gb3mr1365268igd.88.1447956748310; Thu, 19 Nov 2015 10:12:28 -0800 (PST) Received: by 10.79.102.196 with HTTP; Thu, 19 Nov 2015 10:12:28 -0800 (PST) Date: Thu, 19 Nov 2015 18:12:00 -0000 Message-ID: Subject: ARM BE8 support is broken From: toemoss garcia To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-11/txt/msg00029.txt.bz2 Hi gdb-experts, I've been having quite a headache working with GDB on a (proprietary) mixed-endian processor that is built around a ARM cortexm3 using arm's BE8 big endian variant. If you don't know, BE8 architecture treats instructions as little endian and data as big endian. The additional wrinkle is that anything in the system control memory space (0xE000E000-0xE000F000) and the external private peripheral bus (0xE0000000-0xE00FFFFF) is *also* treated as little endian [1]. At least for the cortex-m. There has been *some* support added for BE8 in GDB, but as far as I can tell, all the patches do is treat everything as BE and manually swap instructions to LE (see [2] for the patch submission). This only seems to effect doing a ``load`` or when reading a memory address as an instruction. There doesn't seem to be any actual support for correctly reading/writing memory based on the region of memory space. IOW, the only thing you can do reliably for BE8 is load a program to the core (this seems to always work correctly for BE8 images). Is there anything in the works/any interest in getting this kind of support added? Does anybody have experience using BE8 with GDB? How did you "solve" this? [1] The definitive guide to the ARM Cortex-M3 Page 97 (section 5.8) on this version: https://www.google.com/url?sa=3Dt&rct=3Dj&q=3D&esrc=3Ds&source=3Dweb&cd= =3D1&ved=3D0CB4QFjAAahUKEwiLyoqo85zJAhVFGz4KHbl9Czc&url=3Dhttp%3A%2F%2Fwww.= eecs.umich.edu%2Fcourses%2Feecs373%2FlabsW14%2Frefs%2FM3%2520Guide.pdf&usg= =3DAFQjCNHjnoQZ3Bcn-4DXFQ04gffVMs-g0A&sig2=3DP34NEAewY9kHxo53v8IO1g [2] Subject: [RFA] ARM BE8 support https://sourceware.org/ml/gdb-patches/2008-08/msg00052.html