Re: Specifying target endianness via Remote Serial Protocol
Luis Machado via Gdb <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, On 4/12/20 9:02 AM, Omer via Gdb wrote: > Hi, > > While writing my own gdb stub, I noticed that there is no way to specify > what endianness the target is using (I guess the logical place for that > would be in the target.xml file). > One can use "set endian" manually to fix that, but when debugging an ARM > BE8 target, there is no way to specify that the code is little endian > (currently byte_order_for_code is initialized to little only when loading a > BE8 elf). > Shouldn't there be an additional field for target XML tag to specify that? We could probably extend the XML descriptions to incorporate this, but we may also have backwards compatibility issues with older GDB's by returning new fields the target doesn't know how to parse properly. The way to fix this, right now, would be to teach GDB about other arch variations using little endian, so GDB initializes the proper set of architecture hooks and types. What arch variation are you working with? Doesn't the tools generate a EF_ARM_BE8 flag to let GDB know it needs to assume little endian?