OSDN Git Service

(LibGoblin)
[drdeamon64/drdeamon64.git] / libgoblin / drd64_libgoblin_type.h
index c2bd234..99cbe01 100644 (file)
@@ -39,11 +39,12 @@ Comment:
 
 
 /*=====================================================================*/
+/*
 typedef union  {
        int             i_obj_id;
        Byte    *pb_info;
 } LibGoblin_ObjInfo_Link;
-
+*/
 
 /*=====================================================================*/
 typedef        struct  {
@@ -53,73 +54,6 @@ typedef      struct  {
 
 
 /*=====================================================================*/
-typedef struct  {
-       QWord   qw_unitsize;
-       Word    w_version;
-       Byte    b_pointersize;
-       Byte    b_bits;
-       Byte    b_offsetsize;
-       QWord   qw_abbrev_offset;
-       Byte    *pb_custart;
-
-       QWord   qw_type_signature;      // for DWARF4
-       QWord   qw_type_offset;         // for DWARF4
-} LibGoblin_DWARF_Info_CUHeader;
-
-
-/*=====================================================================*/
-#define        DWARF_ABBREV_MAXITEMS   30
-
-typedef struct {
-       DWord   dw_id;
-       DWord   dw_tag;
-       Byte    b_children;
-       int             i_items;
-       DWord   dw_attribute[ DWARF_ABBREV_MAXITEMS ];
-       DWord   dw_format[ DWARF_ABBREV_MAXITEMS ];
-} DWARF_AbbrevEntry;
-
-
-/*=====================================================================*/
-#define        LIBGOBLIN_DWARF_INFO_TYPE_NONE          0x00
-#define        LIBGOBLIN_DWARF_INFO_TYPE_BYTE          0x01
-#define        LIBGOBLIN_DWARF_INFO_TYPE_WORD          0x02
-#define        LIBGOBLIN_DWARF_INFO_TYPE_DWORD         0x03
-#define        LIBGOBLIN_DWARF_INFO_TYPE_QWORD         0x04
-#define        LIBGOBLIN_DWARF_INFO_TYPE_INT64         0x05
-#define        LIBGOBLIN_DWARF_INFO_TYPE_POINTER       0x06
-#define        LIBGOBLIN_DWARF_INFO_TYPE_STRING        0x07
-#define        LIBGOBLIN_DWARF_INFO_TYPE_BLOCK         0x08
-#define        LIBGOBLIN_DWARF_INFO_TYPE_LINK          0x09
-
-typedef struct {
-       Byte    b_type;
-       QWord   qw_size;
-       DWord   dw_format;
-
-       union   {
-               Byte    b_value;
-               Word    w_value;
-               DWord   dw_value;
-               QWord   qw_value;
-               QWord   qw_link;
-               Int64   ii_value;
-               void    *p_value;
-               Byte    *pb_link;
-               char    *pstr_value;
-               Byte    *pb_data;               // for BlockData
-       } value;
-} LibGoblin_DWARF_DIEValue;
-
-
-/*=====================================================================*/
-typedef struct {
-       DWord                           dw_attribute;
-       LibGoblin_DWARF_DIEValue        *p_val;
-} LibGoblin_DWARF_Attribute;
-
-
-/*=====================================================================*/
 typedef struct {
        Byte    *pb_sechdr;
        Byte    *pb_data;               // FileLocation (Offset)
@@ -157,17 +91,20 @@ typedef struct     {
 #define        OBJINFO_STATUS_SOLVED   0x00001000
 
 #define        OBJINFO_TYPE_NULL                       0x00
-#define        OBJINFO_TYPE_PROGRAM            0x01
-#define        OBJINFO_TYPE_MASTER                     0x02
+#define        OBJINFO_TYPE_MASTER                     0x01
+#define        OBJINFO_TYPE_PROGRAM            0x02
 #define        OBJINFO_TYPE_PROGHDR            0x03
 #define        OBJINFO_TYPE_SECTION            0x04
-#define        OBJINFO_TYPE_FUNCTION           0x05
-#define        OBJINFO_TYPE_OBJECT                     0x06
-#define        OBJINFO_TYPE_COMMON                     0x07
-#define        OBJINFO_TYPE_TLS                        0x08
-#define        OBJINFO_TYPE_REL                        0x09
-#define        OBJINFO_TYPE_TYPE_SINGLE        0x10
-#define        OBJINFO_TYPE_TYPE_MULTI         0x11
+#define        OBJINFO_TYPE_OBJFILE            0x05
+#define        OBJINFO_TYPE_TYPE_MULTI         0x06
+#define        OBJINFO_TYPE_TYPE_SINGLE        0x07
+#define        OBJINFO_TYPE_TYPEDEF            0x08
+#define        OBJINFO_TYPE_FUNCTION           0x09
+#define        OBJINFO_TYPE_OBJECT                     0x0a
+#define        OBJINFO_TYPE_COMMON                     0x0b
+#define        OBJINFO_TYPE_TLS                        0x0c
+#define        OBJINFO_TYPE_REL                        0x0d
+#define        OBJINFO_TYPE_NONE                       0x7f
 
 typedef        struct  {
        int             i_id;
@@ -220,10 +157,12 @@ typedef   struct  {
        union   {
                Byte            b_data[128];
 
+               // for OBJINFO_TYPE_PROGRAM
                struct  {
                        int             i_binfo_id;
                } program;
 
+               // for OBJINFO_TYPE_PROGHDR
                struct  {
                        DWord   dw_type;                // Entry type.
                        DWord   dw_flags;               // Access permission flags.
@@ -231,6 +170,7 @@ typedef     struct  {
                        void    *pv_proghdr;    // Program Header Pointer
                } proghdr;
 
+               // for OBJINFO_TYPE_SECTION
                struct  {
                        QWord   qw_flag;                // sh_flags - Section flags.
                        QWord   qw_align;               // sh_addralign - Alignment in bytes.
@@ -241,21 +181,41 @@ typedef   struct  {
                        void    *pv_sechdr;
                } section;
 
+               // for OBJINFO_TYPE_OBJFILE
                struct  {
-                       Byte    b_type;                 // st_info - Type and binding information.
-                       Byte    b_binding;              // st_info - Type and binding information.
-                       Byte    b_visibility;   // st_other - Reserved (not used).
-                       Word    w_secindex;             // st_shndx - Section index of symbol.
-               } symbol;
+                       int             i_objid_parent;
+                       int             i_abbrevs;
+                       DWARF_AbbrevEntry                               *p_abbrev;
+                       LibGoblin_DWARF_Info_CUHeader   t_cuheader;
+               } objfile;
 
                struct  {
                        DWord   dw_size;
-                       LibGoblin_ObjInfo_Link          t_link;
+                       Byte    b_encoding;
+                       Byte    b_bit_offset;
+                       Byte    b_bit_size;
+                       Byte    b_endianity;
+                       Byte    b_addr_class;
+                       Byte    b_prototyped;
                } type;
 
+               struct  {
+                       int             i_objid_parent;
+                       Byte    b_prototyped;
+                       Byte    b_external;
+                       Byte    b_inline;
+
+               } function;
        } info;
 
        struct  {
+               Byte    b_type;                 // st_info - Type and binding information.
+               Byte    b_binding;              // st_info - Type and binding information.
+               Byte    b_visibility;   // st_other - Reserved (not used).
+               Word    w_secindex;             // st_shndx - Section index of symbol.
+       } elfsym;
+
+       struct  {
                int             i_binfo_origin;
                int             i_dynsym_index;
 
@@ -266,10 +226,16 @@ typedef   struct  {
                int             i_objid_origin;
        } rel;
 
-       Byte    *pb_dwarf_info;
+       struct  {
+               Byte    *pb_info;
+
+               int             i_objid_type;
+               Byte    *pb_dwinfo_type;
+       } dwarf;
 
        int             i_secid;
        int             i_srcid;                // SourceInfo struct ID
+       DWord   dw_srcline;
 
        Byte    b_elf_flags;
        Word    w_secid;                // ==OLD== SectionInfo ItemIndex belong with this object.
@@ -291,7 +257,7 @@ typedef struct      {
        char    str_filename[DRD64_MAX_PATH];
        char    str_localpath[DRD64_MAX_PATH];
        char    str_srcpath[DRD64_MAX_PATH];    // for DW_AT_name
-       char    str_buildpath[DRD64_MAX_PATH];  // for DW_AT_comp_dir (Optional)
+       //char  str_buildpath[DRD64_MAX_PATH];  // for DW_AT_comp_dir (Optional)
 
        int             i_bfile_id;
        struct  {
@@ -355,6 +321,10 @@ typedef struct     {
                DWARF_AbbrevEntry       *p_abbrev;
                QWord                           qw_abbrev_unreadsz;
 
+               LibGoblin_Index_DWARFInfo       *p_offset;
+               int                                     i_alloced_offset;
+               int                                     i_max_offset;
+
                int                                     i_objfiles;
 
                int                                     i_maxvals;
@@ -410,7 +380,6 @@ typedef struct      {
 #define        LIBGOBLIN_DWARF_ATTR_EXT_MAX    53
 #define        LIBGOBLIN_DWARF_ATTR_MAX                (LIBGOBLIN_DWARF_ATTR_DEF_MAX + LIBGOBLIN_DWARF_ATTR_EXT_MAX)
 
-
 typedef struct {
        /* BinaryInfo Struct ID */
        int                     i_id;
@@ -456,7 +425,8 @@ typedef struct      {
                int                                                     i_extattrs;
                LibGoblin_DWARF_Attribute       t_attr[LIBGOBLIN_DWARF_ATTR_MAX+1];
 
-               int                                                     i_max_srcfiles;
+               int                                                     i_alloc_srctbl;
+               int                                                     i_max_srctbl;
                int                                                     *pi_srctbl; 
        } dwarf;
 
@@ -477,9 +447,6 @@ typedef     struct  {
                int                                             i_used;         // ObjectInfo Items
                int                                             i_topid;        // Top-Ptr ObjectInfo
 
-               LibGoblin_Index_DWARFInfo       *p_offset;
-               int                                             i_alloced_offset;
-               int                                             i_max_offset;
        } objinfo;
        LibGoblin_AddressInfo   *p_addrinfo;