summaryrefslogtreecommitdiff
path: root/src/format/dwarf/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/dwarf/info.c')
-rw-r--r--src/format/dwarf/info.c57
1 files changed, 49 insertions, 8 deletions
diff --git a/src/format/dwarf/info.c b/src/format/dwarf/info.c
index 30d2391..a45b556 100644
--- a/src/format/dwarf/info.c
+++ b/src/format/dwarf/info.c
@@ -558,7 +558,7 @@ bool look_for_dwarf_subprograms(dwarf_format *format, off_t *pos, const compil_u
}
- exit_loop:
+ exit_loop:
proto_len += 1;
prototype = (char *)realloc(prototype, (proto_len + 1) * sizeof(char));
@@ -584,10 +584,6 @@ bool look_for_dwarf_subprograms(dwarf_format *format, off_t *pos, const compil_u
printf("error skipping :(\n");
- printf(" == progress %d\n", *pos - oldpos);
- printf(" == %d < %d\n", *pos, cu->endpos);
-
-
}
@@ -634,11 +630,25 @@ char *resolve_dwarf_function_type(dwarf_format *format, const dw_abbrev *abbrev,
switch (abbrev->tag)
{
- case DWT_BASE_TYPE:
+ /* 0x04 */
+ case DWT_ENUMERATION_TYPE:
+
oldpos = *pos;
- read_dwarf_abbrev_attribute(format, &oldpos, true, abbrev, DWA_NAME, &result);
+ read_dwarf_abbrev_attribute(format, &oldpos, true /* ??? */, abbrev, DWA_NAME, &result);
+
+ if (result != NULL)
+ {
+ len = strlen(result);
+
+ result = (char *)realloc(result, (strlen("enum ") + len + 1) * sizeof(char));
+ memmove(&result[strlen("enum ")], result, len);
+ memcpy(result, "enum ", strlen("enum "));
+
+ }
+
break;
+ /* 0x0f */
case DWT_POINTER_TYPE:
if (read_dwarf_abbrev_attribute(format, &oldpos, true, abbrev, DWA_TYPE, &type_pos))
@@ -675,6 +685,37 @@ char *resolve_dwarf_function_type(dwarf_format *format, const dw_abbrev *abbrev,
break;
+ /* 0x13 */
+ case DWT_STRUCTURE_TYPE:
+
+ oldpos = *pos;
+ read_dwarf_abbrev_attribute(format, &oldpos, true /* ??? */, abbrev, DWA_NAME, &result);
+
+ if (result != NULL)
+ {
+ len = strlen(result);
+
+ result = (char *)realloc(result, (strlen("struct ") + len + 1) * sizeof(char));
+ memmove(&result[strlen("struct ")], result, len);
+ memcpy(result, "struct ", strlen("struct "));
+
+ }
+
+ break;
+
+ /* 0x16 */
+ case DWT_TYPEDEF:
+ oldpos = *pos;
+ read_dwarf_abbrev_attribute(format, &oldpos, true /* ??? */, abbrev, DWA_NAME, &result);
+ break;
+
+ /* 0x24 */
+ case DWT_BASE_TYPE:
+ oldpos = *pos;
+ read_dwarf_abbrev_attribute(format, &oldpos, true /* ??? */, abbrev, DWA_NAME, &result);
+ break;
+
+ /* 0x26 */
case DWT_CONST_TYPE:
@@ -702,7 +743,7 @@ char *resolve_dwarf_function_type(dwarf_format *format, const dw_abbrev *abbrev,
{
len = strlen(result);
- result = (char *)realloc(result, (len + strlen("const ") + 1) * sizeof(char));
+ result = (char *)realloc(result, (strlen("const ") + len + 1) * sizeof(char));
memmove(&result[strlen("const ")], result, len);
memcpy(result, "const ", strlen("const "));