-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
gdb: mips64
is an unknown architecture
#97
Comments
You may be using a GDB client that wasn't built with support for the particular MIPS platform you're interested in. Try installing Unfortunately, I can't offer much help aside from that, as the architecture implementations under And as a reminder: it's totally reasonable to forgo the implementations under |
I built I understand this is a community thing, I will probably make a PR later if nobody else fixes it. The MIPS implementation does work, I have been using it, it's just that you need to specify some stuff before connecting. Doesn't need to be fixed urgently, assuming the issue isnt with my version of GDB (will check the version later today) |
Sure, let me know what you find :) One thing to note is that the target.xml data in the This is different from something like, say, QEMU, which actually sends over a complete full-formed Now that I type this out, I realize that I never actually documented this property of the On that note, what are you connecting to in that |
I should have specified, it's the singlethread arm emulator example in this repo. It's worth noting, the AUR I built from was updated in 2022, and the |
Hmmm, interesting... @bet4it, you wouldn't have happened to work with In any case, see if you can figure out what XML incantations are required to have the GDB client properly detect the architecture. An easy way to play around with this without having to fork If you figure it out, I'd be happy to upstream it. EDIT: maybe the trick is to also include that |
I have GDB-multiarch
So I don't think that'll work |
Overriding to |
Also pinging @starfleetcadet75, in case he has any insights here (he's the one who upstreamed these arch impls back in the day) |
Did a quick search on GitHub, I think the only way to make it 64-bit is changing the registers as I mentioned earlier: They all seem to include definitions for all the registers |
This seems like an unfortunate oversight on GDB's part. If you're feeling particularly altruistic, consider filing a bug report upstream on the GDB bugzilla :) In any case, for our purposes, I think it'd be totally reasonable to update the FWIW, I think it actually makes sense to update all existing |
Oh, I only test
I think it's not necessary. People can override it if they want! We just provide a sample. I think the best way to solve this problem: find a Linux machine than run on |
I'd imagine the list I got from tab-completing on That's probably why it's not exposed very well, and is done via GDB commands ( |
Looking deeper, I found this: Edit:
When I modified the target XML to So I guess that's (kind of) a fix. Only problem is that we'd have to specify each particular CPU in the XML for each usecase, otherwise library users would be confused and it might lead to unexpected GDB side-effects. |
Indeed, the current As per the linked issue, I only recently discovered the As for the fix at hand - I have a sneaking suspicion that mips64 has always been busted, and that we ought to mark it for removal for now (via |
I don't know if a specific impl for 4300 is a good idea, because that would open the floodgates for all the MIPS variants (most of which have the same register names, etc) |
Yep, I'm well aware of that. That's just the reality of how the current You'll find that the same issue already exists in the context of ARM. Currently, there is a single implementation for ARMv4T (which is just aarch32), which means that someone wanting to support, say, ARMv5, would need a whole separate Even if you don't end up upstreaming this new arch, I'm glad you pointed out that mips64 is busted, since that's a bug and should be removed. Let me know if you'd like to push up a PR that deprecates |
Thanks to this amazing library, I've been able to set up debugging for my emulator.
There are a few errors that seem out of place (and don't happen on the ARM example provided) that have to do with
gdbstub_arch
's MIPS64 XML.Connecting through GDB normally (causes errors):
Connecting through GDB, setting
arch
(also causes errors):Connecting through GDB, setting
arch
andmips abi
Example for comparison (note I don't need to set anything to connect):
It seems there is no such architecture as
mips64
.Here are all the valid architectures that can be set in GDB:
As for how to make it recognized as 64 bit, I don't really know. The docs seem to suggest you'd need to set the width inside
org.gnu.gdb.mips.{cpu,cp1,fpu,dsp}
Some links that might help making a proper XML:
https://sourceware.org/gdb/onlinedocs/gdb/Target-Description-Format.html
https://sourceware.org/gdb/onlinedocs/gdb/MIPS-Features.html#MIPS-Features
The text was updated successfully, but these errors were encountered: