OSDN Git Service

(LibGoblin)
authorKoine Yuusuke(koinec) <koinec@users.osdn.me>
Mon, 26 Aug 2019 21:56:40 +0000 (06:56 +0900)
committerKoine Yuusuke(koinec) <koinec@users.osdn.me>
Mon, 26 Aug 2019 21:56:40 +0000 (06:56 +0900)
  * WorkBackup

libgoblin/drd64_libgoblin_api.c
libgoblin/drd64_libgoblin_index_dwarfinfo.c

index bf47637..3585a42 100644 (file)
@@ -89,7 +89,7 @@ int
                                errno, (QWord)i_result, (QWord)0x00, __LINE__ );
                return -0x04;
        }
-/*
+
        i_result        = ObjectInfo_PostProc( p_pginfo, p_binfo );
        if( 0x00 != i_result )  {
                LibBrownie_Error_SetErrorInfo(
@@ -98,7 +98,7 @@ int
                                errno, (QWord)i_result, (QWord)0x00, __LINE__ );
                return -0x05;
        }
-*/
+
        // XXX: for DEBUG!
        Debug_ObjectInfo_Print_AllGroupLink( p_pginfo, 0xff );
 
index c122fa9..2e271db 100644 (file)
@@ -42,6 +42,44 @@ Comment:
 ----------------------------------------------------------------------*/
 LIBGOBLIN_INDEX_DWARFINFO_EXTERN
 int
+       Debug_Index_DWARFInfo_DumpObjectInfo(
+               LibGoblin_BinaryInfo    *p_binfo,
+               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 )
+               { puts("[DEBUG] Index Table(.debug_info => ObjectInfo ID) ---------------------"); }
+       
+       p_bfile =       BinaryFile_GetBinaryFile( p_binfo->i_binfile );
+       assert( NULL != p_bfile );
+
+       p_offbase       = 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",
+                                       i_cnt, p_offset->pb_dwinfo, p_offset->i_obj_id );
+       }
+
+       if( 0x00 < b_level )
+               { puts("-----------------------------------------------------------------------\n"); }
+
+       return i_objid;
+}
+
+
+/*----------------------------------------------------------------------
+----------------------------------------------------------------------*/
+LIBGOBLIN_INDEX_DWARFINFO_EXTERN
+int
        Index_DWARFInfo_SearchObjectInfo(
                LibGoblin_BinaryInfo    *p_binfo,
                Byte    *pb_dwinfo )
@@ -70,7 +108,7 @@ int
                else if( p_offset->pb_dwinfo < pb_dwinfo )
                        { i_start       = (( i_now < i_end ) ? (i_now + 1) : i_end); }
                else    {
-                       i_objid = i_now;
+                       i_objid = p_offset->i_obj_id;
                        break;
                }
        }while( i_start != i_end );