aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarek Vrbka <marek.vrbka@codasip.com>2023-09-25 10:00:42 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2023-10-14 12:02:57 +0000
commit7822260ed4e434740e715e4c759db0c6fefb87e9 (patch)
treea32e1daa58bc925c099024ec89022079bd9452b0 /src
parenteba5d211937d1ebcb3669810ff63ad1083600b67 (diff)
downloadriscv-openocd-7822260ed4e434740e715e4c759db0c6fefb87e9.zip
riscv-openocd-7822260ed4e434740e715e4c759db0c6fefb87e9.tar.gz
riscv-openocd-7822260ed4e434740e715e4c759db0c6fefb87e9.tar.bz2
target: Change the watchpoint type print from number to letter
Previously, when listing the watchpoints, OpenOCD printed numbers 0, 1 and 2 representing READ, WRITE and ACCESS type watchpoints. This patch changes it to 'r', 'w' and 'a'. This increases the clarity as what type the watchpoint actually is. Change-Id: I9eac72dfd0bb2a9596a5b0c080a3f584556ed599 Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7909 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Diffstat (limited to 'src')
-rw-r--r--src/target/target.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/target/target.c b/src/target/target.c
index bed8a2c..dfa86fd 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -4069,13 +4069,14 @@ COMMAND_HANDLER(handle_wp_command)
struct watchpoint *watchpoint = target->watchpoints;
while (watchpoint) {
+ char wp_type = (watchpoint->rw == WPT_READ ? 'r' : (watchpoint->rw == WPT_WRITE ? 'w' : 'a'));
command_print(CMD, "address: " TARGET_ADDR_FMT
", len: 0x%8.8" PRIx32
- ", r/w/a: %i, value: 0x%8.8" PRIx64
+ ", r/w/a: %c, value: 0x%8.8" PRIx64
", mask: 0x%8.8" PRIx64,
watchpoint->address,
watchpoint->length,
- (int)watchpoint->rw,
+ wp_type,
watchpoint->value,
watchpoint->mask);
watchpoint = watchpoint->next;