* spike_main/disasm.cc: Print unknown CSR numbers in hex
* interactive mode: Print "Unknown command" when appropriate
{
if(funcs.count(cmd))
(this->*funcs[cmd])(cmd, args);
+ else
+ fprintf(stderr, "Unknown command %s\n", cmd.c_str());
}
catch(trap_t t) {}
}
#define DECLARE_CSR(name, num) case num: return #name;
#include "encoding.h"
#undef DECLARE_CSR
- default: return "unknown";
+ default:
+ {
+ char buf[16];
+ snprintf(buf, sizeof buf, "unknown_%03" PRIx64, insn.csr());
+ return std::string(buf);
+ }
}
}
} csr;