Skip to content
This repository has been archived by the owner on Sep 28, 2019. It is now read-only.

Commit

Permalink
try to solve the no_show registers
Browse files Browse the repository at this point in the history
  • Loading branch information
ilg-ul committed Nov 3, 2017
1 parent 50b14c8 commit 6f21a8e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/target/register.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/target/riscv/riscv-011.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions src/target/riscv/riscv-013.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/target/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6f21a8e

Please sign in to comment.