OSDN Git Service

(LibGoblin)
authorKoine Yuusuke <koinec@users.osdn.me>
Mon, 26 Aug 2019 03:37:46 +0000 (12:37 +0900)
committerKoine Yuusuke <koinec@users.osdn.me>
Mon, 26 Aug 2019 03:37:46 +0000 (12:37 +0900)
  * Implement: DW_TAG_restrict_type / DW_TAG_volatile_type
  * Change: DW_TAG_pointer_type for DWARF_Tag_Type_Common_type();

libgoblin/drd64_libgoblin_dwarf_tag_dispatch.h
libgoblin/drd64_libgoblin_dwarf_tag_type.c
libgoblin/drd64_libgoblin_dwarf_tag_type.h

index b26f561..138a1ad 100644 (file)
@@ -92,7 +92,7 @@ DWARF_TagFunction     dwarf_tag[LIBGOBLIN_DWARF_TAG_MAX]      = {
 { 0x0c,                                                        NULL },
 { DW_TAG_member,                               DWARF_Tag_Struct_UnImplement },         // 0x0d: struct
 { 0x0e,                                                        NULL },
-{ DW_TAG_pointer_type,                 DWARF_Tag_Type_pointer_type },          // 0x0f: type
+{ DW_TAG_pointer_type,                 DWARF_Tag_Type_Common_type },           // 0x0f: type
 
 { DW_TAG_reference_type,               DWARF_Tag_Type_UnImplement },           // 0x10: type
 { DW_TAG_compile_unit,                 DWARF_Tag_CompileUnit_compile_unit },// 0x11: compileunit
@@ -135,9 +135,9 @@ DWARF_TagFunction   dwarf_tag[LIBGOBLIN_DWARF_TAG_MAX]      = {
 { DW_TAG_try_block,                            DWARF_Tag_Exception_UnImplement },      // 0x32: exception
 { DW_TAG_variant_part,                 DWARF_Tag_NotClang_UnImplement },       // 0x33: notclang
 { DW_TAG_variable,                             DWARF_Tag_Parameter_UnImplement },      // 0x34: parameter
-{ DW_TAG_volatile_type,                        DWARF_Tag_Type_UnImplement },           // 0x35: type
+{ DW_TAG_volatile_type,                        DWARF_Tag_Type_Common_Type },           // 0x35: type
 { DW_TAG_dwarf_procedure,              NULL }, // 0x36
-{ DW_TAG_restrict_type,                        DWARF_Tag_Type_UnImplement },           // 0x37: type
+{ DW_TAG_restrict_type,                        DWARF_Tag_Type_Common_Type },           // 0x37: type
 { DW_TAG_interface_type,               DWARF_Tag_Class_UnImplement },          // 0x38: class
 { DW_TAG_namespace,                            DWARF_Tag_Class_UnImplement },          // 0x39: class
 { DW_TAG_imported_module,              DWARF_Tag_Class_UnImplement },          // 0x3a: class
index b58ddb1..0305a46 100644 (file)
@@ -69,14 +69,17 @@ int
 
 /*----------------------------------------------------------------------
   DW_TAG_pointer_type
+  DW_TAG_volatile_type
+  DW_TAG_restrict_type
+  DW_TAG_const_type
        DW_AT_type
-       DW_AT_name
+       DW_AT_name              (except DW_TAG_const_type)
        DW_AT_address_class
        DW_AT_count             (for UPC lnag. only)
 ----------------------------------------------------------------------*/
 LIBGOBLIN_DWARF_TAG_TYPE_EXTERN
 int
-       DWARF_Tag_Type_pointer_type(
+       DWARF_Tag_Type_Common_type(
                DWord                                   dw_tag,
                LibGoblin_BinaryInfo    *p_binfo,
                int                                             i_childlv,
@@ -119,8 +122,16 @@ int
 
        if( NULL != pval_name )
                { pobj_now->pstr_name   = pval_name->value.pstr_value; }
-       else
-               { pobj_now->pstr_name   = "*"; }
+       else    {
+               if( DW_TAG_pointer_type == dw_tag )
+                       { pobj_now->pstr_name   = "*"; }
+               else if( DW_TAG_const_type == dw_tag )
+                       { pobj_now->pstr_name   = "const"; }
+               else if( DW_TAG_restrict_type == dw_tag )
+                       { pobj_now->pstr_name   = "restrict"; }
+               else if( DW_TAG_volatile_type == dw_tag )
+                       { pobj_now->pstr_name   = "volatile"; }
+       }
 
        pobj_now->info.type.i_objid_type        = NO_OBJ;
        pobj_now->info.type.p_dwtype            = pb_link;
index fb3b3fa..9ce0394 100644 (file)
@@ -51,7 +51,7 @@ LIBGOBLIN_DWARF_TAG_TYPE_EXTERN
                                int i_childlv, LibGoblin_DWARF_Info_Ancestry *p_ancestry,
                                LibGoblin_DWARF_Info_CUHeader *p_cuheader );
 LIBGOBLIN_DWARF_TAG_TYPE_EXTERN
-       int DWARF_Tag_Type_pointer_type(
+       int DWARF_Tag_Type_Common_type(
                                DWord dw_tag, LibGoblin_BinaryInfo *p_binfo,
                                int i_childlv, LibGoblin_DWARF_Info_Ancestry *p_ancestry,
                                LibGoblin_DWARF_Info_CUHeader *p_cuheader );