aboutsummaryrefslogtreecommitdiff
path: root/src/target/target.c
diff options
context:
space:
mode:
authorSamuel Obuch <sobuch@codasip.com>2020-08-11 17:37:01 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2020-09-05 16:48:08 +0100
commit3ac010bb9f1065c0d2cba9ac2c473878d8a6eee6 (patch)
treecdedc9f5f35856661b47877953c7399b8f8d8c1e /src/target/target.c
parent764b25c81481225d425ff711b9ba11fca1d91b31 (diff)
downloadriscv-openocd-3ac010bb9f1065c0d2cba9ac2c473878d8a6eee6.zip
riscv-openocd-3ac010bb9f1065c0d2cba9ac2c473878d8a6eee6.tar.gz
riscv-openocd-3ac010bb9f1065c0d2cba9ac2c473878d8a6eee6.tar.bz2
Fix debug prints when loading to flash
While loading to flash with debug level at least 3, OpenOCD tries to print the whole loaded bitstream. This will be very-very-slow due to implementation of conversion from buffer to string. * fix condition on selected debug level in jtag/core.c * replace slow buf_to_str function from helper/binarybuffer.c with faster but_to_hex_str function Change-Id: I3dc01d5846941ca80736f2ed12e3a54114d2b6dd Signed-off-by: Samuel Obuch <sobuch@codasip.com> Reviewed-on: http://openocd.zylin.com/5800 Tested-by: jenkins Reviewed-by: Jan Matyas <matyas@codasip.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/target/target.c')
-rw-r--r--src/target/target.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 4ef5ee1..affee03 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -2897,8 +2897,8 @@ COMMAND_HANDLER(handle_reg_command)
continue;
/* only print cached values if they are valid */
if (reg->valid) {
- value = buf_to_str(reg->value,
- reg->size, 16);
+ value = buf_to_hex_str(reg->value,
+ reg->size);
command_print(CMD,
"(%i) %s (/%" PRIu32 "): 0x%s%s",
count, reg->name,
@@ -2965,7 +2965,7 @@ COMMAND_HANDLER(handle_reg_command)
if (reg->valid == 0)
reg->type->get(reg);
- value = buf_to_str(reg->value, reg->size, 16);
+ value = buf_to_hex_str(reg->value, reg->size);
command_print(CMD, "%s (/%i): 0x%s", reg->name, (int)(reg->size), value);
free(value);
return ERROR_OK;
@@ -2980,7 +2980,7 @@ COMMAND_HANDLER(handle_reg_command)
reg->type->set(reg, buf);
- value = buf_to_str(reg->value, reg->size, 16);
+ value = buf_to_hex_str(reg->value, reg->size);
command_print(CMD, "%s (/%i): 0x%s", reg->name, (int)(reg->size), value);
free(value);
@@ -3744,8 +3744,8 @@ static int handle_bp_command_list(struct command_invocation *cmd)
struct breakpoint *breakpoint = target->breakpoints;
while (breakpoint) {
if (breakpoint->type == BKPT_SOFT) {
- char *buf = buf_to_str(breakpoint->orig_instr,
- breakpoint->length, 16);
+ char *buf = buf_to_hex_str(breakpoint->orig_instr,
+ breakpoint->length);
command_print(cmd, "IVA breakpoint: " TARGET_ADDR_FMT ", 0x%x, %i, 0x%s",
breakpoint->address,
breakpoint->length,