From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UaqfJGJNlWItVgkAWB0awg (envelope-from ) for ; Mon, 30 May 2022 19:04:02 -0400 Received: by simark.ca (Postfix, from userid 112) id 7E9971E221; Mon, 30 May 2022 19:04:02 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=PybyMkyt; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_REPLYTO_END_DIGIT,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id EA6C51E01D for ; Mon, 30 May 2022 19:04:01 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6AC36387085B for ; Mon, 30 May 2022 23:04:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6AC36387085B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1653951841; bh=5HRbPeq2JlL3QFAh8rOhbsby6OxadQmJcQDr2EOJyGU=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=PybyMkytY7WNmWPNitPZbh96VGVD9Hl4ATwrbwFDKirlb0H32DqhUkni8kNm+2j7c AJQn45CLVgBVDcrv0KQf/EsW9JQ399qztuhSHLJCgKOvoHIvWhyifnPFbQzQ71E3B2 m23TH5+7XtYhtRu839vEVryPJL6X6XwArkz6NP1Q= Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by sourceware.org (Postfix) with ESMTPS id 437603850427 for ; Mon, 30 May 2022 23:03:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 437603850427 Received: by mail-qt1-x834.google.com with SMTP id ew15so1498627qtb.2 for ; Mon, 30 May 2022 16:03:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:date:mime-version:user-agent:to :subject:content-transfer-encoding; bh=5HRbPeq2JlL3QFAh8rOhbsby6OxadQmJcQDr2EOJyGU=; b=7M6Twq0T45DwzHfLFfRwu3OsDxl2P7OmVbYLxoOUYzzqY8vVhdlJuQmhAbK1jRlj36 G/3KQeHLxCFwUilYtixH02llHSv9Ayb9ebC85zl9oCN37E70braj5gFlGwk6xuI5Tob6 KOxI+OiEBW0oSHqqhZ0yitL7FAxS2MLc4tv3aOswhQQErGiY5Wn11iVif9WXpGegEmAO cXv/eKcXQ3krAuFg2k5izKCjKJTgH5K+IEdtrymi7nspHoOoaMJHyd+iGCKOLvbXzPQy XTlNu52/+ozB8BhCyMbhmqNs/I+tm1BG12QnutWYhA22jVSXe8dvIubLaenVJYmRpzXL AD8g== X-Gm-Message-State: AOAM531HJBD5ydb9oi+isJtqVmKjbAwnyq5rTmgZfG1p/G8gp5dBUZdA e1q3r1AXYZCU33dxOnmyWqKaI+xkTqDWyg== X-Google-Smtp-Source: ABdhPJxXrvachn0ITczPvD1q5Yz5l0As+MBKeuFTPPf94qLxchwaxFuyGVXMXW0mTqmPOxpwHVIJfA== X-Received: by 2002:ac8:7d4c:0:b0:304:b7af:4580 with SMTP id h12-20020ac87d4c000000b00304b7af4580mr2092267qtb.325.1653951814410; Mon, 30 May 2022 16:03:34 -0700 (PDT) Received: from [192.168.16.247] ([216.46.30.35]) by smtp.gmail.com with ESMTPSA id 5-20020a05620a06c500b0069fc13ce1e8sm8289141qky.25.2022.05.30.16.03.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 May 2022 16:03:34 -0700 (PDT) X-Google-Original-From: Jon Wilson Message-ID: Date: Mon, 30 May 2022 19:03:32 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 To: gdb@sourceware.org Subject: GDB Stub with ARM BE8 target. Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jon Wilson via Gdb Reply-To: Jon Wilson Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" I am trying to integrate a GDB stub with a ARM BE8 target. However, it would appear that using "set endian big" defaults to BE32 architecture. I cannot seem to find a way to have the debugger interpret memory according to the BE8 architecture. The only support for BE8 mode I can see seems to be for when using BE8 core dumps or processes (https://github.com/bminor/binutils-gdb/blob/9606310bbbf8a2d529b5c2aa71cac48a46f65869/gdb/arm-tdep.c#L9781). I can't seem to find any documentation on the topic (which is pretty forgivable given how niche it is). I looked at handling the endianness in the stub itself (e.g. inverting the endianness of memory based on permissions), but given the code stream can contain both instructions (which should be little endian in BE8) as well as data (which should be interpretted as big endian), this is not possible. Have I missed an option somewhere? If this support is missing, then how should it be added? Should it be handled in a similar way to how GDB handles ARM versus Thumb mode? (https://github.com/bminor/binutils-gdb/blob/9606310bbbf8a2d529b5c2aa71cac48a46f65869/gdb/arm-tdep.c#L10589)? I'd be very grateful for any advice. Kind Regards. Jon