侵入式调试
Invasive debug may be divided into
1. halting debug(also known as external debug)// 传统上的概念是外部调试器调试
the debug event causes the core to enter debug state. 也叫 Halting Debug mode.也叫 external debug model.
In debug state
the core is halted, meaning that it no longer fetches instructions.
the core executes instructions under the direction of a debugger running on a different host connected through JTAG, or another external interface.2. monitor debug(also known as self-hosted debug)// 传统上的概念就是主机侧调试(例如用本机的gdb调试本机的应用程序),本质利用异常处理函数
the debug event causes a debug exception to be raised.也叫 self-hosted debug model , 也叫 Monitor debug mode.
The exception must be handled by dedicated debug monitor software running on the same core.
Monitor debug presupposes software support.
注意 :
halting debug 和 monitor debug 被称为一个过程,并不对应任何ARM实际概念
debug event
debug event 包括什么
Software debug events
Breakpoint debug event
Watchpoint debug event
Software Step debug event
Software breakpoint instruction debug event
A64 : BRK
A32 : BKPT
Vector Catch debug event
Hardware debug events
external debugger send a request sequence to halt the core // 最后会进入 debug state // TODO
debug event 的四种处理情况 // 只会进入一种或不进入1. 进入 debug state // 所谓的 halting debug// depending on the setup of the External Debug Status and Control Register (EDSCR)2. 进入 debug exception // 所谓的 monitor debug// depending on the setup of the External Debug Status and Control Register (EDSCR)3. 什么都不做 // 所谓的 Ignore the debug event.4. Pend the debug event and convert it into an action later