> On 26 Jul 2023, at 07:43, Christopher Head <open...@chead.ca> wrote:
> 
> ... I am strongly opposed to
> this being mandatory behaviour. It would break the use case of
> compiling BKPT instructions into the binary for non-semihosting
> purposes, because such halts would not match any FPB resource.

Ah, sorry for not being more explicit, the proposal covers only rogue 
breakpoints, it does not cover compiled BKPT instructions, since these are 
legit breakpoints.

> I use
> that capability regularly as a way to debug halt on certain error
> conditions detected by the code, without spending FPB resources to do
> so.

I also use this, with DEBUG defined, my code halts with BKPT(0) whenever any 
asserts trigger.

---

BTW, the behaviour of OpenOCD when encountering BKPT instructions is debatable.

If OpenOCD is in a debug session, execution should indeed halt, as it does now, 
but when running in standalone mode, (for example with no connection on the gdb 
port), a more accurate behaviour would be to trigger an exception, as defined 
by the architecture when not in debug state (for example DebugMon_Handler for 
ARMv7M).


Liviu





Reply via email to