This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

About Exception Handler Return Address

hello 

I am trying to implement breakpoint operation in source code using cortex-R5F.
There are some problems during implementation.
I enabled MDBGEN in the DBGSCRext register.
The execution address was put into the DBGBVR register and 0x1E7 was put into BCR0.
The desired preFetch Exception occurred.
However, when the debugger is plugged in, it stops right before executing the preFetch Exception in vectortable.
I do not know the reason.
When I unplug the debugger, it appears to be running well on preFetch Exception.
Second, when riding an Exception, the return address is a vector table.
There is no address value anywhere in the stack to move to the BP-blocked address.
When the IFAR register value is read from the Exception Handler, the preFetch execution address is captured in the vectorable.
 
Parents
  • However, when the debugger is plugged in, it stops right before executing the preFetch Exception in vectortable.

    My knowledge of Armv7-R debug is more than a little rusty, but I I think the problem is that you're effectively trying to use an external debugger to debug a self-hosted debugger.

    Let's assume you're using a BKPT instruction to implement the breakpoint.  When Halting debug-mode is NOT enabled, this instruction generates an exception (Prefetch abort) which can be handled by software - the self-hosted debugger.  Once Halting debug-mode IS enabled, BKPT causes entry into Debug state.  Connecting the external debugger will likely (depends on the debugger) have caused Halting debug-mode to be enabled.  Again depending on the debugger, the debugger might not be able to tell the breakpoint that caused it to stop wasn't one it had set.

Reply
  • However, when the debugger is plugged in, it stops right before executing the preFetch Exception in vectortable.

    My knowledge of Armv7-R debug is more than a little rusty, but I I think the problem is that you're effectively trying to use an external debugger to debug a self-hosted debugger.

    Let's assume you're using a BKPT instruction to implement the breakpoint.  When Halting debug-mode is NOT enabled, this instruction generates an exception (Prefetch abort) which can be handled by software - the self-hosted debugger.  Once Halting debug-mode IS enabled, BKPT causes entry into Debug state.  Connecting the external debugger will likely (depends on the debugger) have caused Halting debug-mode to be enabled.  Again depending on the debugger, the debugger might not be able to tell the breakpoint that caused it to stop wasn't one it had set.

Children