From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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) From: Jon Wilson 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-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 30 May 2022 23:03:36 -0000 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