]> git.gag.com Git - fw/openocd/commit
target/cortex_a: add support for watchpoints
authorChengyu Zheng <chengyu.zheng@polimi.it>
Wed, 14 Dec 2016 11:18:10 +0000 (12:18 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Thu, 3 Jun 2021 22:26:35 +0000 (23:26 +0100)
commit1fb736f6c5a69f743dd90e68045f7b4e6a0f8c78
treecccf3590c1eb22aaa79e94cd630b0ac6c070e692
parentb40dc09dd9e05497bf956ca91f7153aa34b24854
target/cortex_a: add support for watchpoints

The current implementation of OpenOCD does not support watchpoints for
cortex_a architecture. So, I replaced the add_watchpoint and
remove_watchpoint with the specific implementation for the
cortex a and using the breakpoint implementation and the arm
documentation [1] as reference. In particular, I have made the
following changes:

* added the following functions

- cortex_a_add_watchpoint
  This wrapper function check whether there are any watchpoint
  available on the target device by calling cortex_a_set_watchpoint.

- cortex_a_set_watchpoint
  This function is responsible for settings the watchpoint register
  pair. In particular, it sets the WVR and the WCR registers with
  the cortex_a_dap command.

- cortex_a_remove_watchpoint
  This wrapper function the selected watchpoint on the target device
  by calling cortex_a_unset_watchpoint.

- cortex_a_unset_watchpoint
  This function sets both the WVR and the WCR registers to zero, thus
  unsetting the watchpoint.

[1]
http://infocenter.arm.com/help/topic/com.arm.doc.ddi0464f/BCGDHIEJ.html

Change-Id: I86611dab474cb84836662af572b17636dc68e282
Signed-off-by: Chengyu Zheng <chengyu.zheng@polimi.it>
Reviewed-on: http://openocd.zylin.com/3913
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: Marc Schink <dev@zapb.de>
Tested-by: jenkins
src/target/arm_dpm.c
src/target/armv7a.c
src/target/cortex_a.c
src/target/cortex_a.h