Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore + Document how to work with Big-Endian (and Bi-Endian) Targets #26

Open
daniel5151 opened this issue Sep 4, 2020 · 2 comments
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@daniel5151
Copy link
Owner

daniel5151 commented Sep 4, 2020

#25 (which added support for 32-bit PowerPC architectures) raised some interesting questions regarding how gdbstub should handle big-endian and bi-endian targets.

Namely, should the Registers::gdb_de/serialize methods be configurable based on the target's current endianness? i.e: plumb through some sort of Target API which queries the endianess of the target, and switches between to/from_be_bytes and to/from_le_bytes appropriated?

Unfortunately, this isn't something I can easily test, since I don't have any bi-endian or big-endian targets to play with...
As such, I'm marking this issue as "help wanted," so that hopefully someone who does have experience with bi-endian systems could clarify the situation.

@daniel5151 daniel5151 added the help wanted Extra attention is needed label Sep 4, 2020
@jamcleod
Copy link
Contributor

jamcleod commented Sep 4, 2020

When you say "bi-endian" are you referring to runtime-configurable byteorder (as I would interpret it) or fixed-endian systems which can be either ordering? As I feel like each of those would warrant different solutions.

@daniel5151
Copy link
Owner Author

From the wikipedia article on Endianness:

Note that the term "bi-endian" refers primarily to how a processor treats data accesses. Instruction accesses (fetches of instruction words) on a given processor may still assume a fixed endianness, even if data accesses are fully bi-endian, though this is not always the case, such as on Intel's IA-64-based Itanium CPU, which allows both.

This seems to imply that "bi-endian" is an umbrella term which encapsulates both the cases you mentioned?

Just to reiterate though, as someone who don't have any hands-on experience working with bi-endian and big-endian systems, I'm not at all sure what the best approach would be in this case (hence the "help wanted" tag on the issue).

@daniel5151 daniel5151 added the documentation Improvements or additions to documentation label Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants