XS-libdwarf

 view release on metacpan or  search on metacpan

libdwarf-code-0.11.1/src/lib/libdwarf/dwarf_opaque.h  view on Meta::CPAN

    Dwarf_Small     dss_ignore_reloc_group_sec;
    char dss_is_rela;
};

/*  Overview: if next_to_use== first, no error slots are used.
    If next_to_use+1 (mod maxcount) == first the slots are all used
*/
struct Dwarf_Harmless_s {
    unsigned dh_maxcount;
    unsigned dh_next_to_use;
    unsigned dh_first;
    unsigned dh_errs_count;
    char **  dh_errors;
};

/*  Data needed separately for debug_info and debug_types
    as we may be reading both interspersed.  So we always
    select the one we need. */
struct Dwarf_Debug_InfoTypes_s {
    /*  Context for the compilation_unit just read by a call to
        dwarf_next_cu_header. **Updated by dwarf_next_cu_header in
        dwarf_die_deliv.c */
    Dwarf_CU_Context de_cu_context;
    /*  Points to linked list of CU Contexts for the
        CU's already read.  These are only CU's read
        by dwarf_next_cu_header(). */
    Dwarf_CU_Context de_cu_context_list;
    /*  Points to the last CU Context added to the list by
        dwarf_next_cu_header(). */
    Dwarf_CU_Context de_cu_context_list_end;

    /*  Offset of last byte of last CU read.
        Actually one-past that last byte.  So
        use care and compare as offset >= de_last_offset
        to know if offset is too big. */
    Dwarf_Unsigned de_last_offset;
    /*  de_last_di_info_ptr and de_last_die are used with
        dwarf_siblingof, dwarf_child, and dwarf_validate_die_sibling.
        dwarf_validate_die_sibling will not give meaningful results
        if called inappropriately. */
    Dwarf_Byte_Ptr  de_last_di_ptr;
    Dwarf_Die  de_last_die;
};
typedef struct Dwarf_Debug_InfoTypes_s *Dwarf_Debug_InfoTypes;

/*  As the tasks performed on a debug related section is the same,
    in order to make the process of adding a new section
    (very unlikely) a little bit easy and to reduce the
    possibility of errors, a simple table
    build dynamically, will contain the relevant information.
*/

struct Dwarf_dbg_sect_s {
    /*  Debug section name must not be freed, is quoted string.
        This is the name from the object file itself. */
    const char    *ds_name;
    /* The section number in object section numbering. */
    Dwarf_Unsigned ds_number;
    /*   Debug section information, points to de_debug_*member
        (or the like) of the dbg struct.  */
    struct Dwarf_Section_s *ds_secdata;

    unsigned ds_groupnumber;
    int ds_duperr;            /* Error code for duplicated section */
    int ds_emptyerr;          /* Error code for empty section */
    int ds_have_dwarf;        /* Section contains DWARF */
    int ds_have_zdebug;       /* Section compressed: .zdebug name */
};

/*  As the number of debug sections does not change very often,
    in the case a
    new section is added in 'enter_section_in_array()'
    the 'MAX_DEBUG_SECTIONS' must
    be updated accordingly.
    This does not yet allow for section-groups in object files,
    for which many .debug_info (and other) sections may exist.
*/
#define DWARF_MAX_DEBUG_SECTIONS 50
#define DWARFSTRING_ALLOC_SIZE   200

/*  A 'magic number' to validate a Dwarf_Debug pointer is live.*/
#define DBG_IS_VALID 0xebfdebfd

/*  All the Dwarf_Debug tied-file info in one place.  */
struct Dwarf_Tied_Data_s {
    /*  Used to access executable from .dwo or .dwp object.
        Pointer to the tied_to Dwarf_Debug*/
    Dwarf_Debug td_tied_object;

    /*  Used for Type Unit signatures.
        Type Units are in .debug_types in DW4
        but in .debug_info in DW5.
        Some .debug_info point to them symbolically
        via DW_AT_signature attributes.
        If non-zero is a dwarf_tsearch 'tree'.
        Only non-zero if
        we had a reason to build the search tree..
        Type Units have a Dwarf_Sig8 signature
        in the header, and such is recorded here.

        Type Unit signatures can conflict with
        signatures in split-dwarf (dwo/dwp) sections.

        The Key for each record is a Dwarf_Sig8 (8 bytes).
        The data for each is a pointer to a Dwarf_CU_Context
        record in this dbg (cu_context in
        one of tied dbg's de_cu_context_list). */
    void *td_tied_search;

};

/*  dg_groupnum 0 does not exist.
    dg_groupnum 1 is base
    dg_groupnum 2 is dwo
    dg_groupnum 3 and higher are COMDAT groups (if any).

    We assume the number of groups will not exceed
    event the Windows 16 bit int maximum.
*/
struct Dwarf_Group_Data_s {
    /* For traditional DWARF the value is one, just one group. */



( run in 0.618 second using v1.01-cache-2.11-cpan-39bf76dae61 )