OSDN Git Service

(LibGoblin)
authorKoine Yuusuke(koinec) <koinec@users.osdn.me>
Tue, 27 Aug 2019 12:26:51 +0000 (21:26 +0900)
committerKoine Yuusuke(koinec) <koinec@users.osdn.me>
Tue, 27 Aug 2019 12:26:51 +0000 (21:26 +0900)
  * WorkBackup

13 files changed:
libgoblin/drd64_libgoblin_api.c
libgoblin/drd64_libgoblin_dwarf_tag_array.c
libgoblin/drd64_libgoblin_dwarf_tag_class.c
libgoblin/drd64_libgoblin_dwarf_tag_compileunit.c
libgoblin/drd64_libgoblin_dwarf_tag_dispatch.c
libgoblin/drd64_libgoblin_dwarf_tag_exception.c
libgoblin/drd64_libgoblin_dwarf_tag_function.c
libgoblin/drd64_libgoblin_dwarf_tag_notclang.c
libgoblin/drd64_libgoblin_dwarf_tag_parameter.c
libgoblin/drd64_libgoblin_dwarf_tag_struct.c
libgoblin/drd64_libgoblin_dwarf_tag_type.c
libgoblin/drd64_libgoblin_index_dwarfinfo.c
libgoblin/drd64_libgoblin_objinfo_postproc.c

index 3585a42..5cca00f 100644 (file)
@@ -99,6 +99,8 @@ int
                return -0x05;
        }
 
+       //Debug_Index_DWARFInfo_DumpObjectInfo( p_binfo, 0xff );
+
        // XXX: for DEBUG!
        Debug_ObjectInfo_Print_AllGroupLink( p_pginfo, 0xff );
 
index 3991a19..980845a 100644 (file)
@@ -58,7 +58,7 @@ int
        printf( "  UnImplement DWARF Tag(Array): %s [%02xh]\n",
                                                        Debug_DWARF_GetTAGname( dw_tag ), dw_tag );
 
-       return 0x00;
+       return NO_OBJ;
 }
 
 /*----------------------------------------------------------------------
index 0b61891..10bd96b 100644 (file)
@@ -64,7 +64,7 @@ int
        printf( "  UnImplement DWARF Tag(Class): %s [%02xh]\n",
                                                        Debug_DWARF_GetTAGname( dw_tag ), dw_tag );
 
-       return 0x00;
+       return NO_OBJ;
 }
 
 /*----------------------------------------------------------------------
index 8f94b34..2323521 100644 (file)
@@ -56,7 +56,7 @@ int
        printf( "  UnImplement DWARF Tag(CompileUnit): %s [%02xh]\n",
                                        Debug_DWARF_GetTAGname( dw_tag ), dw_tag );
 
-       return 0x00;
+       return NO_OBJ;
 }
 
 
index 3971b12..78a91fc 100644 (file)
@@ -50,7 +50,7 @@ int
 {
        // XXX 
        printf( "  ERROR: Unknown DWARF Tag: %02xh\n", dw_tag);
-       return 0x00;
+       return NO_OBJ;
 }
 
 
index 69e0fd7..daa3180 100644 (file)
@@ -56,7 +56,7 @@ int
 {
        printf( "  UnImplement DWARF Tag(Exception): %s [%02xh]\n",
                                                        Debug_DWARF_GetTAGname( dw_tag ), dw_tag );
-       return 0x00;
+       return NO_OBJ;
 }
 
 /*----------------------------------------------------------------------
index a2da31f..b6eb3b4 100644 (file)
@@ -56,7 +56,7 @@ int
 {
        printf( "  UnImplement DWARF Tag(Function): %s [%02xh]\n",
                                                        Debug_DWARF_GetTAGname( dw_tag ), dw_tag );
-       return 0x00;
+       return NO_OBJ;
 }
 
 
@@ -89,7 +89,7 @@ int
 
        printf( "  UnImplement DW_TAG_subprogram: %s [%02xh]\n",
                                                        Debug_DWARF_GetTAGname( dw_tag ), dw_tag );
-       return 0x00;
+       return NO_OBJ;
 }
 
 
index 8da262f..d75a445 100644 (file)
@@ -72,7 +72,7 @@ int
 {
        printf( "  UnImplement DWARF Tag(Not C/C++ Lang.): %s [%02xh]\n",
                                                        Debug_DWARF_GetTAGname( dw_tag ), dw_tag );
-       return 0x00;
+       return NO_OBJ;
 }
 
 /*----------------------------------------------------------------------
index c83f0ce..6c56c18 100644 (file)
@@ -57,7 +57,7 @@ int
 {
        printf( "  UnImplement DWARF Tag(Parameter): %s [%02xh]\n",
                                                        Debug_DWARF_GetTAGname( dw_tag ), dw_tag );
-       return 0x00;
+       return NO_OBJ;
 }
 
 /*----------------------------------------------------------------------
index 5d8b175..f8dfdf3 100644 (file)
@@ -58,7 +58,7 @@ int
        printf( "  UnImplement DWARF Tag(Struct): %s [%02xh]\n",
                                                        Debug_DWARF_GetTAGname( dw_tag ), dw_tag );
 
-       return 0x00;
+       return NO_OBJ;
 }
 
 /*----------------------------------------------------------------------
index ea4b9d7..951b2e2 100644 (file)
@@ -63,7 +63,7 @@ int
        printf( "  UnImplement DWARF Tag(Type): %s [%02xh]\n",
                                        Debug_DWARF_GetTAGname( dw_tag ), dw_tag );
 
-       return 0x00;
+       return NO_OBJ;
 }
 
 
index 2e271db..73c73b4 100644 (file)
@@ -47,13 +47,9 @@ int
                Byte    b_level )
 {
        int                                                     i_objid = NO_OBJ;
-       int                                                     i_start;
-       int                                                     i_end;
-       int                                                     i_now;
        int                                                     i_cnt;
        LibGoblin_BinaryFile            *p_bfile;
        LibGoblin_Index_DWARFInfo       *p_offset;
-       LibGoblin_Index_DWARFInfo       *p_offbase;
 
 
        if( 0x00 < b_level )
@@ -62,7 +58,7 @@ int
        p_bfile =       BinaryFile_GetBinaryFile( p_binfo->i_binfile );
        assert( NULL != p_bfile );
 
-       p_offbase       = p_bfile->dwarf.p_offset;
+       p_offset        = p_bfile->dwarf.p_offset;
 
        for( i_cnt = 0; i_cnt < p_bfile->dwarf.i_max_offset; i_cnt++, p_offset++ )      {
                printf("  [%3d]  %8ph -> ObjID: %3d\n",
@@ -91,27 +87,29 @@ int
        LibGoblin_BinaryFile            *p_bfile;
        LibGoblin_Index_DWARFInfo       *p_offset;
        LibGoblin_Index_DWARFInfo       *p_offbase;
-       
+
        p_bfile =       BinaryFile_GetBinaryFile( p_binfo->i_binfile );
        assert( NULL != p_bfile );
 
+       if( 0 == p_bfile->dwarf.i_max_offset )  { return NO_OBJ; }
+
        p_offbase       = p_bfile->dwarf.p_offset;
 
        i_start = 0;
-       i_end   = p_bfile->dwarf.i_max_offset;
+       i_end   = p_bfile->dwarf.i_max_offset - 1;
 
        do      {
                i_now           = (i_start + i_end) / 2;
                p_offset        = p_offbase + i_now;
                if( pb_dwinfo < p_offset->pb_dwinfo )
-                       { i_end         = (( 0 < i_now ) ? (i_now - 1) : 0); }
+                       { i_end         = i_now; }
                else if( p_offset->pb_dwinfo < pb_dwinfo )
                        { i_start       = (( i_now < i_end ) ? (i_now + 1) : i_end); }
                else    {
                        i_objid = p_offset->i_obj_id;
                        break;
                }
-       }while( i_start != i_end );
+       }while( i_start < i_end );
 
        return i_objid;
 }
index 16d7815..11557f4 100644 (file)
@@ -59,9 +59,18 @@ int
 
        pb_dwinfo               = pobj_now->info.type.p_dwtype;
        i_objid_parent  = Index_DWARFInfo_SearchObjectInfo( p_binfo, pb_dwinfo );
+
+/*
+       printf("  Link: ObjID=%d dwinfo=%8ph -> LinkAddr=%8p  => parent: %d (old: %d)\n",
+                               pobj_now->i_id, pobj_now->dwarf.pb_info, pobj_now->info.type.p_dwtype,
+                               i_objid_parent, pobj_now->grplink.i_parent_id );
+*/
+
        if( NO_OBJ != i_objid_parent )  {
                pobj_parent     = OBJINFO( p_pginfo, i_objid_parent );
                i_result        = ObjectInfo_AdoptObjectInfo( p_pginfo, pobj_parent, pobj_now );
+               
+               pobj_now->info.type.i_objid_type        = i_objid_parent;
        }
 
 goto_ObjectInfo_PostProc_ResolvTypeLink_post: