-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[RISC-V] Implement emulate single step feature. #94711
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
Conversation
Error message /home/clamp/runtime/src/coreclr/debug/inc/riscv64/primitives.h:52:5: error: integer value -1 is outside the valid range of values [0, 255] for this enumeration type [-Wenum-constexpr-conversion] (CorDebugRegister)(-1), // X0 is zero register that is not a real register. We need padding here for proper mapping with ICorDebugInfo::RegNum. ^
// 21 | 20 1 | 0 | ||
// inst[31]/sign | inst[19:12] | inst[20] | inst[30:25] | inst[24:21] | 0 | ||
uint64_t imm = SignExtend((BitExtract(opcode, 30, 21) << 1) | (BitExtract(opcode, 20, 20) << 11) | | ||
(BitExtract(opcode, 19, 12) << 12) | (BitExtract(opcode, 31, 31) << 20), 21); |
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.
I think sign bit (inst[31] << 20) in inst is checked in SignExtend with (1ull << 20) not 21. Could you check it is correct?
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! I miss count bits when write comments and just set wrong sign bit even didn't looked at real sign bit that I moved properly -_- , should be
// 20 | 19 1 | 0
// inst[31]/sign | inst[19:12] | inst[20] | inst[30:25] | inst[24:21] | 0
will fix here and other lines too.
// 13 | 12 1 | 0 | ||
// inst[31]/sign | inst[7] | inst[30:25] | inst[11:8] | 0 | ||
uint64_t imm = SignExtend((BitExtract(opcode, 11, 8) << 1) | (BitExtract(opcode, 30, 25) << 5) | | ||
(BitExtract(opcode, 7, 7) << 11) | (BitExtract(opcode, 31, 31) << 12), 13); |
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.
Please check too.
// 13 | 12 1 | 0 | ||
// inst[31]/sign | inst[7] | inst[30:25] | inst[11:8] | 0 | ||
uint64_t imm = SignExtend((BitExtract(opcode, 11, 8) << 1) | (BitExtract(opcode, 30, 25) << 5) | | ||
(BitExtract(opcode, 7, 7) << 11) | (BitExtract(opcode, 31, 31) << 12), 13); |
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.
Please check this too.
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
@jkotas can you please add @viewizard to .net org? |
Why is it needed? |
He's also responsible for Tizen, specifically for debugging stuff. I though that I already added him to tizen area owners, but it was not the case, so here's a PR: #94778. |
I meant - are there extra github permissions that you expect to get from dotnet org membership? What are members allowed to do that non-members cannot? |
Nothing extra. If it's the same as for non-members, then there's probably no need to add new people. |
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.
LGTM
With this changes managed debugger (tested with netcoredbg) can continue execution after break on managed breakpoint.
Note,
RiscV64SingleStepper
code is close toArm64SingleStepper
code except arch-related methods likeTryEmulate()
,GetReg()
,SetReg()
.CC @clamp03 @wscho77 @HJLeee @JongHeonChoi @t-mustafin @gbalykov @brucehoult