cdf7b8d59af6cd8575aea6ea752b142953c5b6d1
[riscv-isa-sim.git] / riscv / trap.cc
1 #include "trap.h"
2
3 const char* trap_name(trap_t t)
4 {
5 #undef DECLARE_TRAP
6 #define DECLARE_TRAP(x) "trap_"#x
7 static const char* names[] = { TRAP_LIST };
8
9 return (unsigned)t >= sizeof(names)/sizeof(names[0]) ? "unknown" : names[t];
10 }