-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Msp430 fixes #62
Msp430 fixes #62
Conversation
- Use the correct number of registers. - Add support for CPUX variant (20-bit registers)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
After you remove the RegIdImpl
bits, we can get this merged in 👍
Then again, after taking a closer look, can you confirm that the RegId implementation is actually correct? If the |
Updated to used fixed MOVX #0x1,SP
MOVX #0x4,R4
MOVX #0x5,R5
MOVX #0x6,R6
MOVX #0x7,R7
MOVX #0x8,R8
MOVX #0x9,R9
MOVX #0xa,R10
MOVX #0xb,R11
MOVX #0xc,R12
MOVX #0xd,R13
MOVX #0xe,R14
MOVX #0xf,R15 GDB reports:
... That said, maybe it makes sense to just return |
Up to you ¯\_(ツ)_/¯ Feel free to switch it, or if you're happy as is, let me know and we can merge the PR in as-is. |
I think I'm going to go ahead and merge this PR as-is by EOD. |
Ah I was meaning to get back to this. It works fine for me as is so I happy for it to be merged. Only other thing I noticed is that the RISC-V implementation, where x0 is hardcoded to zero in hardware, is just treated the same as any other register. |
Would you mind popping open an issue to track that? That way I can address it at some point. Of course, a follow-up PR would also be more than welcome. In any case though, I'll go ahead and merge this PR 😄 |
Description
The previous MSP430 register definition in
gdbstub_arch
was missing a GPR.This PR adds the missing register as well as adding support for 20-bit MSP430 variant (CPUX) using the paramaterization strategy from the MIPS implementation, note that gdb treats the 20-bit registers as 32-bit registers internally.
I tested both the 16-bit variant and the 20-bit variant with my emulator, and things seemed to work. Backtraces seem to be broken but I don't think that is related gdbstub (The TI compiler was used to compile the binary I was testing, I think it could be an upstream GDB issue with the TI calling convention).
Technically this is breaking API change, however, since the previous implementation would have resulted in R15 being dropped, it seems unlikely it is being used.
Checklist
cargo build
compiles withouterrors
orwarnings
cargo clippy
runs withouterrors
orwarnings
cargo fmt
was runDebug output
Gdb output
Protocol output