From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by sourceware.org (Postfix) with ESMTPS id 15193395A00D for ; Tue, 31 May 2022 14:38:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 15193395A00D Received: by mail-io1-xd29.google.com with SMTP id 2so14307842iou.5 for ; Tue, 31 May 2022 07:38:31 -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 :subject:references:to:in-reply-to:content-transfer-encoding; bh=5HRbPeq2JlL3QFAh8rOhbsby6OxadQmJcQDr2EOJyGU=; b=TAaj1abkCF5NvilRoLaHFAQL4BJqlcTSoOz3tGzLkQhaJgmqia23ClGrS8ECeOmP7q NJzxNjUqzmcAK39u7tFDH11iFGdv5NdJ2aJ3R1pjxpDPVrUdhoBLTPn2UmT/Xc6p8Sch qbK6x6o0Z2bH01FPH/elgXVAiFT3jz8HCJ5wq7e9abj92zBhdV32qyxvX3C0bXLgWXE3 mVkWYF5Y1wj3A9zTH9Vz5nVXRv7ckkmvipFpouBXotf+5b6GJNMrIm9fwE0kKjhaXWxy IVBURr+iedL5OjnIxbKBJrAjAg+rFYCZnbcYWMl2Iw34pkV6q9/KXISKMM+Jm9tbBlbk 9PtQ== X-Gm-Message-State: AOAM531/OUpQTxnfUIvTSZvah37gHHRGZ5J1M+U5B3CQh5ZnT36ApjYy vb5NeUnVaGycZknFWZj4EzXWKDUquoD6Eg== X-Google-Smtp-Source: ABdhPJwcaW2YenMsVMQbl3p9XxtJeJj3JdHfDqjZ0YM+Yn0TeBVQyq1YIe7gg4dADR7WICzL3IB4rQ== X-Received: by 2002:a05:6638:3387:b0:32e:c781:6e3c with SMTP id h7-20020a056638338700b0032ec7816e3cmr21890473jav.55.1654007910168; Tue, 31 May 2022 07:38:30 -0700 (PDT) Received: from [172.24.0.145] ([207.96.162.190]) by smtp.gmail.com with ESMTPSA id m12-20020a0566380dcc00b0032e5e0f1bd5sm3541075jaj.164.2022.05.31.07.38.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 May 2022 07:38:29 -0700 (PDT) From: Jon Wilson X-Google-Original-From: Jon Wilson Message-ID: Date: Tue, 31 May 2022 10:38:28 -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 Subject: Fwd: GDB Stub with ARM BE8 target. References: To: gdb@sourceware.org In-Reply-To: X-Forwarded-Message-Id: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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: Tue, 31 May 2022 14:38:32 -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