|
From: openocd-gerrit <ope...@us...> - 2025-11-12 20:29:37
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via a0eac82708eb6eddb0070aee6769975625c08dd9 (commit)
from f354d259ffe613ed2e5c4369b8c25727baab32c5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a0eac82708eb6eddb0070aee6769975625c08dd9
Author: Tomas Vanek <va...@fb...>
Date: Sat Sep 13 23:01:33 2025 +0200
target, flash: utility for riscv repeat_read command
Imported non-riscv part from
https://github.com/riscv-collab/riscv-openocd/pull/510
developed by Tim Newsome <ti...@si...>
Introduce target_handle_md_output() parameter include_address.
All callers set it true but riscv repeat_read command.
Change-Id: I67b5aad15a33ad149d4047998b22407cb60098fd
Signed-off-by: Tomas Vanek <va...@fb...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9127
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <evg...@sy...>
diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c
index 6161f5d26..517d9aca1 100644
--- a/src/flash/nor/tcl.c
+++ b/src/flash/nor/tcl.c
@@ -720,7 +720,8 @@ COMMAND_HANDLER(handle_flash_md_command)
retval = flash_driver_read(bank, buffer, offset, sizebytes);
if (retval == ERROR_OK)
- target_handle_md_output(CMD, target, address, wordsize, count, buffer);
+ target_handle_md_output(CMD, target, address, wordsize, count,
+ buffer, true);
free(buffer);
diff --git a/src/target/dsp563xx.c b/src/target/dsp563xx.c
index d79d54282..a989c331b 100644
--- a/src/target/dsp563xx.c
+++ b/src/target/dsp563xx.c
@@ -2143,7 +2143,8 @@ COMMAND_HANDLER(dsp563xx_mem_command)
err = dsp563xx_read_memory(target, mem_type, address, sizeof(uint32_t),
count, buffer);
if (err == ERROR_OK)
- target_handle_md_output(CMD, target, address, sizeof(uint32_t), count, buffer);
+ target_handle_md_output(CMD, target, address, sizeof(uint32_t),
+ count, buffer, true);
} else {
b = buffer;
diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c
index 92daffa49..31af2c33e 100644
--- a/src/target/riscv/riscv.c
+++ b/src/target/riscv/riscv.c
@@ -5231,7 +5231,7 @@ COMMAND_HANDLER(handle_repeat_read)
};
int result = r->access_memory(target, args);
if (result == ERROR_OK)
- target_handle_md_output(cmd, target, address, size, count, buffer);
+ target_handle_md_output(cmd, target, address, size, count, buffer, false);
free(buffer);
return result;
}
diff --git a/src/target/target.c b/src/target/target.c
index bdf0ff244..3d807ba35 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -3349,7 +3349,7 @@ COMMAND_HANDLER(handle_step_command)
void target_handle_md_output(struct command_invocation *cmd,
struct target *target, target_addr_t address, unsigned int size,
- unsigned int count, const uint8_t *buffer)
+ unsigned int count, const uint8_t *buffer, bool include_address)
{
const unsigned int line_bytecnt = 32;
unsigned int line_modulo = line_bytecnt / size;
@@ -3378,7 +3378,7 @@ void target_handle_md_output(struct command_invocation *cmd,
}
for (unsigned int i = 0; i < count; i++) {
- if (i % line_modulo == 0) {
+ if (include_address && i % line_modulo == 0) {
output_len += snprintf(output + output_len,
sizeof(output) - output_len,
TARGET_ADDR_FMT ": ",
@@ -3462,7 +3462,7 @@ COMMAND_HANDLER(handle_md_command)
struct target *target = get_current_target(CMD_CTX);
int retval = fn(target, address, size, count, buffer);
if (retval == ERROR_OK)
- target_handle_md_output(CMD, target, address, size, count, buffer);
+ target_handle_md_output(CMD, target, address, size, count, buffer, true);
free(buffer);
diff --git a/src/target/target.h b/src/target/target.h
index b850b49cf..94e6aa335 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -775,7 +775,7 @@ void target_handle_event(struct target *t, enum target_event e);
void target_handle_md_output(struct command_invocation *cmd,
struct target *target, target_addr_t address, unsigned int size,
- unsigned int count, const uint8_t *buffer);
+ unsigned int count, const uint8_t *buffer, bool include_address);
int target_profiling_default(struct target *target, uint32_t *samples, uint32_t
max_num_samples, uint32_t *num_samples, uint32_t seconds);
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/tcl.c | 3 ++-
src/target/dsp563xx.c | 3 ++-
src/target/riscv/riscv.c | 2 +-
src/target/target.c | 6 +++---
src/target/target.h | 2 +-
5 files changed, 9 insertions(+), 7 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|