|
|
@ -777,6 +777,8 @@ read_debug_info_for_compilation_unit(u8 *file, struct mi_debuginfo *dest, |
|
|
|
struct mi_variable *variable = dest->variables + dest->var_count; |
|
|
|
struct mi_variable *variable = dest->variables + dest->var_count; |
|
|
|
struct mi_type *type = dest->types + dest->type_count; |
|
|
|
struct mi_type *type = dest->types + dest->type_count; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct mi_type *parent_type = 0; |
|
|
|
|
|
|
|
|
|
|
|
comp_unit->functions_from = dest->func_count; |
|
|
|
comp_unit->functions_from = dest->func_count; |
|
|
|
|
|
|
|
|
|
|
|
for (;;) { |
|
|
|
for (;;) { |
|
|
@ -804,6 +806,32 @@ read_debug_info_for_compilation_unit(u8 *file, struct mi_debuginfo *dest, |
|
|
|
++depth; |
|
|
|
++depth; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (tag) { |
|
|
|
|
|
|
|
case DW_TAG_compile_unit: { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case DW_TAG_subprogram: { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case DW_TAG_variable: { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case DW_TAG_structure_type: { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case DW_TAG_member: { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case DW_TAG_base_type: { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#if 0 |
|
|
|
u32 attribute, form; |
|
|
|
u32 attribute, form; |
|
|
|
|
|
|
|
|
|
|
|
do { |
|
|
|
do { |
|
|
@ -838,6 +866,15 @@ read_debug_info_for_compilation_unit(u8 *file, struct mi_debuginfo *dest, |
|
|
|
} else if (attribute == DW_AT_type) { |
|
|
|
} else if (attribute == DW_AT_type) { |
|
|
|
variable->type = value; |
|
|
|
variable->type = value; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else if (tag == DW_TAG_structure_type) { |
|
|
|
|
|
|
|
type->_offset = record_offset; |
|
|
|
|
|
|
|
if (attribute == DW_AT_name) { |
|
|
|
|
|
|
|
type->name = (char *) value; |
|
|
|
|
|
|
|
} else if (attribute == DW_AT_byte_size) { |
|
|
|
|
|
|
|
type->size = value; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (tag == DW_TAG_member) { |
|
|
|
|
|
|
|
|
|
|
|
} else if (tag == DW_TAG_base_type) { |
|
|
|
} else if (tag == DW_TAG_base_type) { |
|
|
|
type->_offset = record_offset; |
|
|
|
type->_offset = record_offset; |
|
|
|
if (attribute == DW_AT_name) { |
|
|
|
if (attribute == DW_AT_name) { |
|
|
@ -882,7 +919,7 @@ read_debug_info_for_compilation_unit(u8 *file, struct mi_debuginfo *dest, |
|
|
|
} |
|
|
|
} |
|
|
|
} while (attribute != 0 || form != 0); |
|
|
|
} while (attribute != 0 || form != 0); |
|
|
|
|
|
|
|
|
|
|
|
// NOTE(aolo2): DIE completely processed, finish it up
|
|
|
|
// NOTE(aolo2): DIE completely processed, finish it ??uploads??
|
|
|
|
if (tag == DW_TAG_subprogram) { |
|
|
|
if (tag == DW_TAG_subprogram) { |
|
|
|
func->high_pc = func->low_pc + func->high_pc; |
|
|
|
func->high_pc = func->low_pc + func->high_pc; |
|
|
|
func->variables_from = dest->var_count; |
|
|
|
func->variables_from = dest->var_count; |
|
|
@ -895,9 +932,17 @@ read_debug_info_for_compilation_unit(u8 *file, struct mi_debuginfo *dest, |
|
|
|
++dest->var_count; |
|
|
|
++dest->var_count; |
|
|
|
++variable; |
|
|
|
++variable; |
|
|
|
} else if (tag == DW_TAG_base_type) { |
|
|
|
} else if (tag == DW_TAG_base_type) { |
|
|
|
|
|
|
|
++parent_type->children_count; |
|
|
|
++dest->type_count; |
|
|
|
++dest->type_count; |
|
|
|
++type; |
|
|
|
++type; |
|
|
|
|
|
|
|
} else if (tag == DW_TAG_structure_type) { |
|
|
|
|
|
|
|
parent_type = type; |
|
|
|
|
|
|
|
parent_type->children_from = dest->type_count; |
|
|
|
|
|
|
|
++type; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Resolve types
|
|
|
|
// Resolve types
|
|
|
|