mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-25 21:14:59 -07:00
metagen: simplify catchall generations; move some codeview enums into metacode; generate enum->string code
This commit is contained in:
@@ -48,17 +48,6 @@ cv_stringize_lvar_addr_gap_list(Arena *arena, String8List *out, void *first, voi
|
||||
}
|
||||
}
|
||||
|
||||
internal String8
|
||||
cv_string_from_sym_kind(CV_SymKind kind){
|
||||
String8 result = str8_lit("UNRECOGNIZED_SYM_KIND");
|
||||
switch (kind){
|
||||
#define X(N,c) case CV_SymKind_##N: result = str8_lit(#N); break;
|
||||
CV_SymKindXList(X)
|
||||
#undef X
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
internal String8
|
||||
cv_string_from_basic_type(CV_BasicType basic_type){
|
||||
String8 result = str8_lit("UNRECOGNIZED_BASIC_TYPE");
|
||||
@@ -70,33 +59,6 @@ cv_string_from_basic_type(CV_BasicType basic_type){
|
||||
return(result);
|
||||
}
|
||||
|
||||
internal String8
|
||||
cv_string_from_leaf_kind(CV_LeafKind kind){
|
||||
String8 result = str8_lit("UNRECOGNIZED_LEAF_KIND");
|
||||
switch (kind){
|
||||
#define X(N,c) case CV_LeafKind_##N: result = str8_lit(#N); break;
|
||||
CV_LeafKindXList(X)
|
||||
#undef X
|
||||
|
||||
#define X(N,c) case CV_LeafIDKind_##N: result = str8_lit(#N); break;
|
||||
CV_LeafIDKindXList(X)
|
||||
#undef X
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
internal String8
|
||||
cv_string_from_numeric_kind(CV_NumericKind kind){
|
||||
String8 result = str8_lit("UNRECOGNIZED_NUMERIC_KIND");
|
||||
switch (kind){
|
||||
case 0: str8_lit("PARSE_ERROR"); break;
|
||||
#define X(N,c) case CV_NumericKind_##N: result = str8_lit(#N); break;
|
||||
CV_NumericKindXList(X)
|
||||
#undef X
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
internal String8
|
||||
cv_string_from_c13_sub_section_kind(CV_C13_SubSectionKind kind){
|
||||
String8 result = str8_lit("UNRECOGNIZED_C13_SUB_SECTION_KIND");
|
||||
@@ -109,17 +71,6 @@ cv_string_from_c13_sub_section_kind(CV_C13_SubSectionKind kind){
|
||||
return(result);
|
||||
}
|
||||
|
||||
internal String8
|
||||
cv_string_from_machine(CV_Arch arch){
|
||||
String8 result = {0};
|
||||
switch (arch){
|
||||
#define X(N,c) case CV_Arch_##N: result = str8_lit(#N); break;
|
||||
CV_ArchXList(X)
|
||||
#undef X
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
internal String8
|
||||
cv_string_from_reg(CV_Arch arch, CV_Reg reg){
|
||||
String8 result = {0};
|
||||
@@ -417,7 +368,7 @@ cv_stringize_sym_range(Arena *arena, String8List *out,
|
||||
CV_SymCompile *compile = (CV_SymCompile*)first;
|
||||
|
||||
// machine
|
||||
String8 machine = cv_string_from_machine(compile->machine);
|
||||
String8 machine = cv_string_from_arch(compile->machine);
|
||||
str8_list_pushf(arena, out, " machine=%.*s\n",
|
||||
str8_varg(machine));
|
||||
|
||||
@@ -742,7 +693,7 @@ cv_stringize_sym_range(Arena *arena, String8List *out,
|
||||
str8_list_pushf(arena, out, " flags=%x\n", compile2->flags);
|
||||
|
||||
// machine
|
||||
String8 machine = cv_string_from_machine(compile2->machine);
|
||||
String8 machine = cv_string_from_arch(compile2->machine);
|
||||
str8_list_pushf(arena, out, " machine=%.*s\n",
|
||||
str8_varg(machine));
|
||||
|
||||
@@ -906,7 +857,7 @@ cv_stringize_sym_range(Arena *arena, String8List *out,
|
||||
str8_list_pushf(arena, out, " flags=%x\n", compile3->flags);
|
||||
|
||||
// machine
|
||||
String8 machine = cv_string_from_machine(compile3->machine);
|
||||
String8 machine = cv_string_from_arch(compile3->machine);
|
||||
str8_list_pushf(arena, out, " machine=%.*s\n",
|
||||
str8_varg(machine));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user