Hide unknown registers, which probably don't exist
Change-Id: Iffa8fa5ff4b0a01abd30fa302b7087e2011337bf
This commit is contained in:
parent
26a54452d2
commit
8926e66d3a
|
@ -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) {
|
||||
|
|
|
@ -2742,21 +2742,23 @@ COMMAND_HANDLER(handle_reg_command)
|
|||
i < cache->num_regs;
|
||||
i++, reg++, count++) {
|
||||
/* only print cached values if they are valid */
|
||||
if (reg->valid) {
|
||||
value = buf_to_str(reg->value,
|
||||
reg->size, 16);
|
||||
command_print(CMD_CTX,
|
||||
"(%i) %s (/%" PRIu32 "): 0x%s%s",
|
||||
count, reg->name,
|
||||
reg->size, value,
|
||||
reg->dirty
|
||||
if (reg->exist) {
|
||||
if (reg->valid) {
|
||||
value = buf_to_str(reg->value,
|
||||
reg->size, 16);
|
||||
command_print(CMD_CTX,
|
||||
"(%i) %s (/%" PRIu32 "): 0x%s%s",
|
||||
count, reg->name,
|
||||
reg->size, value,
|
||||
reg->dirty
|
||||
? " (dirty)"
|
||||
: "");
|
||||
free(value);
|
||||
} else {
|
||||
command_print(CMD_CTX, "(%i) %s (/%" PRIu32 ")",
|
||||
count, reg->name,
|
||||
reg->size) ;
|
||||
free(value);
|
||||
} else {
|
||||
command_print(CMD_CTX, "(%i) %s (/%" PRIu32 ")",
|
||||
count, reg->name,
|
||||
reg->size) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
cache = cache->next;
|
||||
|
|
Loading…
Reference in New Issue