armv8m: make the debugger handle better faults through ICSR#2187
Conversation
dragonmux
left a comment
There was a problem hiding this comment.
Got a few notes on going through this PR - with them fixed though we'll be happy to merge this.
|
I'll update the MR this weekend |
|
I think i got all the remarks as a separate commit for easy review |
dragonmux
left a comment
There was a problem hiding this comment.
This is looking better - there is one small note we have and once that's been addressed, we'll approve and merge this.
805d315 to
46e86b9
Compare
|
This time i think it's correct. I've squashed it as the last change was really small & easy to check. |
|
It would technically be |
dragonmux
left a comment
There was a problem hiding this comment.
LGTM. Thank you for the contribution!
We'll do some cleanup after in a follow-up PR we have to do anyway (comment style, if with assign to true into straight truthy assignment) but this looks all functional which is the important part.
46e86b9 to
141b476
Compare
Detailed description
The ArmV8m does not handle faults the same way. The two main differences are :
As a result the current code does not handle fault very well.
Put a breakpoint on a fault (for example asm("udf #0") and try to "si" on it.
Gdb will appear to get stuck there because the debugger will see the state BEFORE the fault is actually executed and as a result not detect the fault.
The MR adds a separate path that , for ArmV8M, it checks if a fault is pending on ICSR
The "si" command on a fault now works and you proceed on to the handler.
I tested it on a RP2350 and on another CortexM33 successfully.
I'm not convinced all cases are covered as some parts are configurable, but at least it's working better.
Not sure either if the new two new registers should be renamed with V8M in the name or something.
Your checklist for this pull request
Closing issues
N/A