mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-10-08 00:45:41 +00:00
consistency pass over dwarf layer
This commit is contained in:
+33
-33
@@ -70,10 +70,10 @@ dw_reg_pos_from_code(Arch arch, DW_Reg reg_code)
|
||||
}
|
||||
|
||||
internal DW_AttribClass
|
||||
dw_attrib_class_from_attrib_kind_v2(DW_AttribKind k)
|
||||
dw_attrib_class_from_attrib_v2(DW_AttribKind k)
|
||||
{
|
||||
switch (k) {
|
||||
#define X(_N,_C) case DW_Attrib_##_N: return _C;
|
||||
#define X(_N,_C) case DW_AttribKind_##_N: return _C;
|
||||
DW_AttribKind_ClassFlags_V2_XList(X)
|
||||
#undef X
|
||||
}
|
||||
@@ -81,10 +81,10 @@ dw_attrib_class_from_attrib_kind_v2(DW_AttribKind k)
|
||||
}
|
||||
|
||||
internal DW_AttribClass
|
||||
dw_attrib_class_from_attrib_kind_v3(DW_AttribKind k)
|
||||
dw_attrib_class_from_attrib_v3(DW_AttribKind k)
|
||||
{
|
||||
switch (k) {
|
||||
#define X(_N,_C) case DW_Attrib_##_N: return _C;
|
||||
#define X(_N,_C) case DW_AttribKind_##_N: return _C;
|
||||
DW_AttribKind_ClassFlags_V3_XList(X)
|
||||
#undef X
|
||||
}
|
||||
@@ -92,10 +92,10 @@ dw_attrib_class_from_attrib_kind_v3(DW_AttribKind k)
|
||||
}
|
||||
|
||||
internal DW_AttribClass
|
||||
dw_attrib_class_from_attrib_kind_v4(DW_AttribKind k)
|
||||
dw_attrib_class_from_attrib_v4(DW_AttribKind k)
|
||||
{
|
||||
switch (k) {
|
||||
#define X(_N,_C) case DW_Attrib_##_N: return _C;
|
||||
#define X(_N,_C) case DW_AttribKind_##_N: return _C;
|
||||
DW_AttribKind_ClassFlags_V4_XList(X)
|
||||
#undef X
|
||||
}
|
||||
@@ -103,10 +103,10 @@ dw_attrib_class_from_attrib_kind_v4(DW_AttribKind k)
|
||||
}
|
||||
|
||||
internal DW_AttribClass
|
||||
dw_attrib_class_from_attrib_kind_v5(DW_AttribKind k)
|
||||
dw_attrib_class_from_attrib_v5(DW_AttribKind k)
|
||||
{
|
||||
switch (k) {
|
||||
#define X(_N,_C) case DW_Attrib_##_N: return _C;
|
||||
#define X(_N,_C) case DW_AttribKind_##_N: return _C;
|
||||
DW_AttribKind_ClassFlags_V5_XList(X)
|
||||
#undef X
|
||||
}
|
||||
@@ -114,10 +114,10 @@ dw_attrib_class_from_attrib_kind_v5(DW_AttribKind k)
|
||||
}
|
||||
|
||||
internal DW_AttribClass
|
||||
dw_attrib_class_from_attrib_kind_gnu(DW_AttribKind k)
|
||||
dw_attrib_class_from_attrib_gnu(DW_AttribKind k)
|
||||
{
|
||||
switch (k) {
|
||||
#define X(_N,_C) case DW_Attrib_##_N: return _C;
|
||||
#define X(_N,_C) case DW_AttribKind_##_N: return _C;
|
||||
DW_AttribKind_ClassFlags_GNU_XList(X)
|
||||
#undef X
|
||||
}
|
||||
@@ -125,10 +125,10 @@ dw_attrib_class_from_attrib_kind_gnu(DW_AttribKind k)
|
||||
}
|
||||
|
||||
internal DW_AttribClass
|
||||
dw_attrib_class_from_attrib_kind_llvm(DW_AttribKind k)
|
||||
dw_attrib_class_from_attrib_llvm(DW_AttribKind k)
|
||||
{
|
||||
switch (k) {
|
||||
#define X(_N,_C) case DW_Attrib_##_N: return _C;
|
||||
#define X(_N,_C) case DW_AttribKind_##_N: return _C;
|
||||
DW_AttribKind_ClassFlags_LLVM_XList(X)
|
||||
#undef X
|
||||
}
|
||||
@@ -136,10 +136,10 @@ dw_attrib_class_from_attrib_kind_llvm(DW_AttribKind k)
|
||||
}
|
||||
|
||||
internal DW_AttribClass
|
||||
dw_attrib_class_from_attrib_kind_apple(DW_AttribKind k)
|
||||
dw_attrib_class_from_attrib_apple(DW_AttribKind k)
|
||||
{
|
||||
switch (k) {
|
||||
#define X(_N,_C) case DW_Attrib_##_N: return _C;
|
||||
#define X(_N,_C) case DW_AttribKind_##_N: return _C;
|
||||
DW_AttribKind_ClassFlags_APPLE_XList(X)
|
||||
#undef X
|
||||
}
|
||||
@@ -147,10 +147,10 @@ dw_attrib_class_from_attrib_kind_apple(DW_AttribKind k)
|
||||
}
|
||||
|
||||
internal DW_AttribClass
|
||||
dw_attrib_class_from_attrib_kind_mips(DW_AttribKind k)
|
||||
dw_attrib_class_from_attrib_mips(DW_AttribKind k)
|
||||
{
|
||||
switch (k) {
|
||||
#define X(_N,_C) case DW_Attrib_##_N: return _C;
|
||||
#define X(_N,_C) case DW_AttribKind_##_N: return _C;
|
||||
DW_AttribKind_ClassFlags_MIPS_XList(X)
|
||||
#undef X
|
||||
}
|
||||
@@ -158,7 +158,7 @@ dw_attrib_class_from_attrib_kind_mips(DW_AttribKind k)
|
||||
}
|
||||
|
||||
internal DW_AttribClass
|
||||
dw_attrib_class_from_attrib_kind(DW_Version ver, DW_Ext ext, DW_AttribKind k)
|
||||
dw_attrib_class_from_attrib(DW_Version ver, DW_Ext ext, DW_AttribKind k)
|
||||
{
|
||||
DW_AttribClass result = DW_AttribClass_Null;
|
||||
|
||||
@@ -172,10 +172,10 @@ dw_attrib_class_from_attrib_kind(DW_Version ver, DW_Ext ext, DW_AttribKind k)
|
||||
|
||||
switch (flag) {
|
||||
case DW_Ext_Null: break;
|
||||
case DW_Ext_GNU: result = dw_attrib_class_from_attrib_kind_gnu(k); break;
|
||||
case DW_Ext_LLVM: result = dw_attrib_class_from_attrib_kind_llvm(k); break;
|
||||
case DW_Ext_APPLE: result = dw_attrib_class_from_attrib_kind_apple(k); break;
|
||||
case DW_Ext_MIPS: result = dw_attrib_class_from_attrib_kind_mips(k); break;
|
||||
case DW_Ext_GNU: result = dw_attrib_class_from_attrib_gnu(k); break;
|
||||
case DW_Ext_LLVM: result = dw_attrib_class_from_attrib_llvm(k); break;
|
||||
case DW_Ext_APPLE: result = dw_attrib_class_from_attrib_apple(k); break;
|
||||
case DW_Ext_MIPS: result = dw_attrib_class_from_attrib_mips(k); break;
|
||||
default: InvalidPath; break;
|
||||
}
|
||||
|
||||
@@ -188,10 +188,10 @@ dw_attrib_class_from_attrib_kind(DW_Version ver, DW_Ext ext, DW_AttribKind k)
|
||||
switch (ver) {
|
||||
case DW_Version_Null: break;
|
||||
case DW_Version_1: AssertAlways(!"DWARF V1 is not supported"); break;
|
||||
case DW_Version_2: result = dw_attrib_class_from_attrib_kind_v2(k); break;
|
||||
case DW_Version_3: result = dw_attrib_class_from_attrib_kind_v3(k); break;
|
||||
case DW_Version_4: result = dw_attrib_class_from_attrib_kind_v4(k); break;
|
||||
case DW_Version_5: result = dw_attrib_class_from_attrib_kind_v5(k); break;
|
||||
case DW_Version_2: result = dw_attrib_class_from_attrib_v2(k); break;
|
||||
case DW_Version_3: result = dw_attrib_class_from_attrib_v3(k); break;
|
||||
case DW_Version_4: result = dw_attrib_class_from_attrib_v4(k); break;
|
||||
case DW_Version_5: result = dw_attrib_class_from_attrib_v5(k); break;
|
||||
default: InvalidPath; break;
|
||||
}
|
||||
}
|
||||
@@ -302,14 +302,14 @@ dw_pick_attrib_value_class(DW_Version ver, DW_Ext ext, B32 relaxed, DW_AttribKin
|
||||
// This function's purpose is to find the overlapping class between an
|
||||
// DW_AttribKind and DW_FormKind.
|
||||
|
||||
DW_AttribClass attrib_class = dw_attrib_class_from_attrib_kind(ver, ext, attrib_kind);
|
||||
DW_AttribClass attrib_class = dw_attrib_class_from_attrib(ver, ext, attrib_kind);
|
||||
DW_AttribClass form_class = dw_attrib_class_from_form_kind(ver, form_kind);
|
||||
|
||||
if(relaxed)
|
||||
{
|
||||
if(attrib_class == DW_AttribClass_Null || form_class == DW_AttribClass_Null)
|
||||
{
|
||||
attrib_class = dw_attrib_class_from_attrib_kind(DW_Version_Last, ext, attrib_kind);
|
||||
attrib_class = dw_attrib_class_from_attrib(DW_Version_Last, ext, attrib_kind);
|
||||
form_class = dw_attrib_class_from_form_kind(DW_Version_Last, form_kind);
|
||||
}
|
||||
}
|
||||
@@ -434,11 +434,11 @@ internal String8
|
||||
dw_string_from_tag_kind(Arena *arena, DW_TagKind kind)
|
||||
{
|
||||
switch (kind) {
|
||||
case DW_Tag_Null: return str8_lit("Null");
|
||||
#define X(_N,_ID) case DW_Tag_##_N: return str8_lit(Stringify(_N));
|
||||
DW_Tag_V3_XList(X)
|
||||
DW_Tag_V5_XList(X)
|
||||
DW_Tag_GNU_XList(X)
|
||||
case DW_TagKind_Null: return str8_lit("Null");
|
||||
#define X(_N,_ID) case DW_TagKind_##_N: return str8_lit(Stringify(_N));
|
||||
DW_TagKind_V3_XList(X)
|
||||
DW_TagKind_V5_XList(X)
|
||||
DW_TagKind_GNU_XList(X)
|
||||
#undef X
|
||||
}
|
||||
return push_str8f(arena, "%llx", kind);
|
||||
@@ -447,7 +447,7 @@ dw_string_from_tag_kind(Arena *arena, DW_TagKind kind)
|
||||
internal String8
|
||||
dw_string_from_attrib_kind(Arena *arena, DW_Version ver, DW_Ext ext, DW_AttribKind kind)
|
||||
{
|
||||
#define X(_N,...) case DW_Attrib_##_N: return str8_lit(Stringify(_N));
|
||||
#define X(_N,...) case DW_AttribKind_##_N: return str8_lit(Stringify(_N));
|
||||
|
||||
while (ext) {
|
||||
U64 z = 64-clz64(ext);
|
||||
|
||||
Reference in New Issue
Block a user