From 6f21a8e40e1d159310d38283efae52b54d98a539 Mon Sep 17 00:00:00 2001 From: Liviu Ionescu Date: Fri, 3 Nov 2017 22:15:37 +0200 Subject: [PATCH] try to solve the no_show registers --- src/target/register.h | 5 +++++ src/target/riscv/riscv-011.c | 8 ++++++++ src/target/riscv/riscv-013.c | 8 ++++++++ src/target/target.c | 5 +++++ 4 files changed, 26 insertions(+) diff --git a/src/target/register.h b/src/target/register.h index d4c328160..8e8a67c19 100644 --- a/src/target/register.h +++ b/src/target/register.h @@ -131,6 +131,11 @@ struct reg { bool valid; /* When false, the register doesn't actually exist in the target. */ bool exist; +// [GNU MCU Eclipse] +#if 1 + /* When true, the register is not shown in monitor reg. */ + bool no_show; +#endif /* Size of the register in bits. */ uint32_t size; /* Used for generating XML description of registers. Can be set to NULL for diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c index 6e576fef9..72c901fd7 100644 --- a/src/target/riscv/riscv-011.c +++ b/src/target/riscv/riscv-011.c @@ -1496,8 +1496,16 @@ static int init_target(struct command_context *cmd_ctx, sprintf(reg_name, "f%d", i - GDB_REGNO_FPR0); } else if (i >= GDB_REGNO_CSR0 && i <= GDB_REGNO_CSR4095) { sprintf(reg_name, "csr%d", i - GDB_REGNO_CSR0); +// [GNU MCU Eclipse] +#if 1 + r->no_show = true; +#endif } else if (i == GDB_REGNO_PRIV) { sprintf(reg_name, "priv"); +// [GNU MCU Eclipse] +#if 1 + r->no_show = true; +#endif } if (reg_name[0]) { r->name = reg_name; diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 4ab9a2e9d..da0f76f0c 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -950,8 +950,16 @@ static int init_target(struct command_context *cmd_ctx, sprintf(reg_name, "f%d", i - GDB_REGNO_FPR0); } else if (i >= GDB_REGNO_CSR0 && i <= GDB_REGNO_CSR4095) { sprintf(reg_name, "csr%d", i - GDB_REGNO_CSR0); +// [GNU MCU Eclipse] +#if 1 + r->no_show = true; +#endif } else if (i == GDB_REGNO_PRIV) { sprintf(reg_name, "priv"); +// [GNU MCU Eclipse] +#if 1 + r->no_show = true; +#endif } if (reg_name[0]) { r->name = reg_name; diff --git a/src/target/target.c b/src/target/target.c index 78de45e25..bb353ca0f 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -2779,6 +2779,11 @@ COMMAND_HANDLER(handle_reg_command) for (i = 0, reg = cache->reg_list; i < cache->num_regs; i++, reg++, count++) { +// [GNU MCU Eclipse] +#if 1 + if (reg->no_show) + continue; +#endif /* only print cached values if they are valid */ if (reg->valid) { value = buf_to_str(reg->value,