Detailed description
The ArmV8m does not handle faults the same way. The two main differences are :
- The fault will trigger BEFORE executing the fault rather than after
- The info is split between between DFSR and the new ICSR
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
<!-- Filling this template is mandatory -->
## Detailed description
The ArmV8m does not handle faults the same way. The two main differences are :
- The fault will trigger BEFORE executing the fault rather than after
- The info is split between between DFSR and the new ICSR
-
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
* [x] I've read the [Code of Conduct](https://github.com/blackmagic-debug/blackmagic/blob/main/CODE_OF_CONDUCT.md)
* [x] I've read the [guidelines for contributing](https://github.com/blackmagic-debug/blackmagic/blob/main/CONTRIBUTING.md) to this repository
* [x] It builds for hardware native (see [Building the firmware](https://github.com/blackmagic-debug/blackmagic?tab=readme-ov-file#building-black-magic-debug-firmware))
* [x] It builds as BMDA (see [Building the BMDA](https://github.com/blackmagic-debug/blackmagic?tab=readme-ov-file#building-black-magic-debug-app))
* [x] I've tested it to the best of my ability
* [x] My commit messages provide a useful short description of what the commits do
## Closing issues
N/A