-
Notifications
You must be signed in to change notification settings - Fork 2
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
Partially fix info frame
for purecap RISC-V
#41
base: mips_cheri-8.3
Are you sure you want to change the base?
Partially fix info frame
for purecap RISC-V
#41
Conversation
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 would probably split these into separate commits? What cares about the reggroup for cap registers I wonder?
I don't remember exactly why the first diff is needed, but after fixing the frame bits
|
Previously it would print: ``` (gdb) info fram Stack level 5, frame at 0x3fffdfb770: pcc = 0x42294b32 in QV4::Scoped<QV4::Object>::Scoped(QV4::Scope const&, QV4::Value const*); saved pcc = 0x4229b4c4 called by frame at 0x3fffdfb990, caller of frame at 0x3fffdfb6f0 Arglist at 0x3fffdfb770, args: Locals at 0x3fffdfb770,That operation is not available on integers of more than 8 bytes. ``` by using `extract_typed_address`, I get the following: ``` (gdb) info frame Stack level 5, frame at 0x3fffdfb770: pcc = 0x42294b32 in QV4::Scoped<QV4::Object>::Scoped(QV4::Scope const&, QV4::Value const*); saved pcc = 0x4229b4c4 called by frame at 0x3fffdfb990, caller of frame at 0x3fffdfb6f0 Arglist at 0x3fffdfb770, args: Locals at 0x3fffdfb770, Previous frame's sp is 0x3fffdfb770 Saved registers: cra at 0x3fffdfb760, cfp at 0x3fffdfb750, pcc at 0x3fffdfb760 ```
This ends up being called by `info frame` after the last commit and triggers an assertion inside riscv_is_regnum_a_named_csr().
821a241
to
0d14866
Compare
@@ -985,6 +985,8 @@ riscv_register_reggroup_p (struct gdbarch *gdbarch, int regnum, | |||
{ | |||
if (regnum < RISCV_FIRST_CSR_REGNUM || regnum == RISCV_PRIV_REGNUM) | |||
return 1; | |||
if (regnum >= RISCV_FIRST_CHERI_REGNUM && regnum <= RISCV_LAST_CHERI_REGNUM) |
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 do wonder if the better fix is actually for the first 'if' here to be:
if (regnum < RISCV_FIRST_CSR_REGNUM || regnum > RISCV_LAST_CSR_REGNUM)
return 1;
That is something I could upstream, or perhaps even:
if (regnum >= RISCV_FIRST_CSR_REGNUM && regnum <= RISCV_LAST_CSR_REGNUM)
return riscv_is_regnum_a_named_csr (regnum);
return 1;
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.
This function is quite different upstream, so you can fix this however for now. Your existing patch is fine.
Previously it would print:
by using
extract_typed_address
, I get the following: