14 static const char *
const names[] =
20 return (v <
ARRAY_SIZE(names) && names[v]) ? names[v] :
"Unknown";
25 static const char *
const names[] =
28#define NAME(x) [X86_EXC_ ## x] = "#" #x
29 NAME(DE), NAME(DB), NAME(NMI), NAME(BP), NAME(OF), NAME(BR),
30 NAME(UD), NAME(NM), NAME(DF), NAME(CSO), NAME(TS), NAME(NP),
31 NAME(
SS), NAME(
GP), NAME(PF), NAME(SPV), NAME(MF), NAME(AC),
32 NAME(MC), NAME(XM), NAME(VE),
37 return (exc <
ARRAY_SIZE(names) && names[exc]) ? names[exc] :
"??";
41 unsigned int ev,
unsigned int ec)
46 return snprintf(buf, bufsz,
"%c%c%c%c%c%c",
68 return snprintf(buf, bufsz,
"%04x", ec);
75 return snprintf(buf, bufsz,
"nothing");
92 char **str_ptr,
char *end,
const char **fmt_ptr,
const void *arg,
93 int width,
int precision,
unsigned int flags)
95 const char *fmt = *fmt_ptr;
static unsigned int str(void)
bool arch_fmt_pointer(char **str_ptr, char *end, const char **fmt_ptr, const void *arg, int width, int precision, unsigned int flags)
static int x86_decode_exinfo(char *buf, size_t bufsz, exinfo_t info)
static int x86_exc_decode_ec(char *buf, size_t bufsz, unsigned int ev, unsigned int ec)
const char * x86_exc_short_name(unsigned int exc)
String abbreviation of ev.
const char * x86_vendor_name(enum x86_vendor v)
String of the indentified vendor v.
Helper routines for decoding x86 state.
static unsigned int exinfo_vec(exinfo_t info)
unsigned int exinfo_t
Packed exception and error code information.
static unsigned int exinfo_ec(exinfo_t info)
#define _u(v)
Express an arbitrary value v as unsigned long.
int snprintf(char *buf, size_t size, const char *fmt,...)
char * fmt_string(char *str, char *end, const char *val, int width, int precision, unsigned int flags)