Add basic support for Fortran binaries
authorDodji Seketeli <dodji@redhat.com>
Thu, 29 Nov 2018 10:18:57 +0000 (11:18 +0100)
committerDodji Seketeli <dodji@redhat.com>
Thu, 29 Nov 2018 13:39:04 +0000 (14:39 +0100)
Apparently, the only DWARF TAG that we needed to support to allow the
analysis of Fortran binaries is DW_TAG_string_type, at least for now.

The only place where we need to handle the DW_TAG_string_type is in
the DIE canonicalizer.  Basically, with this patch we now consider all
the DW_TAG_string_type DIEs as being equal.  This seems good enough for
ABIs purpose, unless proven otherwise.

Note that this fixes PR23492 and PR23905.

* src/abg-dwarf-reader.cc (die_pretty_print_type): Support
DW_TAG_string_type DIEs.  They all have the same representation
for now.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc

index 02abc1a110d987c5446f6d412a6582490a7389f6..c8b197b366a45d457464d96ca5011c5514a880a1 100644 (file)
@@ -10967,6 +10967,17 @@ die_pretty_print_type(read_context& ctxt, Dwarf_Die* die, size_t where_offset)
   int tag = dwarf_tag(die);
   switch (tag)
     {
+    case DW_TAG_string_type:
+      // For now, we won't try to go get the actual representation of
+      // the string because this would make things more complicated;
+      // for that we'd need to interpret some location expressions to
+      // get the length of the string.  And for dynamically allocated
+      // strings, the result of the location expression evaluation
+      // might not even be a constant.  So at the moment I consider
+      // this to be a lot of hassle for no great return.  Until proven
+      // otherwise, of course.
+      repr = "string type";
+
     case DW_TAG_unspecified_type:
     case DW_TAG_ptr_to_member_type:
       break;
@@ -11078,7 +11089,6 @@ die_pretty_print_type(read_context& ctxt, Dwarf_Die* die, size_t where_offset)
       }
       break;
 
-    case DW_TAG_string_type:
     case DW_TAG_set_type:
     case DW_TAG_file_type:
     case DW_TAG_packed_type: