Hide unknown registers, which probably don't exist

Change-Id: Iffa8fa5ff4b0a01abd30fa302b7087e2011337bf
This commit is contained in:
Tim Newsome 2017-11-29 13:38:04 -08:00
parent 26a54452d2
commit 8926e66d3a
2 changed files with 21 additions and 13 deletions

View File

@ -1249,6 +1249,12 @@ static int init_registers(struct target *target)
r->name = csr_info[csr_info_index].name;
} else {
sprintf(reg_name, "csr%d", csr_number);
// Assume unnamed registers don't exist, unless we have some
// configuration that tells us otherwise. That's important
// because eg. Eclipse crashes if a target has too many
// registers, and apparently has no way of only showing a
// subset of registers in any case.
r->exist = false;
}
switch (csr_number) {

View File

@ -2742,6 +2742,7 @@ COMMAND_HANDLER(handle_reg_command)
i < cache->num_regs;
i++, reg++, count++) {
/* only print cached values if they are valid */
if (reg->exist) {
if (reg->valid) {
value = buf_to_str(reg->value,
reg->size, 16);
@ -2759,6 +2760,7 @@ COMMAND_HANDLER(handle_reg_command)
reg->size) ;
}
}
}
cache = cache->next;
}