17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate
307dc194Richard Lowe  Copyright (C) 2000-2010 Silicon Graphics, Inc.  All Rights Reserved.
407dc194Richard Lowe  Portions Copyright 2007-2010 Sun Microsystems, Inc. All rights reserved.
54d9fdb4Robert Mustacchi  Portions Copyright 2008-2018 David Anderson. All rights reserved.
607dc194Richard Lowe  Portions Copyright 2008-2010 Arxan Technologies, Inc. All rights reserved.
74d9fdb4Robert Mustacchi  Portions Copyright 2010-2012 SN Systems Ltd. All rights reserved.
84d9fdb4Robert Mustacchi
94d9fdb4Robert Mustacchi  This program is free software; you can redistribute it
104d9fdb4Robert Mustacchi  and/or modify it under the terms of version 2.1 of the
114d9fdb4Robert Mustacchi  GNU Lesser General Public License as published by the Free
124d9fdb4Robert Mustacchi  Software Foundation.
134d9fdb4Robert Mustacchi
144d9fdb4Robert Mustacchi  This program is distributed in the hope that it would be
154d9fdb4Robert Mustacchi  useful, but WITHOUT ANY WARRANTY; without even the implied
164d9fdb4Robert Mustacchi  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
174d9fdb4Robert Mustacchi  PURPOSE.
184d9fdb4Robert Mustacchi
194d9fdb4Robert Mustacchi  Further, this software is distributed without any warranty
204d9fdb4Robert Mustacchi  that it is free of the rightful claim of any third person
214d9fdb4Robert Mustacchi  regarding infringement or the like.  Any license provided
224d9fdb4Robert Mustacchi  herein, whether implied or otherwise, applies only to this
234d9fdb4Robert Mustacchi  software file.  Patent licenses, if any, provided herein
244d9fdb4Robert Mustacchi  do not apply to combinations of this program with other
254d9fdb4Robert Mustacchi  software, or any other product whatsoever.
264d9fdb4Robert Mustacchi
274d9fdb4Robert Mustacchi  You should have received a copy of the GNU Lesser General
284d9fdb4Robert Mustacchi  Public License along with this program; if not, write the
294d9fdb4Robert Mustacchi  Free Software Foundation, Inc., 51 Franklin Street - Fifth
304d9fdb4Robert Mustacchi  Floor, Boston MA 02110-1301, USA.
317c478bdstevel@tonic-gate
327c478bdstevel@tonic-gate*/
337c478bdstevel@tonic-gate
347c478bdstevel@tonic-gate
357c478bdstevel@tonic-gate#ifndef _LIBDWARF_H
367c478bdstevel@tonic-gate#define _LIBDWARF_H
377c478bdstevel@tonic-gate#ifdef __cplusplus
387c478bdstevel@tonic-gateextern "C" {
397c478bdstevel@tonic-gate#endif
407c478bdstevel@tonic-gate/*
414d9fdb4Robert Mustacchi    libdwarf.h
4207dc194Richard Lowe    $Revision: #9 $ $Date: 2008/01/17 $
437c478bdstevel@tonic-gate
4407dc194Richard Lowe    For libdwarf producers and consumers
457c478bdstevel@tonic-gate
4607dc194Richard Lowe    The interface is defined as having 8-byte signed and unsigned
4707dc194Richard Lowe    values so it can handle 64-or-32bit target on 64-or-32bit host.
484d9fdb4Robert Mustacchi    Dwarf_Ptr is the native size: it represents pointers on
4907dc194Richard Lowe    the host machine (not the target!).
507c478bdstevel@tonic-gate
5107dc194Richard Lowe    This contains declarations for types and all producer
5207dc194Richard Lowe    and consumer functions.
537c478bdstevel@tonic-gate
5407dc194Richard Lowe    Function declarations are written on a single line each here
5507dc194Richard Lowe    so one can use grep  to each declaration in its entirety.
5607dc194Richard Lowe    The declarations are a little harder to read this way, but...
577c478bdstevel@tonic-gate
584d9fdb4Robert Mustacchi    The seeming duplication of the Elf typedef allows
594d9fdb4Robert Mustacchi    both verification we have the right struct name (when
604d9fdb4Robert Mustacchi    libelf.h included before this) and
614d9fdb4Robert Mustacchi    creation of a local handle so we have the struct pointer
624d9fdb4Robert Mustacchi    here (if libelf.h is not included before this file).
634d9fdb4Robert Mustacchi
647c478bdstevel@tonic-gate*/
657c478bdstevel@tonic-gate
6649d3bc9Richard Lowestruct Elf;
6749d3bc9Richard Lowetypedef struct Elf* dwarf_elf_handle;
6849d3bc9Richard Lowe
6907dc194Richard Lowe/* To enable printing with printf regardless of the
704d9fdb4Robert Mustacchi   actual underlying data type, we define the DW_PR_xxx macros.
714d9fdb4Robert Mustacchi   To ensure uses of DW_PR_DUx or DW_PR_DSx look the way you want
724d9fdb4Robert Mustacchi   ensure the right DW_PR_XZEROS define is uncommented.
737c478bdstevel@tonic-gate*/
744d9fdb4Robert Mustacchi/*#define DW_PR_XZEROS "" */
754d9fdb4Robert Mustacchi#define DW_PR_XZEROS "08"
764d9fdb4Robert Mustacchi
774d9fdb4Robert Mustacchitypedef unsigned long long Dwarf_Unsigned;
784d9fdb4Robert Mustacchitypedef signed   long long Dwarf_Signed;
794d9fdb4Robert Mustacchitypedef unsigned long long Dwarf_Off;
804d9fdb4Robert Mustacchitypedef unsigned long long Dwarf_Addr;
814d9fdb4Robert Mustacchitypedef int                Dwarf_Bool;   /* boolean type */
824d9fdb4Robert Mustacchitypedef unsigned short     Dwarf_Half;   /* 2 byte unsigned value */
834d9fdb4Robert Mustacchitypedef unsigned char      Dwarf_Small;  /* 1 byte unsigned value */
844d9fdb4Robert Mustacchi/*  If sizeof(Dwarf_Half) is greater than 2
854d9fdb4Robert Mustacchi    we believe libdwarf still works properly. */
864d9fdb4Robert Mustacchi
874d9fdb4Robert Mustacchi#if defined(_WIN32) && defined(HAVE_NONSTANDARD_PRINTF_64_FORMAT)
884d9fdb4Robert Mustacchi#define DW_PR_DUx "I64x"
894d9fdb4Robert Mustacchi#define DW_PR_DSx "I64x"
904d9fdb4Robert Mustacchi#define DW_PR_DUu "I64u"
914d9fdb4Robert Mustacchi#define DW_PR_DSd "I64d"
924d9fdb4Robert Mustacchi#else
934d9fdb4Robert Mustacchi#define DW_PR_DUx "llx"
944d9fdb4Robert Mustacchi#define DW_PR_DSx "llx"
954d9fdb4Robert Mustacchi#define DW_PR_DUu "llu"
964d9fdb4Robert Mustacchi#define DW_PR_DSd "lld"
974d9fdb4Robert Mustacchi#endif /* DW_PR defines */
9807dc194Richard Lowe
9907dc194Richard Lowetypedef void*        Dwarf_Ptr;          /* host machine pointer */
10007dc194Richard Lowe
1014d9fdb4Robert Mustacchi/*  DWARF5: a container for a DW_FORM_data16 data item.
1024d9fdb4Robert Mustacchi    We have no integer types suitable so this special
1034d9fdb4Robert Mustacchi    struct is used instead.  It is up to consumers/producers
1044d9fdb4Robert Mustacchi    to deal with the contents.
1054d9fdb4Robert Mustacchi    New October 18, 2017 .  */
1064d9fdb4Robert Mustacchitypedef struct Dwarf_Form_Data16_s {
1074d9fdb4Robert Mustacchi    unsigned char fd_data[16];
1084d9fdb4Robert Mustacchi} Dwarf_Form_Data16;
1094d9fdb4Robert Mustacchi
1104d9fdb4Robert Mustacchi
1114d9fdb4Robert Mustacchi
1124d9fdb4Robert Mustacchi/* Used for signatures where ever they appear.
1134d9fdb4Robert Mustacchi   It is not a string, it
11407dc194Richard Lowe   is 8 bytes of a signature one would use to find
11507dc194Richard Lowe   a type unit. See dwarf_formsig8()
1164d9fdb4Robert Mustacchi
1174d9fdb4Robert Mustacchi   Sometimes it is used in calculations as
1184d9fdb4Robert Mustacchi   Dwarf_Unsigned, but that is done inside libdwarf
1194d9fdb4Robert Mustacchi   and the endianness question makes it a bit sketchy.
12007dc194Richard Lowe*/
1214d9fdb4Robert Mustacchistruct Dwarf_Sig8_s  {
12207dc194Richard Lowe    char signature[8];
1234d9fdb4Robert Mustacchi};
1244d9fdb4Robert Mustacchitypedef struct Dwarf_Sig8_s Dwarf_Sig8;
1257c478bdstevel@tonic-gate
12649d3bc9Richard Lowe/* Contains info on an uninterpreted block of data
1274d9fdb4Robert Mustacchi   Used with certain frame information functions and
1284d9fdb4Robert Mustacchi   also used with DW_FORM_block<>.
1297c478bdstevel@tonic-gate*/
1307c478bdstevel@tonic-gatetypedef struct {
1314d9fdb4Robert Mustacchi    Dwarf_Unsigned  bl_len;         /* length of block bl_data points at */
13207dc194Richard Lowe    Dwarf_Ptr       bl_data;        /* uninterpreted data */
1334d9fdb4Robert Mustacchi
1344d9fdb4Robert Mustacchi    /*  See libdwarf.h DW_LKIND*  */
1354d9fdb4Robert Mustacchi    Dwarf_Small     bl_from_loclist;
1364d9fdb4Robert Mustacchi
1374d9fdb4Robert Mustacchi    /* Section (not CU) offset which 'data' comes from. */
1384d9fdb4Robert Mustacchi    Dwarf_Unsigned  bl_section_offset;
1397c478bdstevel@tonic-gate} Dwarf_Block;
1407c478bdstevel@tonic-gate
1417c478bdstevel@tonic-gate
1424d9fdb4Robert Mustacchi/*  NEW October 2015.  */
1434d9fdb4Robert Mustacchi/*  This provides access to Dwarf_Locdesc_c, a single
1444d9fdb4Robert Mustacchi    location description */
1454d9fdb4Robert Mustacchistruct  Dwarf_Locdesc_c_s;
1464d9fdb4Robert Mustacchitypedef struct Dwarf_Locdesc_c_s * Dwarf_Locdesc_c;
1474d9fdb4Robert Mustacchi
1484d9fdb4Robert Mustacchi/*  NEW October 2015.  */
1494d9fdb4Robert Mustacchi/*  This provides access to Dwarf_Locdesc_c, a single
1504d9fdb4Robert Mustacchi    location list entry (or for a locexpr, the fake
1514d9fdb4Robert Mustacchi    Loc_Head for the locexpr) */
1524d9fdb4Robert Mustacchistruct Dwarf_Loc_Head_c_s;
1534d9fdb4Robert Mustacchitypedef struct Dwarf_Loc_Head_c_s * Dwarf_Loc_Head_c;
1544d9fdb4Robert Mustacchi
1554d9fdb4Robert Mustacchi/* NEW November 2015. For DWARF5 .debug_macro section */
1564d9fdb4Robert Mustacchistruct Dwarf_Macro_Context_s;
1574d9fdb4Robert Mustacchitypedef struct Dwarf_Macro_Context_s * Dwarf_Loc_Macro_Context;
1584d9fdb4Robert Mustacchi
1594d9fdb4Robert Mustacchi/*  NEW September 2016. Allows easy access to DW_AT_discr_list
1604d9fdb4Robert Mustacchi    array of discriminant values. Input in blockpointer
1614d9fdb4Robert Mustacchi    is a block with a list of uleb or sleb numbers
1624d9fdb4Robert Mustacchi    (all one or the other, lebunsignedflag instructs
1634d9fdb4Robert Mustacchi    how to read the leb values properly) */
1644d9fdb4Robert Mustacchitypedef struct Dwarf_Dsc_Head_s * Dwarf_Dsc_Head;
1654d9fdb4Robert Mustacchi
1664d9fdb4Robert Mustacchi/*  Location record. Records up to 2 operand values.
1674d9fdb4Robert Mustacchi    Not usable with DWARF5 or DWARF4 with location
1684d9fdb4Robert Mustacchi    operator  extensions. */
1697c478bdstevel@tonic-gatetypedef struct {
17007dc194Richard Lowe    Dwarf_Small     lr_atom;        /* location operation */
17107dc194Richard Lowe    Dwarf_Unsigned  lr_number;      /* operand */
1724d9fdb4Robert Mustacchi    Dwarf_Unsigned  lr_number2;     /* for OP_BREGx  and DW_OP_GNU_const_type*/
17307dc194Richard Lowe    Dwarf_Unsigned  lr_offset;      /* offset in locexpr for OP_BRA etc */
1747c478bdstevel@tonic-gate} Dwarf_Loc;
1757c478bdstevel@tonic-gate
1767c478bdstevel@tonic-gate
1774d9fdb4Robert Mustacchi/* Location description. DWARF 2,3,4.
1784d9fdb4Robert Mustacchi   When this is from a split-dwarf loclist (.debug_loc.dwo)
1794d9fdb4Robert Mustacchi   and no tied object is present
1804d9fdb4Robert Mustacchi   then ld_lowpc and ld_highpc are actually indices in
1814d9fdb4Robert Mustacchi   the .debug_addr section of the tied object).
1824d9fdb4Robert Mustacchi   If there is a tied object then these fields are actuall
1834d9fdb4Robert Mustacchi   addresses and DW_AT_addr_base in the skeleton CU DIE applies to
1844d9fdb4Robert Mustacchi   that .debug_addr.
1854d9fdb4Robert Mustacchi
1864d9fdb4Robert Mustacchi   Location record. Records up to 2 operand values.
1874d9fdb4Robert Mustacchi   Not usable with DWARF5 or DWARF4 with extensions.
1884d9fdb4Robert Mustacchi
1894d9fdb4Robert Mustacchi   If from DWARF2,3,4 non-split dwarf then things operate as
1904d9fdb4Robert Mustacchi   in DWARF2.
1914d9fdb4Robert Mustacchi   See dwarf_get_loclist_b() and the other related
1924d9fdb4Robert Mustacchi   new functions that
1934d9fdb4Robert Mustacchi   avoid using public structures Dwarf_Loc and Dwarf_Locdesc.
1947c478bdstevel@tonic-gate*/
1957c478bdstevel@tonic-gatetypedef struct {
1964d9fdb4Robert Mustacchi    /*  Beginning of active range. This is actually an offset
1974d9fdb4Robert Mustacchi        of an applicable base address, not a pc value.  */
1984d9fdb4Robert Mustacchi    Dwarf_Addr      ld_lopc;
1994d9fdb4Robert Mustacchi
2004d9fdb4Robert Mustacchi    /*  End of active range. This is actually an offset
2014d9fdb4Robert Mustacchi        of an applicable base address, not a pc value.  */
2024d9fdb4Robert Mustacchi    Dwarf_Addr      ld_hipc;
2034d9fdb4Robert Mustacchi
20407dc194Richard Lowe    Dwarf_Half      ld_cents;       /* count of location records */
20507dc194Richard Lowe    Dwarf_Loc*      ld_s;           /* pointer to list of same */
2064d9fdb4Robert Mustacchi
2074d9fdb4Robert Mustacchi    /*  non-0 if loclist, 1 if non-split (dwarf 2,3,4) */
2084d9fdb4Robert Mustacchi    Dwarf_Small     ld_from_loclist;
20907dc194Richard Lowe
21007dc194Richard Lowe    Dwarf_Unsigned  ld_section_offset; /* Section (not CU) offset
2114d9fdb4Robert Mustacchi        where loc-expr begins*/
2127c478bdstevel@tonic-gate} Dwarf_Locdesc;
2137c478bdstevel@tonic-gate
2144d9fdb4Robert Mustacchi/*  First appears in DWARF3, and only ranges entries exist.
2154d9fdb4Robert Mustacchi    The dwr_addr1/addr2 data is either an offset (DW_RANGES_ENTRY)
2164d9fdb4Robert Mustacchi    or an address (dwr_addr2 in DW_RANGES_ADDRESS_SELECTION) or
2174d9fdb4Robert Mustacchi    both are zero (DW_RANGES_END).
2184d9fdb4Robert Mustacchi    For DWARF5 each table starts with a header
2194d9fdb4Robert Mustacchi    followed by range list entries defined
2204d9fdb4Robert Mustacchi    as here.
22107dc194Richard Lowe*/
2224d9fdb4Robert Mustacchienum Dwarf_Ranges_Entry_Type { DW_RANGES_ENTRY,
22307dc194Richard Lowe    DW_RANGES_ADDRESS_SELECTION,
2244d9fdb4Robert Mustacchi    DW_RANGES_END
2254d9fdb4Robert Mustacchi};
22607dc194Richard Lowetypedef struct {
22707dc194Richard Lowe    Dwarf_Addr dwr_addr1;
2284d9fdb4Robert Mustacchi    Dwarf_Addr dwr_addr2;
22907dc194Richard Lowe    enum Dwarf_Ranges_Entry_Type  dwr_type;
23007dc194Richard Lowe} Dwarf_Ranges;
23107dc194Richard Lowe
2327c478bdstevel@tonic-gate/* Frame description instructions expanded.
2337c478bdstevel@tonic-gate*/
2347c478bdstevel@tonic-gatetypedef struct {
23507dc194Richard Lowe    Dwarf_Small     fp_base_op;
23607dc194Richard Lowe    Dwarf_Small     fp_extended_op;
23707dc194Richard Lowe    Dwarf_Half      fp_register;
23807dc194Richard Lowe
2394d9fdb4Robert Mustacchi    /*  Value may be signed, depends on op.
2404d9fdb4Robert Mustacchi        Any applicable data_alignment_factor has
2414d9fdb4Robert Mustacchi        not been applied, this is the  raw offset. */
24207dc194Richard Lowe    Dwarf_Unsigned  fp_offset;
24307dc194Richard Lowe    Dwarf_Off       fp_instr_offset;
24407dc194Richard Lowe} Dwarf_Frame_Op; /* DWARF2 */
24507dc194Richard Lowe
24607dc194Richard Lowe/*  ***IMPORTANT NOTE, TARGET DEPENDENCY ****
2474d9fdb4Robert Mustacchi    DW_REG_TABLE_SIZE must be at least as large as
2484d9fdb4Robert Mustacchi    the number of registers
2494d9fdb4Robert Mustacchi    (DW_FRAME_LAST_REG_NUM) as defined in dwarf.h
2504d9fdb4Robert Mustacchi    Preferably identical to DW_FRAME_LAST_REG_NUM.
2514d9fdb4Robert Mustacchi    Ensure [0-DW_REG_TABLE_SIZE] does not overlap
2524d9fdb4Robert Mustacchi    DW_FRAME_UNDEFINED_VAL or DW_FRAME_SAME_VAL.
2534d9fdb4Robert Mustacchi    Also ensure DW_FRAME_REG_INITIAL_VALUE is set to what
2544d9fdb4Robert Mustacchi    is appropriate to your cpu.
2554d9fdb4Robert Mustacchi    For various CPUs  DW_FRAME_UNDEFINED_VAL is correct
2564d9fdb4Robert Mustacchi    as the value for DW_FRAME_REG_INITIAL_VALUE.
2574d9fdb4Robert Mustacchi
2584d9fdb4Robert Mustacchi    For consumer apps, this can be set dynamically: see
2594d9fdb4Robert Mustacchi    dwarf_set_frame_rule_table_size(); */
26007dc194Richard Lowe#ifndef DW_REG_TABLE_SIZE
2617c478bdstevel@tonic-gate#define DW_REG_TABLE_SIZE  66
26207dc194Richard Lowe#endif
26307dc194Richard Lowe
2644d9fdb4Robert Mustacchi/* For MIPS, DW_FRAME_SAME_VAL is the correct default value
26507dc194Richard Lowe   for a frame register value. For other CPUS another value
26607dc194Richard Lowe   may be better, such as DW_FRAME_UNDEFINED_VAL.
26707dc194Richard Lowe   See dwarf_set_frame_rule_table_size
26807dc194Richard Lowe*/
26907dc194Richard Lowe#ifndef DW_FRAME_REG_INITIAL_VALUE
27007dc194Richard Lowe#define DW_FRAME_REG_INITIAL_VALUE DW_FRAME_SAME_VAL
27107dc194Richard Lowe#endif
27207dc194Richard Lowe
27307dc194Richard Lowe/* Taken as meaning 'undefined value', this is not
27407dc194Richard Lowe   a column or register number.
27507dc194Richard Lowe   Only present at libdwarf runtime in the consumer
27607dc194Richard Lowe   interfaces. Never on disk.
27707dc194Richard Lowe   DW_FRAME_* Values present on disk are in dwarf.h
27807dc194Richard Lowe   Ensure this is > DW_REG_TABLE_SIZE (the reg table
27907dc194Richard Lowe   size is changeable at runtime with the *reg3() interfaces,
28007dc194Richard Lowe   and this value must be greater than the reg table size).
28107dc194Richard Lowe*/
28207dc194Richard Lowe#define DW_FRAME_UNDEFINED_VAL          1034
28307dc194Richard Lowe
28407dc194Richard Lowe/* Taken as meaning 'same value' as caller had, not a column
28507dc194Richard Lowe   or register number.
28607dc194Richard Lowe   Only present at libdwarf runtime in the consumer
28707dc194Richard Lowe   interfaces. Never on disk.
28807dc194Richard Lowe   DW_FRAME_* Values present on disk are in dwarf.h
28907dc194Richard Lowe   Ensure this is > DW_REG_TABLE_SIZE (the reg table
29007dc194Richard Lowe   size is changeable at runtime with the *reg3() interfaces,
29107dc194Richard Lowe   and this value must be greater than the reg table size).
29207dc194Richard Lowe*/
29307dc194Richard Lowe#define DW_FRAME_SAME_VAL               1035
29407dc194Richard Lowe
29507dc194Richard Lowe/* For DWARF3 consumer interfaces, make the CFA a column with no
29607dc194Richard Lowe   real table number.  This is what should have been done
29707dc194Richard Lowe   for the DWARF2 interfaces.  This actually works for
29807dc194Richard Lowe   both DWARF2 and DWARF3, but see the libdwarf documentation
29907dc194Richard Lowe   on Dwarf_Regtable3 and  dwarf_get_fde_info_for_reg3()
3004d9fdb4Robert Mustacchi   and  dwarf_get_fde_info_for_all_regs3()
30107dc194Richard Lowe   Do NOT use this with the older dwarf_get_fde_info_for_reg()
30207dc194Richard Lowe   or dwarf_get_fde_info_for_all_regs() consumer interfaces.
30307dc194Richard Lowe   Must be higher than any register count for *any* ABI
30407dc194Richard Lowe   (ensures maximum applicability with minimum effort).
30507dc194Richard Lowe   Ensure this is > DW_REG_TABLE_SIZE (the reg table
30607dc194Richard Lowe   size is changeable at runtime with the *reg3() interfaces,
30707dc194Richard Lowe   and this value must be greater than the reg table size).
30807dc194Richard Lowe   Only present at libdwarf runtime in the consumer
30907dc194Richard Lowe   interfaces. Never on disk.
31007dc194Richard Lowe*/
31107dc194Richard Lowe#define DW_FRAME_CFA_COL3               1436
31207dc194Richard Lowe
31307dc194Richard Lowe/* The following are all needed to evaluate DWARF3 register rules.
31407dc194Richard Lowe*/
31507dc194Richard Lowe#define DW_EXPR_OFFSET 0  /* DWARF2 only sees this. */
31607dc194Richard Lowe#define DW_EXPR_VAL_OFFSET 1
31707dc194Richard Lowe#define DW_EXPR_EXPRESSION 2
31807dc194Richard Lowe#define DW_EXPR_VAL_EXPRESSION 3
31907dc194Richard Lowe
32007dc194Richard Lowetypedef struct Dwarf_Regtable_Entry_s {
32107dc194Richard Lowe    /*  For each index i (naming a hardware register with dwarf number
3224d9fdb4Robert Mustacchi        i) the following is true and defines the value of that register:
3234d9fdb4Robert Mustacchi
3244d9fdb4Robert Mustacchi        If dw_regnum is Register DW_FRAME_UNDEFINED_VAL
3254d9fdb4Robert Mustacchi            it is not DWARF register number but
3264d9fdb4Robert Mustacchi            a place holder indicating the register has no defined value.
3274d9fdb4Robert Mustacchi        If dw_regnum is Register DW_FRAME_SAME_VAL
3284d9fdb4Robert Mustacchi            it  is not DWARF register number but
3294d9fdb4Robert Mustacchi            a place holder indicating the register has the same
3304d9fdb4Robert Mustacchi            value in the previous frame.
3314d9fdb4Robert Mustacchi
3324d9fdb4Robert Mustacchi            DW_FRAME_UNDEFINED_VAL, DW_FRAME_SAME_VAL are
3334d9fdb4Robert Mustacchi            only present at libdwarf runtime. Never on disk.
3344d9fdb4Robert Mustacchi            DW_FRAME_* Values present on disk are in dwarf.h
3354d9fdb4Robert Mustacchi
3364d9fdb4Robert Mustacchi        Otherwise: the register number is a DWARF register number
3374d9fdb4Robert Mustacchi            (see ABI documents for how this translates to hardware/
3384d9fdb4Robert Mustacchi            software register numbers in the machine hardware)
3394d9fdb4Robert Mustacchi            and the following applies:
3404d9fdb4Robert Mustacchi
3414d9fdb4Robert Mustacchi            if dw_value_type == DW_EXPR_OFFSET (the only case for dwarf2):
3424d9fdb4Robert Mustacchi                If dw_offset_relevant is non-zero, then
3434d9fdb4Robert Mustacchi                    the value is stored at at the address CFA+N where
3444d9fdb4Robert Mustacchi                    N is a signed offset.
3454d9fdb4Robert Mustacchi                    Rule: Offset(N)
3464d9fdb4Robert Mustacchi                If dw_offset_relevant is zero, then the value of the register
3474d9fdb4Robert Mustacchi                    is the value of (DWARF) register number dw_regnum.
3484d9fdb4Robert Mustacchi                    Rule: register(F)
3494d9fdb4Robert Mustacchi            Other values of dw_value_type are an error.
3504d9fdb4Robert Mustacchi    */
35107dc194Richard Lowe    Dwarf_Small         dw_offset_relevant;
35207dc194Richard Lowe
35307dc194Richard Lowe    /* For DWARF2, always 0 */
3544d9fdb4Robert Mustacchi    Dwarf_Small         dw_value_type;
35507dc194Richard Lowe
35607dc194Richard Lowe    Dwarf_Half          dw_regnum;
35707dc194Richard Lowe
3584d9fdb4Robert Mustacchi    /*  The data type here should  the larger of Dwarf_Addr
3594d9fdb4Robert Mustacchi        and Dwarf_Unsigned and Dwarf_Signed. */
36007dc194Richard Lowe    Dwarf_Addr          dw_offset;
36107dc194Richard Lowe} Dwarf_Regtable_Entry;
36207dc194Richard Lowe
36307dc194Richard Lowetypedef struct Dwarf_Regtable_s {
36407dc194Richard Lowe    struct Dwarf_Regtable_Entry_s rules[DW_REG_TABLE_SIZE];
3657c478bdstevel@tonic-gate} Dwarf_Regtable;
3667c478bdstevel@tonic-gate
36707dc194Richard Lowe/* opaque type. Functional interface shown later. */
36807dc194Richard Lowestruct Dwarf_Reg_value3_s;
3694d9fdb4Robert Mustacchitypedef struct Dwarf_Reg_value3_s Dwarf_Reg_Value3;
37007dc194Richard Lowe
37107dc194Richard Lowetypedef struct Dwarf_Regtable_Entry3_s {
3724d9fdb4Robert Mustacchi/*  For each index i (naming a hardware register with dwarf number
3734d9fdb4Robert Mustacchi    i) the following is true and defines the value of that register:
3744d9fdb4Robert Mustacchi
3754d9fdb4Robert Mustacchi        If dw_regnum is Register DW_FRAME_UNDEFINED_VAL
3764d9fdb4Robert Mustacchi            it is not DWARF register number but
3774d9fdb4Robert Mustacchi            a place holder indicating the register has no defined value.
3784d9fdb4Robert Mustacchi        If dw_regnum is Register DW_FRAME_SAME_VAL
3794d9fdb4Robert Mustacchi            it  is not DWARF register number but
3804d9fdb4Robert Mustacchi            a place holder indicating the register has the same
3814d9fdb4Robert Mustacchi            value in the previous frame.
3824d9fdb4Robert Mustacchi
3834d9fdb4Robert Mustacchi            DW_FRAME_UNDEFINED_VAL, DW_FRAME_SAME_VAL and
3844d9fdb4Robert Mustacchi            DW_FRAME_CFA_COL3 are only present at libdwarf runtime.
3854d9fdb4Robert Mustacchi            Never on disk.
3864d9fdb4Robert Mustacchi            DW_FRAME_* Values present on disk are in dwarf.h
3874d9fdb4Robert Mustacchi            Because DW_FRAME_SAME_VAL and DW_FRAME_UNDEFINED_VAL
3884d9fdb4Robert Mustacchi            and DW_FRAME_CFA_COL3 are definable at runtime
3894d9fdb4Robert Mustacchi            consider the names symbolic in this comment, not absolute.
3904d9fdb4Robert Mustacchi
3914d9fdb4Robert Mustacchi        Otherwise: the register number is a DWARF register number
39207dc194Richard Lowe            (see ABI documents for how this translates to hardware/
3934d9fdb4Robert Mustacchi            software register numbers in the machine hardware)
3944d9fdb4Robert Mustacchi            and the following applies:
39507dc194Richard Lowe
3964d9fdb4Robert Mustacchi        In a cfa-defining entry (rt3_cfa_rule) the regnum is the
3974d9fdb4Robert Mustacchi        CFA 'register number'. Which is some 'normal' register,
3984d9fdb4Robert Mustacchi        not DW_FRAME_CFA_COL3, nor DW_FRAME_SAME_VAL, nor
3994d9fdb4Robert Mustacchi        DW_FRAME_UNDEFINED_VAL.
40007dc194Richard Lowe
4014d9fdb4Robert Mustacchi        If dw_value_type == DW_EXPR_OFFSET (the only  possible case for
4024d9fdb4Robert Mustacchi        dwarf2):
40307dc194Richard Lowe            If dw_offset_relevant is non-zero, then
4044d9fdb4Robert Mustacchi                the value is stored at at the address
4054d9fdb4Robert Mustacchi                CFA+N where N is a signed offset.
4064d9fdb4Robert Mustacchi                dw_regnum is the cfa register rule which means
4074d9fdb4Robert Mustacchi                one ignores dw_regnum and uses the CFA appropriately.
4084d9fdb4Robert Mustacchi                So dw_offset_or_block_len is a signed value, really,
4094d9fdb4Robert Mustacchi                and must be printed/evaluated as such.
4104d9fdb4Robert Mustacchi                Rule: Offset(N)
41107dc194Richard Lowe            If dw_offset_relevant is zero, then the value of the register
4124d9fdb4Robert Mustacchi                is the value of (DWARF) register number dw_regnum.
4134d9fdb4Robert Mustacchi                Rule: register(R)
4144d9fdb4Robert Mustacchi        If dw_value_type  == DW_EXPR_VAL_OFFSET
41507dc194Richard Lowe            the  value of this register is CFA +N where N is a signed offset.
41607dc194Richard Lowe            dw_regnum is the cfa register rule which means
41707dc194Richard Lowe            one ignores dw_regnum and uses the CFA appropriately.
41807dc194Richard Lowe            Rule: val_offset(N)
4194d9fdb4Robert Mustacchi        If dw_value_type  == DW_EXPR_EXPRESSION
42007dc194Richard Lowe            The value of the register is the value at the address
42107dc194Richard Lowe            computed by evaluating the DWARF expression E.
42207dc194Richard Lowe            Rule: expression(E)
42307dc194Richard Lowe            The expression E byte stream is pointed to by dw_block_ptr.
42407dc194Richard Lowe            The expression length in bytes is given by
42507dc194Richard Lowe            dw_offset_or_block_len.
4264d9fdb4Robert Mustacchi        If dw_value_type  == DW_EXPR_VAL_EXPRESSION
42707dc194Richard Lowe            The value of the register is the value
42807dc194Richard Lowe            computed by evaluating the DWARF expression E.
42907dc194Richard Lowe            Rule: val_expression(E)
43007dc194Richard Lowe            The expression E byte stream is pointed to by dw_block_ptr.
43107dc194Richard Lowe            The expression length in bytes is given by
43207dc194Richard Lowe            dw_offset_or_block_len.
4334d9fdb4Robert Mustacchi        Other values of dw_value_type are an error.
4344d9fdb4Robert Mustacchi*/
43507dc194Richard Lowe    Dwarf_Small         dw_offset_relevant;
4364d9fdb4Robert Mustacchi    Dwarf_Small         dw_value_type;
43707dc194Richard Lowe    Dwarf_Half          dw_regnum;
43807dc194Richard Lowe    Dwarf_Unsigned      dw_offset_or_block_len;
43907dc194Richard Lowe    Dwarf_Ptr           dw_block_ptr;
44007dc194Richard Lowe
44107dc194Richard Lowe}Dwarf_Regtable_Entry3;
44207dc194Richard Lowe
4434d9fdb4Robert Mustacchi/*  For the DWARF3 version, moved the DW_FRAME_CFA_COL
4444d9fdb4Robert Mustacchi    out of the array and into its own struct.
4454d9fdb4Robert Mustacchi    Having it part of the array is not very easy to work
4464d9fdb4Robert Mustacchi    with from a portability point of view: changing
4474d9fdb4Robert Mustacchi    the number for every architecture is a pain (if one fails
4484d9fdb4Robert Mustacchi    to set it correctly a register rule gets clobbered when
4494d9fdb4Robert Mustacchi    setting CFA).  With MIPS it just happened to be easy to use
4504d9fdb4Robert Mustacchi    DW_FRAME_CFA_COL (it was wrong conceptually but it was easy...).
4514d9fdb4Robert Mustacchi
4524d9fdb4Robert Mustacchi    rt3_rules and rt3_reg_table_size must be filled in before
4534d9fdb4Robert Mustacchi    calling libdwarf.  Filled in with a pointer to an array
4544d9fdb4Robert Mustacchi    (pointer and array  set up by the calling application)
4554d9fdb4Robert Mustacchi    of rt3_reg_table_size Dwarf_Regtable_Entry3_s structs.
4564d9fdb4Robert Mustacchi    libdwarf does not allocate or deallocate space for the
4574d9fdb4Robert Mustacchi    rules, you must do so.   libdwarf will initialize the
4584d9fdb4Robert Mustacchi    contents rules array, you do not need to do so (though
4594d9fdb4Robert Mustacchi    if you choose to initialize the array somehow that is ok:
4604d9fdb4Robert Mustacchi    libdwarf will overwrite your initializations with its own).
46107dc194Richard Lowe
46207dc194Richard Lowe*/
46307dc194Richard Lowetypedef struct Dwarf_Regtable3_s {
46407dc194Richard Lowe    struct Dwarf_Regtable_Entry3_s   rt3_cfa_rule;
46507dc194Richard Lowe
46607dc194Richard Lowe    Dwarf_Half                       rt3_reg_table_size;
46707dc194Richard Lowe    struct Dwarf_Regtable_Entry3_s * rt3_rules;
46807dc194Richard Lowe} Dwarf_Regtable3;
46907dc194Richard Lowe
47007dc194Richard Lowe
4714d9fdb4Robert Mustacchi/*  Use for DW_EPXR_STANDARD., DW_EXPR_VAL_OFFSET.
4724d9fdb4Robert Mustacchi    Returns DW_DLV_OK if the value is available.
4734d9fdb4Robert Mustacchi    If DW_DLV_OK returns the regnum and offset thru the pointers
4744d9fdb4Robert Mustacchi    (which the consumer must use appropriately).
47507dc194Richard Lowe*/
47607dc194Richard Loweint dwarf_frame_get_reg_register(struct Dwarf_Regtable_Entry3_s *reg_in,
47707dc194Richard Lowe    Dwarf_Small *offset_relevant,
47807dc194Richard Lowe    Dwarf_Half *regnum_out,
47907dc194Richard Lowe    Dwarf_Signed *offset_out);
48007dc194Richard Lowe
4814d9fdb4Robert Mustacchi/*  Use for DW_EXPR_EXPRESSION, DW_EXPR_VAL_EXPRESSION.
4824d9fdb4Robert Mustacchi    Returns DW_DLV_OK if the value is available.
4834d9fdb4Robert Mustacchi    The caller must pass in the address of a valid
4844d9fdb4Robert Mustacchi    Dwarf_Block (the caller need not initialize it).
48507dc194Richard Lowe*/
48607dc194Richard Loweint dwarf_frame_get_reg_expression(struct Dwarf_Regtable_Entry3_s *reg_in,
48707dc194Richard Lowe    Dwarf_Block *block_out);
48807dc194Richard Lowe
48907dc194Richard Lowe
4904d9fdb4Robert Mustacchi/*  For DW_DLC_SYMBOLIC_RELOCATIONS output to caller
4914d9fdb4Robert Mustacchi    v2, adding drd_length: some relocations are 4 and
4924d9fdb4Robert Mustacchi    some 8 bytes (pointers are 8, section offsets 4) in
4934d9fdb4Robert Mustacchi    some dwarf environments. (MIPS relocations are all one
4944d9fdb4Robert Mustacchi    size in any given ABI.) Changing drd_type to an unsigned char
4954d9fdb4Robert Mustacchi    to keep struct size down.
4967c478bdstevel@tonic-gate*/
4977c478bdstevel@tonic-gateenum Dwarf_Rel_Type {
4984d9fdb4Robert Mustacchi    dwarf_drt_none,        /* Should not get to caller */
4994d9fdb4Robert Mustacchi    dwarf_drt_data_reloc,  /* Simple normal relocation. */
5004d9fdb4Robert Mustacchi    dwarf_drt_segment_rel, /* Special reloc, exceptions. */
5014d9fdb4Robert Mustacchi    /* dwarf_drt_first_of_length_pair  and drt_second
5024d9fdb4Robert Mustacchi        are for for the  .word end - begin case. */
5034d9fdb4Robert Mustacchi    dwarf_drt_first_of_length_pair,
5044d9fdb4Robert Mustacchi    dwarf_drt_second_of_length_pair
50507dc194Richard Lowe};
50607dc194Richard Lowe
50707dc194Richard Lowetypedef struct Dwarf_P_Marker_s * Dwarf_P_Marker;
50807dc194Richard Lowestruct Dwarf_P_Marker_s {
50907dc194Richard Lowe    Dwarf_Unsigned ma_marker;
51007dc194Richard Lowe    Dwarf_Unsigned ma_offset;
5117c478bdstevel@tonic-gate};
51207dc194Richard Lowe
5137c478bdstevel@tonic-gatetypedef struct Dwarf_Relocation_Data_s  * Dwarf_Relocation_Data;
5147c478bdstevel@tonic-gatestruct Dwarf_Relocation_Data_s {
51507dc194Richard Lowe    unsigned char drd_type;   /* Cast to/from Dwarf_Rel_Type
5164d9fdb4Robert Mustacchi        to keep size small in struct. */
5174d9fdb4Robert Mustacchi    unsigned char drd_length; /* Length in bytes of data being
5184d9fdb4Robert Mustacchi        relocated. 4 for 32bit data,
5194d9fdb4Robert Mustacchi        8 for 64bit data. */
52007dc194Richard Lowe    Dwarf_Unsigned       drd_offset; /* Where the data to reloc is. */
52107dc194Richard Lowe    Dwarf_Unsigned       drd_symbol_index;
5227c478bdstevel@tonic-gate};
5237c478bdstevel@tonic-gate
52407dc194Richard Lowetypedef struct Dwarf_P_String_Attr_s  * Dwarf_P_String_Attr;
52507dc194Richard Lowestruct Dwarf_P_String_Attr_s {
52607dc194Richard Lowe    Dwarf_Unsigned        sa_offset;  /* Offset of string attribute data */
5274d9fdb4Robert Mustacchi    Dwarf_Unsigned        sa_nbytes;
52807dc194Richard Lowe};
5294d9fdb4Robert Mustacchi
53007dc194Richard Lowe
5317c478bdstevel@tonic-gate/* Opaque types for Consumer Library. */
5327c478bdstevel@tonic-gatetypedef struct Dwarf_Debug_s*      Dwarf_Debug;
5337c478bdstevel@tonic-gatetypedef struct Dwarf_Die_s*        Dwarf_Die;
5347c478bdstevel@tonic-gatetypedef struct Dwarf_Line_s*       Dwarf_Line;
5357c478bdstevel@tonic-gatetypedef struct Dwarf_Global_s*     Dwarf_Global;
5367c478bdstevel@tonic-gatetypedef struct Dwarf_Func_s*       Dwarf_Func;
5377c478bdstevel@tonic-gatetypedef struct Dwarf_Type_s*       Dwarf_Type;
5387c478bdstevel@tonic-gatetypedef struct Dwarf_Var_s*        Dwarf_Var;
5397c478bdstevel@tonic-gatetypedef struct Dwarf_Weak_s*       Dwarf_Weak;
5407c478bdstevel@tonic-gatetypedef struct Dwarf_Error_s*      Dwarf_Error;
5417c478bdstevel@tonic-gatetypedef struct Dwarf_Attribute_s*  Dwarf_Attribute;
5424d9fdb4Robert Mustacchitypedef struct Dwarf_Abbrev_s*     Dwarf_Abbrev;
5434d9fdb4Robert Mustacchitypedef struct Dwarf_Fde_s*        Dwarf_Fde;
5444d9fdb4Robert Mustacchitypedef struct Dwarf_Cie_s*        Dwarf_Cie;
5454d9fdb4Robert Mustacchitypedef struct Dwarf_Arange_s*     Dwarf_Arange;
5464d9fdb4Robert Mustacchitypedef struct Dwarf_Gdbindex_s*   Dwarf_Gdbindex;
5474d9fdb4Robert Mustacchistruct Dwarf_Xu_Index_Header_s;
5484d9fdb4Robert Mustacchitypedef struct Dwarf_Xu_Index_Header_s  *Dwarf_Xu_Index_Header;
5494d9fdb4Robert Mustacchistruct Dwarf_Line_Context_s;
5504d9fdb4Robert Mustacchitypedef struct Dwarf_Line_Context_s     *Dwarf_Line_Context;
5514d9fdb4Robert Mustacchistruct Dwarf_Macro_Context_s;
5524d9fdb4Robert Mustacchitypedef struct Dwarf_Macro_Context_s    *Dwarf_Macro_Context;
5534d9fdb4Robert Mustacchistruct Dwarf_Dnames_Head_s;
5544d9fdb4Robert Mustacchitypedef struct Dwarf_Dnames_Head_s      *Dwarf_Dnames_Head;
5554d9fdb4Robert Mustacchi
5567c478bdstevel@tonic-gate
5577c478bdstevel@tonic-gate/* Opaque types for Producer Library. */
5584d9fdb4Robert Mustacchitypedef struct Dwarf_P_Debug_s*       Dwarf_P_Debug;
5594d9fdb4Robert Mustacchitypedef struct Dwarf_P_Die_s*         Dwarf_P_Die;
5604d9fdb4Robert Mustacchitypedef struct Dwarf_P_Attribute_s*   Dwarf_P_Attribute;
5614d9fdb4Robert Mustacchitypedef struct Dwarf_P_Fde_s*         Dwarf_P_Fde;
56207dc194Richard Lowetypedef struct Dwarf_P_Expr_s*        Dwarf_P_Expr;
56307dc194Richard Lowetypedef Dwarf_Unsigned                Dwarf_Tag;
5647c478bdstevel@tonic-gate
5657c478bdstevel@tonic-gate
5667c478bdstevel@tonic-gate/* error handler function
5677c478bdstevel@tonic-gate*/
5684d9fdb4Robert Mustacchitypedef void  (*Dwarf_Handler)(Dwarf_Error /*error*/, Dwarf_Ptr /*errarg*/);
5697c478bdstevel@tonic-gate
5707c478bdstevel@tonic-gate
57107dc194Richard Lowe/* Begin libdwarf Object File Interface declarations.
57207dc194Richard Lowe
57307dc194Richard LoweAs of February 2008 there are multiple dwarf_reader object access
57407dc194Richard Loweinitialization methods available:
5754d9fdb4Robert MustacchiThe traditional dwarf_elf_init() and dwarf_init()  and dwarf_finish()
5764d9fdb4Robert Mustacchi    which assume libelf and POSIX file access.
57707dc194Richard LoweAn object-file and library agnostic dwarf_object_init() and dwarf_object_finish()
57807dc194Richard Lowe    which allow the coder to provide object access routines
57907dc194Richard Lowe    abstracting away the elf interface.  So there is no dependence in the
58007dc194Richard Lowe    reader code on the object format and no dependence on libelf.
5814d9fdb4Robert Mustacchi    See the code in dwarf_elf_access.c  and dwarf_original_elf_init.c
58207dc194Richard Lowe    to see an example of initializing the structures mentioned below.
58307dc194Richard Lowe
58407dc194Richard LoweProjects using dwarf_elf_init() or dwarf_init() can ignore
58507dc194Richard Lowethe Dwarf_Obj_Access* structures entirely as all these details
58607dc194Richard Loweare completed for you.
58707dc194Richard Lowe
5884d9fdb4Robert MustacchiAs of March 2017 additional
5894d9fdb4Robert Mustacchifunctions dwarf_elf_init_b
5904d9fdb4Robert Mustacchiand dwarf_init_b
5914d9fdb4Robert Mustacchiand dwarf_object_init_b
5924d9fdb4Robert Mustacchiadd a groupnumber argument so DWARF5
5934d9fdb4Robert Mustacchisplit-dwarf sections can be accessed.
59407dc194Richard Lowe*/
59507dc194Richard Lowe
59607dc194Richard Lowetypedef struct Dwarf_Obj_Access_Interface_s   Dwarf_Obj_Access_Interface;
59707dc194Richard Lowetypedef struct Dwarf_Obj_Access_Methods_s     Dwarf_Obj_Access_Methods;
59807dc194Richard Lowetypedef struct Dwarf_Obj_Access_Section_s     Dwarf_Obj_Access_Section;
59907dc194Richard Lowe
60007dc194Richard Lowe
6014d9fdb4Robert Mustacchi/*  Used in the get_section interface function
6024d9fdb4Robert Mustacchi    in Dwarf_Obj_Access_Section_s.  Since libdwarf
6034d9fdb4Robert Mustacchi    depends on standard DWARF section names an object
6044d9fdb4Robert Mustacchi    format that has no such names (but has some
6054d9fdb4Robert Mustacchi    method of setting up 'sections equivalents')
6064d9fdb4Robert Mustacchi    must arrange to return standard DWARF section
6074d9fdb4Robert Mustacchi    names in the 'name' field.  libdwarf does
6084d9fdb4Robert Mustacchi    not free the strings in 'name'. */
60907dc194Richard Lowestruct Dwarf_Obj_Access_Section_s {
6104d9fdb4Robert Mustacchi    /*  addr is the virtual address of the first byte of
6114d9fdb4Robert Mustacchi        the section data.  Usually zero when the address
6124d9fdb4Robert Mustacchi        makes no sense for a given section. */
61307dc194Richard Lowe    Dwarf_Addr     addr;
6144d9fdb4Robert Mustacchi
6154d9fdb4Robert Mustacchi    /* Section type. */
6164d9fdb4Robert Mustacchi    Dwarf_Unsigned type;
6174d9fdb4Robert Mustacchi
6184d9fdb4Robert Mustacchi    /* Size in bytes of the section. */
61907dc194Richard Lowe    Dwarf_Unsigned size;
6204d9fdb4Robert Mustacchi
6214d9fdb4Robert Mustacchi    /*  Having an accurate section name makes debugging of libdwarf easier.
6224d9fdb4Robert Mustacchi        and is essential to find the .debug_ sections.  */
62307dc194Richard Lowe    const char*    name;
6244d9fdb4Robert Mustacchi    /*  Set link to zero if it is meaningless.  If non-zero
6254d9fdb4Robert Mustacchi        it should be a link to a rela section or from symtab
6264d9fdb4Robert Mustacchi        to strtab.  In Elf it is sh_link. */
62707dc194Richard Lowe    Dwarf_Unsigned link;
6284d9fdb4Robert Mustacchi
6294d9fdb4Robert Mustacchi    /*  The section header index of the section to which the
6304d9fdb4Robert Mustacchi        relocation applies. In Elf it is sh_info. */
6314d9fdb4Robert Mustacchi    Dwarf_Unsigned info;
6324d9fdb4Robert Mustacchi
6334d9fdb4Robert Mustacchi    /*  Elf sections that are tables have a non-zero entrysize so
6344d9fdb4Robert Mustacchi        the count of entries can be calculated even without
6354d9fdb4Robert Mustacchi        the right structure definition. If your object format
6364d9fdb4Robert Mustacchi        does not have this data leave this zero. */
6374d9fdb4Robert Mustacchi    Dwarf_Unsigned entrysize;
63807dc194Richard Lowe};
63907dc194Richard Lowe
6404d9fdb4Robert Mustacchi/*  Returned by the get_endianness function in
6414d9fdb4Robert Mustacchi    Dwarf_Obj_Access_Methods_s. */
64207dc194Richard Lowetypedef enum {
64307dc194Richard Lowe    DW_OBJECT_MSB,
64407dc194Richard Lowe    DW_OBJECT_LSB
64507dc194Richard Lowe} Dwarf_Endianness;
64607dc194Richard Lowe
6474d9fdb4Robert Mustacchi/*  The functions we need to access object data from libdwarf are declared here.
64807dc194Richard Lowe
6494d9fdb4Robert Mustacchi    In these function pointer declarations
6504d9fdb4Robert Mustacchi    'void *obj' is intended to be a pointer (the object field in
6514d9fdb4Robert Mustacchi    Dwarf_Obj_Access_Interface_s)
6524d9fdb4Robert Mustacchi    that hides the library-specific and object-specific data that makes
6534d9fdb4Robert Mustacchi    it possible to handle multiple object formats and multiple libraries.
6544d9fdb4Robert Mustacchi    It's not required that one handles multiple such in a single libdwarf
6554d9fdb4Robert Mustacchi    archive/shared-library (but not ruled out either).
6564d9fdb4Robert Mustacchi    See  dwarf_elf_object_access_internals_t and dwarf_elf_access.c
6574d9fdb4Robert Mustacchi    for an example.
65807dc194Richard Lowe
65907dc194Richard Lowe*/
66007dc194Richard Lowestruct Dwarf_Obj_Access_Methods_s {
6614d9fdb4Robert Mustacchi    /*
6624d9fdb4Robert Mustacchi        get_section_info
6634d9fdb4Robert Mustacchi
6644d9fdb4Robert Mustacchi        Get address, size, and name info about a section.
6654d9fdb4Robert Mustacchi
6664d9fdb4Robert Mustacchi        Parameters
6674d9fdb4Robert Mustacchi        section_index - Zero-based index.
6684d9fdb4Robert Mustacchi        return_section - Pointer to a structure in which section info
6694d9fdb4Robert Mustacchi            will be placed.   Caller must provide a valid pointer to a
6704d9fdb4Robert Mustacchi            structure area.  The structure's contents will be overwritten
6714d9fdb4Robert Mustacchi            by the call to get_section_info.
6724d9fdb4Robert Mustacchi        error - A pointer to an integer in which an error code may be stored.
6734d9fdb4Robert Mustacchi
6744d9fdb4Robert Mustacchi        Return
6754d9fdb4Robert Mustacchi        DW_DLV_OK - Everything ok.
6764d9fdb4Robert Mustacchi        DW_DLV_ERROR - Error occurred. Use 'error' to determine the
6774d9fdb4Robert Mustacchi            libdwarf defined error.
6784d9fdb4Robert Mustacchi        DW_DLV_NO_ENTRY - No such section.  */
6794d9fdb4Robert Mustacchi    int    (*get_section_info)(void* obj, Dwarf_Half section_index,
68007dc194Richard Lowe        Dwarf_Obj_Access_Section* return_section, int* error);
6814d9fdb4Robert Mustacchi    /*
6824d9fdb4Robert Mustacchi        get_byte_order
6834d9fdb4Robert Mustacchi
6844d9fdb4Robert Mustacchi        Get whether the object file represented by this interface is big-endian
6854d9fdb4Robert Mustacchi        (DW_OBJECT_MSB) or little endian (DW_OBJECT_LSB).
6864d9fdb4Robert Mustacchi
6874d9fdb4Robert Mustacchi        Parameters
6884d9fdb4Robert Mustacchi        obj - Equivalent to 'this' in OO languages.
6894d9fdb4Robert Mustacchi
6904d9fdb4Robert Mustacchi        Return
6914d9fdb4Robert Mustacchi        Endianness of object. Cannot fail.  */
69207dc194Richard Lowe    Dwarf_Endianness  (*get_byte_order)(void* obj);
6934d9fdb4Robert Mustacchi    /*
6944d9fdb4Robert Mustacchi        get_length_size
6954d9fdb4Robert Mustacchi
6964d9fdb4Robert Mustacchi        Get the size of a length field in the underlying object file.
6974d9fdb4Robert Mustacchi        libdwarf currently supports * 4 and 8 byte sizes, but may
6984d9fdb4Robert Mustacchi        support larger in the future.
6994d9fdb4Robert Mustacchi        Perhaps the return type should be an enumeration?
7004d9fdb4Robert Mustacchi
7014d9fdb4Robert Mustacchi        Parameters
7024d9fdb4Robert Mustacchi        obj - Equivalent to 'this' in OO languages.
7034d9fdb4Robert Mustacchi
7044d9fdb4Robert Mustacchi        Return
7054d9fdb4Robert Mustacchi        Size of length. Cannot fail.  */
70607dc194Richard Lowe    Dwarf_Small   (*get_length_size)(void* obj);
7074d9fdb4Robert Mustacchi    /*
7084d9fdb4Robert Mustacchi        get_pointer_size
7094d9fdb4Robert Mustacchi
7104d9fdb4Robert Mustacchi        Get the size of a pointer field in the underlying object file.
7114d9fdb4Robert Mustacchi        libdwarf currently supports  4 and 8 byte sizes.
7124d9fdb4Robert Mustacchi        Perhaps the return type should be an enumeration?
7134d9fdb4Robert Mustacchi
7144d9fdb4Robert Mustacchi        Return
7154d9fdb4Robert Mustacchi        Size of pointer. Cannot fail.  */
71607dc194Richard Lowe    Dwarf_Small   (*get_pointer_size)(void* obj);
7174d9fdb4Robert Mustacchi    /*
7184d9fdb4Robert Mustacchi        get_section_count
7194d9fdb4Robert Mustacchi
7204d9fdb4Robert Mustacchi        Get the number of sections in the object file.
7214d9fdb4Robert Mustacchi
7224d9fdb4Robert Mustacchi        Parameters
7234d9fdb4Robert Mustacchi
7244d9fdb4Robert Mustacchi        Return
7254d9fdb4Robert Mustacchi        Number of sections */
72607dc194Richard Lowe    Dwarf_Unsigned  (*get_section_count)(void* obj);
7274d9fdb4Robert Mustacchi    /*
7284d9fdb4Robert Mustacchi        load_section
7294d9fdb4Robert Mustacchi
7304d9fdb4Robert Mustacchi        Get a pointer to an array of bytes that represent the section.
7314d9fdb4Robert Mustacchi
7324d9fdb4Robert Mustacchi        Parameters
7334d9fdb4Robert Mustacchi        section_index - Zero-based index.
7344d9fdb4Robert Mustacchi        return_data - The address of a pointer to which the section data block
7354d9fdb4Robert Mustacchi            will be assigned.
7364d9fdb4Robert Mustacchi        error - Pointer to an integer for returning libdwarf-defined
7374d9fdb4Robert Mustacchi            error numbers.
7384d9fdb4Robert Mustacchi
7394d9fdb4Robert Mustacchi        Return
7404d9fdb4Robert Mustacchi        DW_DLV_OK - No error.
7414d9fdb4Robert Mustacchi        DW_DLV_ERROR - Error. Use 'error' to indicate a libdwarf-defined
7424d9fdb4Robert Mustacchi            error number.
7434d9fdb4Robert Mustacchi        DW_DLV_NO_ENTRY - No such section.  */
7444d9fdb4Robert Mustacchi    int    (*load_section)(void* obj, Dwarf_Half section_index,
74507dc194Richard Lowe        Dwarf_Small** return_data, int* error);
74607dc194Richard Lowe
7474d9fdb4Robert Mustacchi    /**
7484d9fdb4Robert Mustacchi        relocate_a_section
7494d9fdb4Robert Mustacchi        If relocations are not supported leave this pointer NULL.
7504d9fdb4Robert Mustacchi
7514d9fdb4Robert Mustacchi        Get a pointer to an array of bytes that represent the section.
7524d9fdb4Robert Mustacchi
7534d9fdb4Robert Mustacchi        Parameters
7544d9fdb4Robert Mustacchi        section_index - Zero-based index of the section to be relocated.
7554d9fdb4Robert Mustacchi        error - Pointer to an integer for returning libdwarf-defined
7564d9fdb4Robert Mustacchi            error numbers.
7574d9fdb4Robert Mustacchi
7584d9fdb4Robert Mustacchi        Return
7594d9fdb4Robert Mustacchi        DW_DLV_OK - No error.
7604d9fdb4Robert Mustacchi        DW_DLV_ERROR - Error. Use 'error' to indicate a libdwarf-defined
7614d9fdb4Robert Mustacchi            error number.
7624d9fdb4Robert Mustacchi        DW_DLV_NO_ENTRY - No such section.  */
76307dc194Richard Lowe    int    (*relocate_a_section)(void* obj, Dwarf_Half section_index,
7644d9fdb4Robert Mustacchi        Dwarf_Debug dbg,
7654d9fdb4Robert Mustacchi        int* error);
76607dc194Richard Lowe
76707dc194Richard Lowe};
76807dc194Richard Lowe
76907dc194Richard Lowe
77007dc194Richard Lowe
7714d9fdb4Robert Mustacchi/*  These structures are allocated and deallocated by your code
7724d9fdb4Robert Mustacchi    when you are using the libdwarf Object File Interface
7734d9fdb4Robert Mustacchi    [dwarf_object_init and dwarf_object_finish)] directly.
7744d9fdb4Robert Mustacchi    dwarf_object_finish) does not free
7754d9fdb4Robert Mustacchi    struct Dwarf_Obj_Access_Interface_s or its content.
7764d9fdb4Robert Mustacchi    (libdwarf does record a pointer to this struct: you must
7774d9fdb4Robert Mustacchi    ensure that pointer remains valid for as long as
7784d9fdb4Robert Mustacchi    a libdwarf instance is open (meaning
7794d9fdb4Robert Mustacchi    after dwarf_init) and before dwarf_finish)).
78007dc194Richard Lowe
7814d9fdb4Robert Mustacchi    If you are reading Elf objects and libelf use dwarf_init()
7824d9fdb4Robert Mustacchi    or dwarf_elf_init() which take care of these details.
78307dc194Richard Lowe*/
78407dc194Richard Lowestruct Dwarf_Obj_Access_Interface_s {
7854d9fdb4Robert Mustacchi    /*  object is a void* as it hides the data the object access routines
7864d9fdb4Robert Mustacchi        need (which varies by library in use and object format).
78707dc194Richard Lowe    */
78807dc194Richard Lowe    void* object;
78907dc194Richard Lowe    const Dwarf_Obj_Access_Methods * methods;
79007dc194Richard Lowe};
7914d9fdb4Robert Mustacchi
79207dc194Richard Lowe/* End libdwarf Object File Interface */
79307dc194Richard Lowe
7944d9fdb4Robert Mustacchi/*
7957c478bdstevel@tonic-gate    Dwarf_dealloc() alloc_type arguments.
7967c478bdstevel@tonic-gate    Argument points to:
7977c478bdstevel@tonic-gate*/
79807dc194Richard Lowe#define DW_DLA_STRING          0x01     /* char* */
79907dc194Richard Lowe#define DW_DLA_LOC             0x02     /* Dwarf_Loc */
80007dc194Richard Lowe#define DW_DLA_LOCDESC         0x03     /* Dwarf_Locdesc */
80107dc194Richard Lowe#define DW_DLA_ELLIST          0x04     /* Dwarf_Ellist (not used)*/
80207dc194Richard Lowe#define DW_DLA_BOUNDS          0x05     /* Dwarf_Bounds (not used) */
80307dc194Richard Lowe#define DW_DLA_BLOCK           0x06     /* Dwarf_Block */
80407dc194Richard Lowe#define DW_DLA_DEBUG           0x07     /* Dwarf_Debug */
80507dc194Richard Lowe#define DW_DLA_DIE             0x08     /* Dwarf_Die */
80607dc194Richard Lowe#define DW_DLA_LINE            0x09     /* Dwarf_Line */
80707dc194Richard Lowe#define DW_DLA_ATTR            0x0a     /* Dwarf_Attribute */
80807dc194Richard Lowe#define DW_DLA_TYPE            0x0b     /* Dwarf_Type  (not used) */
80907dc194Richard Lowe#define DW_DLA_SUBSCR          0x0c     /* Dwarf_Subscr (not used) */
81007dc194Richard Lowe#define DW_DLA_GLOBAL          0x0d     /* Dwarf_Global */
81107dc194Richard Lowe#define DW_DLA_ERROR           0x0e     /* Dwarf_Error */
81207dc194Richard Lowe#define DW_DLA_LIST            0x0f     /* a list */
81307dc194Richard Lowe#define DW_DLA_LINEBUF         0x10     /* Dwarf_Line* (not used) */
81407dc194Richard Lowe#define DW_DLA_ARANGE          0x11     /* Dwarf_Arange */
8154d9fdb4Robert Mustacchi#define DW_DLA_ABBREV          0x12     /* Dwarf_Abbrev */
8164d9fdb4Robert Mustacchi#define DW_DLA_FRAME_OP        0x13     /* Dwarf_Frame_Op */
81707dc194Richard Lowe#define DW_DLA_CIE             0x14     /* Dwarf_Cie */
81807dc194Richard Lowe#define DW_DLA_FDE             0x15     /* Dwarf_Fde */
8194d9fdb4Robert Mustacchi#define DW_DLA_LOC_BLOCK       0x16     /* Dwarf_Loc */
82007dc194Richard Lowe#define DW_DLA_FRAME_BLOCK     0x17     /* Dwarf_Frame Block (not used) */
82107dc194Richard Lowe#define DW_DLA_FUNC            0x18     /* Dwarf_Func */
82207dc194Richard Lowe#define DW_DLA_TYPENAME        0x19     /* Dwarf_Type */
82307dc194Richard Lowe#define DW_DLA_VAR             0x1a     /* Dwarf_Var */
82407dc194Richard Lowe#define DW_DLA_WEAK            0x1b     /* Dwarf_Weak */
82507dc194Richard Lowe#define DW_DLA_ADDR            0x1c     /* Dwarf_Addr sized entries */
82607dc194Richard Lowe#define DW_DLA_RANGES          0x1d     /* Dwarf_Ranges */
8274d9fdb4Robert Mustacchi/* 0x1e (30) to 0x34 (52) reserved for internal to libdwarf types. */
8284d9fdb4Robert Mustacchi#define DW_DLA_LOCLISTS_HEAD   0x35     /* .debug_loclists DW5 */
8294d9fdb4Robert Mustacchi#define DW_DLA_RNGLISTS_HEAD   0x36     /* .debug_rnglists DW5 */
8304d9fdb4Robert Mustacchi#define DW_DLA_GDBINDEX        0x37     /* Dwarf_Gdbindex */
8314d9fdb4Robert Mustacchi#define DW_DLA_XU_INDEX        0x38     /* Dwarf_Xu_Index_Header */
8324d9fdb4Robert Mustacchi#define DW_DLA_LOC_BLOCK_C     0x39     /* Dwarf_Loc_c*/
8334d9fdb4Robert Mustacchi#define DW_DLA_LOCDESC_C       0x3a     /* Dwarf_Locdesc_c */
8344d9fdb4Robert Mustacchi#define DW_DLA_LOC_HEAD_C      0x3b     /* Dwarf_Loc_Head_c */
8354d9fdb4Robert Mustacchi#define DW_DLA_MACRO_CONTEXT   0x3c     /* Dwarf_Macro_Context */
8364d9fdb4Robert Mustacchi/*  0x3d (61) is for libdwarf internal use.               */
8374d9fdb4Robert Mustacchi#define DW_DLA_DSC_HEAD        0x3e     /* Dwarf_Dsc_Head */
8384d9fdb4Robert Mustacchi#define DW_DLA_DNAMES_HEAD     0x3f     /* Dwarf_Dnames_Head */
8394d9fdb4Robert Mustacchi#define DW_DLA_STR_OFFSETS     0x40     /* struct Dwarf_Str_Offsets_Table_s */
8407c478bdstevel@tonic-gate
8417c478bdstevel@tonic-gate/* The augmenter string for CIE */
8427c478bdstevel@tonic-gate#define DW_CIE_AUGMENTER_STRING_V0              "z"
8437c478bdstevel@tonic-gate
8447c478bdstevel@tonic-gate/* dwarf_init() access arguments
8457c478bdstevel@tonic-gate*/
8467c478bdstevel@tonic-gate#define DW_DLC_READ        0        /* read only access */
8477c478bdstevel@tonic-gate#define DW_DLC_WRITE       1        /* write only access */
8487c478bdstevel@tonic-gate#define DW_DLC_RDWR        2        /* read/write access NOT SUPPORTED*/
8497c478bdstevel@tonic-gate
8504d9fdb4Robert Mustacchi/* dwarf_producer_init* access flag modifiers
8514d9fdb4Robert Mustacchi   No longer depends on compile-time settings for
8524d9fdb4Robert Mustacchi   how to produce 64bit offset. See DW_DLC_IRIX_OFFSET64.
8534d9fdb4Robert Mustacchi   Historic  versions. One of
8544d9fdb4Robert Mustacchi   If DW_DLC_POINTER64 is not set DW_DLC_POINTER32 is assumed.
8554d9fdb4Robert Mustacchi   If DW_DLC_OFFSET64 or DW_DLC_IRIX_OFFSET64 is not
8564d9fdb4Robert Mustacchi   set 32bit offset DWARF is assumed.
8574d9fdb4Robert Mustacchi   Non-MIPS Non IA64 should use DW_DLC_SYMBOLIC_RELOCATIONS
8584d9fdb4Robert Mustacchi   and handle the relocation creation for the target
8594d9fdb4Robert Mustacchi   itself using the symbolic relocations to do so, those
8604d9fdb4Robert Mustacchi   use the Dwarf_Rel_Type enum relocation indicators.
8614d9fdb4Robert Mustacchi
8624d9fdb4Robert Mustacchi*/
8634d9fdb4Robert Mustacchi/*  The first three are traditional dwarf producer names.
8644d9fdb4Robert Mustacchi    These names still work.
8654d9fdb4Robert Mustacchi    Newer names below.
8667c478bdstevel@tonic-gate*/
8674d9fdb4Robert Mustacchi/* 64-bit address-size target */
8684d9fdb4Robert Mustacchi#define DW_DLC_SIZE_64              0x40000000
8694d9fdb4Robert Mustacchi
8704d9fdb4Robert Mustacchi/* 32-bit address-size target */
8714d9fdb4Robert Mustacchi#define DW_DLC_SIZE_32              0x20000000
8724d9fdb4Robert Mustacchi
8734d9fdb4Robert Mustacchi/* 64-bit offset-size DWARF offsets (else 32bit) */
8744d9fdb4Robert Mustacchi#define DW_DLC_OFFSET_SIZE_64       0x10000000
8754d9fdb4Robert Mustacchi
8764d9fdb4Robert Mustacchi/* 32-bit offset-size ELF object (ELFCLASS32) */
8774d9fdb4Robert Mustacchi#define DW_DLC_ELF_OFFSET_SIZE_32   0x00400000
8784d9fdb4Robert Mustacchi
8794d9fdb4Robert Mustacchi/* 64-bit offset-size ELF object (ELFCLASS64)  */
8804d9fdb4Robert Mustacchi#define DW_DLC_ELF_OFFSET_SIZE_64   0x00020000
8817c478bdstevel@tonic-gate
8824d9fdb4Robert Mustacchi/* dwarf_producer_init* access flag modifiers
8834d9fdb4Robert Mustacchi   Some new April 2014.
8844d9fdb4Robert Mustacchi   If DW_DLC_STREAM_RELOCATIONS is set the
8854d9fdb4Robert Mustacchi   DW_DLC_ISA_* flags are ignored. See the Dwarf_Rel_Type enum.
8867c478bdstevel@tonic-gate*/
88707dc194Richard Lowe
8884d9fdb4Robert Mustacchi/* Old style Elf binary relocation (.rel) records. The default. */
8894d9fdb4Robert Mustacchi#define DW_DLC_STREAM_RELOCATIONS   0x02000000
8904d9fdb4Robert Mustacchi
8914d9fdb4Robert Mustacchi/* use 32-bit  sec  offsets */
8924d9fdb4Robert Mustacchi#define DW_DLC_OFFSET32             0x00010000
8934d9fdb4Robert Mustacchi
8944d9fdb4Robert Mustacchi/* The following 3 are new sensible names.
8954d9fdb4Robert MustacchiOld names above with same values. */
8964d9fdb4Robert Mustacchi/* use 64-bit sec offsets in ELF */
8974d9fdb4Robert Mustacchi#define DW_DLC_OFFSET64             0x10000000
8984d9fdb4Robert Mustacchi
8994d9fdb4Robert Mustacchi/* use 4 for address_size */
9004d9fdb4Robert Mustacchi#define DW_DLC_POINTER32            0x20000000
9014d9fdb4Robert Mustacchi
9024d9fdb4Robert Mustacchi/* use 8 for address_size */
9034d9fdb4Robert Mustacchi#define DW_DLC_POINTER64            0x40000000
9044d9fdb4Robert Mustacchi
9054d9fdb4Robert Mustacchi/* Special for IRIX only */
9064d9fdb4Robert Mustacchi/* use Elf 64bit offset headers and non-std IRIX 64bitoffset headers */
9074d9fdb4Robert Mustacchi#define DW_DLC_IRIX_OFFSET64        0x00200000
9084d9fdb4Robert Mustacchi
9094d9fdb4Robert Mustacchi/*  Usable with assembly output because it is up to the producer to
9104d9fdb4Robert Mustacchi    deal with locations in whatever manner the calling producer
9114d9fdb4Robert Mustacchi    code wishes.  For example, when the libdwarf caller wishes
9124d9fdb4Robert Mustacchi    to produce relocations differently than the binary
9134d9fdb4Robert Mustacchi    relocation bits that libdwarf Stream Relocations generate.
9144d9fdb4Robert Mustacchi    */
9154d9fdb4Robert Mustacchi#define DW_DLC_SYMBOLIC_RELOCATIONS 0x04000000
9164d9fdb4Robert Mustacchi
91707dc194Richard Lowe
91807dc194Richard Lowe#define DW_DLC_TARGET_BIGENDIAN     0x08000000 /* Big    endian target */
91907dc194Richard Lowe#define DW_DLC_TARGET_LITTLEENDIAN  0x00100000 /* Little endian target */
92007dc194Richard Lowe
9217c478bdstevel@tonic-gate
9224d9fdb4Robert Mustacchi/* dwarf_pcline function, slide arguments
9237c478bdstevel@tonic-gate*/
9247c478bdstevel@tonic-gate#define DW_DLS_BACKWARD   -1       /* slide backward to find line */
9254d9fdb4Robert Mustacchi#define DW_DLS_NOSLIDE     0       /* match exactly without sliding */
9267c478bdstevel@tonic-gate#define DW_DLS_FORWARD     1       /* slide forward to find line */
9277c478bdstevel@tonic-gate
9287c478bdstevel@tonic-gate/* libdwarf error numbers
9297c478bdstevel@tonic-gate*/
9304d9fdb4Robert Mustacchi#define DW_DLE_NE          0     /* no error */
9317c478bdstevel@tonic-gate#define DW_DLE_VMM         1     /* dwarf format/library version mismatch */
9327c478bdstevel@tonic-gate#define DW_DLE_MAP         2     /* memory map failure */
9337c478bdstevel@tonic-gate#define DW_DLE_LEE         3     /* libelf error */
9347c478bdstevel@tonic-gate#define DW_DLE_NDS         4     /* no debug section */
9357c478bdstevel@tonic-gate#define DW_DLE_NLS         5     /* no line section */
9367c478bdstevel@tonic-gate#define DW_DLE_ID          6     /* invalid descriptor for query */
9377c478bdstevel@tonic-gate#define DW_DLE_IOF         7     /* I/O failure */
9387c478bdstevel@tonic-gate#define DW_DLE_MAF         8     /* memory allocation failure */
9394d9fdb4Robert Mustacchi#define DW_DLE_IA          9     /* invalid argument */
9407c478bdstevel@tonic-gate#define DW_DLE_MDE         10     /* mangled debugging entry */
9417c478bdstevel@tonic-gate#define DW_DLE_MLE         11     /* mangled line number entry */
9427c478bdstevel@tonic-gate#define DW_DLE_FNO         12     /* file not open */
9437c478bdstevel@tonic-gate#define DW_DLE_FNR         13     /* file not a regular file */
9447c478bdstevel@tonic-gate#define DW_DLE_FWA         14     /* file open with wrong access */
9457c478bdstevel@tonic-gate#define DW_DLE_NOB         15     /* not an object file */
9467c478bdstevel@tonic-gate#define DW_DLE_MOF         16     /* mangled object file header */
9477c478bdstevel@tonic-gate#define DW_DLE_EOLL        17     /* end of location list entries */
9487c478bdstevel@tonic-gate#define DW_DLE_NOLL        18     /* no location list section */
9497c478bdstevel@tonic-gate#define DW_DLE_BADOFF      19     /* Invalid offset */
9507c478bdstevel@tonic-gate#define DW_DLE_EOS         20     /* end of section  */
9517c478bdstevel@tonic-gate#define DW_DLE_ATRUNC      21     /* abbreviations section appears truncated*/
9527c478bdstevel@tonic-gate#define DW_DLE_BADBITC     22     /* Address size passed to dwarf bad*/
95307dc194Richard Lowe                    /* It is not an allowed size (64 or 32) */
9547c478bdstevel@tonic-gate    /* Error codes defined by the current Libdwarf Implementation. */
9557c478bdstevel@tonic-gate#define DW_DLE_DBG_ALLOC                        23
9567c478bdstevel@tonic-gate#define DW_DLE_FSTAT_ERROR                      24
9577c478bdstevel@tonic-gate#define DW_DLE_FSTAT_MODE_ERROR                 25
9587c478bdstevel@tonic-gate#define DW_DLE_INIT_ACCESS_WRONG                26
9597c478bdstevel@tonic-gate#define DW_DLE_ELF_BEGIN_ERROR                  27
9607c478bdstevel@tonic-gate#define DW_DLE_ELF_GETEHDR_ERROR                28
9617c478bdstevel@tonic-gate#define DW_DLE_ELF_GETSHDR_ERROR                29
9627c478bdstevel@tonic-gate#define DW_DLE_ELF_STRPTR_ERROR                 30
9637c478bdstevel@tonic-gate#define DW_DLE_DEBUG_INFO_DUPLICATE             31
9647c478bdstevel@tonic-gate#define DW_DLE_DEBUG_INFO_NULL                  32
9657c478bdstevel@tonic-gate#define DW_DLE_DEBUG_ABBREV_DUPLICATE           33
9667c478bdstevel@tonic-gate#define DW_DLE_DEBUG_ABBREV_NULL                34
9677c478bdstevel@tonic-gate#define DW_DLE_DEBUG_ARANGES_DUPLICATE          35
9687c478bdstevel@tonic-gate#define DW_DLE_DEBUG_ARANGES_NULL               36
9697c478bdstevel@tonic-gate#define DW_DLE_DEBUG_LINE_DUPLICATE             37
9707c478bdstevel@tonic-gate#define DW_DLE_DEBUG_LINE_NULL                  38
9717c478bdstevel@tonic-gate#define DW_DLE_DEBUG_LOC_DUPLICATE              39
9727c478bdstevel@tonic-gate#define DW_DLE_DEBUG_LOC_NULL                   40
9737c478bdstevel@tonic-gate#define DW_DLE_DEBUG_MACINFO_DUPLICATE          41
9747c478bdstevel@tonic-gate#define DW_DLE_DEBUG_MACINFO_NULL               42
9757c478bdstevel@tonic-gate#define DW_DLE_DEBUG_PUBNAMES_DUPLICATE         43
9767c478bdstevel@tonic-gate#define DW_DLE_DEBUG_PUBNAMES_NULL              44
9777c478bdstevel@tonic-gate#define DW_DLE_DEBUG_STR_DUPLICATE              45
9787c478bdstevel@tonic-gate#define DW_DLE_DEBUG_STR_NULL                   46
9797c478bdstevel@tonic-gate#define DW_DLE_CU_LENGTH_ERROR                  47
9807c478bdstevel@tonic-gate#define DW_DLE_VERSION_STAMP_ERROR              48
9817c478bdstevel@tonic-gate#define DW_DLE_ABBREV_OFFSET_ERROR              49
9827c478bdstevel@tonic-gate#define DW_DLE_ADDRESS_SIZE_ERROR               50
9837c478bdstevel@tonic-gate#define DW_DLE_DEBUG_INFO_PTR_NULL              51
9847c478bdstevel@tonic-gate#define DW_DLE_DIE_NULL                         52
9857c478bdstevel@tonic-gate#define DW_DLE_STRING_OFFSET_BAD                53
9867c478bdstevel@tonic-gate#define DW_DLE_DEBUG_LINE_LENGTH_BAD            54
9877c478bdstevel@tonic-gate#define DW_DLE_LINE_PROLOG_LENGTH_BAD           55
9887c478bdstevel@tonic-gate#define DW_DLE_LINE_NUM_OPERANDS_BAD            56
98907dc194Richard Lowe#define DW_DLE_LINE_SET_ADDR_ERROR              57 /* No longer used. */
9907c478bdstevel@tonic-gate#define DW_DLE_LINE_EXT_OPCODE_BAD              58
9917c478bdstevel@tonic-gate#define DW_DLE_DWARF_LINE_NULL                  59
9927c478bdstevel@tonic-gate#define DW_DLE_INCL_DIR_NUM_BAD                 60
9937c478bdstevel@tonic-gate#define DW_DLE_LINE_FILE_NUM_BAD                61
9947c478bdstevel@tonic-gate#define DW_DLE_ALLOC_FAIL                       62
99507dc194Richard Lowe#define DW_DLE_NO_CALLBACK_FUNC                 63
99607dc194Richard Lowe#define DW_DLE_SECT_ALLOC                       64
99707dc194Richard Lowe#define DW_DLE_FILE_ENTRY_ALLOC                 65
99807dc194Richard Lowe#define DW_DLE_LINE_ALLOC                       66
99907dc194Richard Lowe#define DW_DLE_FPGM_ALLOC                       67
100007dc194Richard Lowe#define DW_DLE_INCDIR_ALLOC                     68
100107dc194Richard Lowe#define DW_DLE_STRING_ALLOC                     69
100207dc194Richard Lowe#define DW_DLE_CHUNK_ALLOC                      70
100307dc194Richard Lowe#define DW_DLE_BYTEOFF_ERR                      71
100407dc194Richard Lowe#define DW_DLE_CIE_ALLOC                        72
100507dc194Richard Lowe#define DW_DLE_FDE_ALLOC                        73
100607dc194Richard Lowe#define DW_DLE_REGNO_OVFL                       74
100707dc194Richard Lowe#define DW_DLE_CIE_OFFS_ALLOC                   75
100807dc194Richard Lowe#define DW_DLE_WRONG_ADDRESS                    76
100907dc194Richard Lowe#define DW_DLE_EXTRA_NEIGHBORS                  77
10104d9fdb4Robert Mustacchi#define DW_DLE_WRONG_TAG                        78
101107dc194Richard Lowe#define DW_DLE_DIE_ALLOC                        79
101207dc194Richard Lowe#define DW_DLE_PARENT_EXISTS                    80
10137c478bdstevel@tonic-gate#define DW_DLE_DBG_NULL                         81
101407dc194Richard Lowe#define DW_DLE_DEBUGLINE_ERROR                  82
101507dc194Richard Lowe#define DW_DLE_DEBUGFRAME_ERROR                 83
101607dc194Richard Lowe#define DW_DLE_DEBUGINFO_ERROR                  84
101707dc194Richard Lowe#define DW_DLE_ATTR_ALLOC                       85
101807dc194Richard Lowe#define DW_DLE_ABBREV_ALLOC                     86
101907dc194Richard Lowe#define DW_DLE_OFFSET_UFLW                      87
102007dc194Richard Lowe#define DW_DLE_ELF_SECT_ERR                     88
102107dc194Richard Lowe#define DW_DLE_DEBUG_FRAME_LENGTH_BAD           89
102207dc194Richard Lowe#define DW_DLE_FRAME_VERSION_BAD                90
102307dc194Richard Lowe#define DW_DLE_CIE_RET_ADDR_REG_ERROR           91
102407dc194Richard Lowe#define DW_DLE_FDE_NULL                         92
102507dc194Richard Lowe#define DW_DLE_FDE_DBG_NULL                     93
102607dc194Richard Lowe#define DW_DLE_CIE_NULL                         94
102707dc194Richard Lowe#define DW_DLE_CIE_DBG_NULL                     95
102807dc194Richard Lowe#define DW_DLE_FRAME_TABLE_COL_BAD              96
102907dc194Richard Lowe#define DW_DLE_PC_NOT_IN_FDE_RANGE              97
103007dc194Richard Lowe#define DW_DLE_CIE_INSTR_EXEC_ERROR             98
103107dc194Richard Lowe#define DW_DLE_FRAME_INSTR_EXEC_ERROR           99
103207dc194Richard Lowe#define DW_DLE_FDE_PTR_NULL                    100
103307dc194Richard Lowe#define DW_DLE_RET_OP_LIST_NULL                101
103407dc194Richard Lowe#define DW_DLE_LINE_CONTEXT_NULL               102
103507dc194Richard Lowe#define DW_DLE_DBG_NO_CU_CONTEXT               103
103607dc194Richard Lowe#define DW_DLE_DIE_NO_CU_CONTEXT               104
103707dc194Richard Lowe#define DW_DLE_FIRST_DIE_NOT_CU                105
103807dc194Richard Lowe#define DW_DLE_NEXT_DIE_PTR_NULL               106
103907dc194Richard Lowe#define DW_DLE_DEBUG_FRAME_DUPLICATE           107
104007dc194Richard Lowe#define DW_DLE_DEBUG_FRAME_NULL                108
104107dc194Richard Lowe#define DW_DLE_ABBREV_DECODE_ERROR             109
104207dc194Richard Lowe#define DW_DLE_DWARF_ABBREV_NULL               110
104307dc194Richard Lowe#define DW_DLE_ATTR_NULL                       111
104407dc194Richard Lowe#define DW_DLE_DIE_BAD                         112
104507dc194Richard Lowe#define DW_DLE_DIE_ABBREV_BAD                  113
104607dc194Richard Lowe#define DW_DLE_ATTR_FORM_BAD                   114
104707dc194Richard Lowe#define DW_DLE_ATTR_NO_CU_CONTEXT              115
104807dc194Richard Lowe#define DW_DLE_ATTR_FORM_SIZE_BAD              116
104907dc194Richard Lowe#define DW_DLE_ATTR_DBG_NULL                   117
105007dc194Richard Lowe#define DW_DLE_BAD_REF_FORM                    118
105107dc194Richard Lowe#define DW_DLE_ATTR_FORM_OFFSET_BAD            119
105207dc194Richard Lowe#define DW_DLE_LINE_OFFSET_BAD                 120
105307dc194Richard Lowe#define DW_DLE_DEBUG_STR_OFFSET_BAD            121
105407dc194Richard Lowe#define DW_DLE_STRING_PTR_NULL                 122
105507dc194Richard Lowe#define DW_DLE_PUBNAMES_VERSION_ERROR          123
105607dc194Richard Lowe#define DW_DLE_PUBNAMES_LENGTH_BAD             124
105707dc194Richard Lowe#define DW_DLE_GLOBAL_NULL                     125
105807dc194Richard Lowe#define DW_DLE_GLOBAL_CONTEXT_NULL             126
105907dc194Richard Lowe#define DW_DLE_DIR_INDEX_BAD                   127
106007dc194Richard Lowe#define DW_DLE_LOC_EXPR_BAD                    128
106107dc194Richard Lowe#define DW_DLE_DIE_LOC_EXPR_BAD                129
106207dc194Richard Lowe#define DW_DLE_ADDR_ALLOC                      130
106307dc194Richard Lowe#define DW_DLE_OFFSET_BAD                      131
106407dc194Richard Lowe#define DW_DLE_MAKE_CU_CONTEXT_FAIL            132
106507dc194Richard Lowe#define DW_DLE_REL_ALLOC                       133
106607dc194Richard Lowe#define DW_DLE_ARANGE_OFFSET_BAD               134
106707dc194Richard Lowe#define DW_DLE_SEGMENT_SIZE_BAD                135
106807dc194Richard Lowe#define DW_DLE_ARANGE_LENGTH_BAD               136
106907dc194Richard Lowe#define DW_DLE_ARANGE_DECODE_ERROR             137
107007dc194Richard Lowe#define DW_DLE_ARANGES_NULL                    138
107107dc194Richard Lowe#define DW_DLE_ARANGE_NULL                     139
107207dc194Richard Lowe#define DW_DLE_NO_FILE_NAME                    140
107307dc194Richard Lowe#define DW_DLE_NO_COMP_DIR                     141
107407dc194Richard Lowe#define DW_DLE_CU_ADDRESS_SIZE_BAD             142
107507dc194Richard Lowe#define DW_DLE_INPUT_ATTR_BAD                  143
107607dc194Richard Lowe#define DW_DLE_EXPR_NULL                       144
107707dc194Richard Lowe#define DW_DLE_BAD_EXPR_OPCODE                 145
107807dc194Richard Lowe#define DW_DLE_EXPR_LENGTH_BAD                 146
107907dc194Richard Lowe#define DW_DLE_MULTIPLE_RELOC_IN_EXPR          147
108007dc194Richard Lowe#define DW_DLE_ELF_GETIDENT_ERROR              148
108107dc194Richard Lowe#define DW_DLE_NO_AT_MIPS_FDE                  149
108207dc194Richard Lowe#define DW_DLE_NO_CIE_FOR_FDE                  150
108307dc194Richard Lowe#define DW_DLE_DIE_ABBREV_LIST_NULL            151
108407dc194Richard Lowe#define DW_DLE_DEBUG_FUNCNAMES_DUPLICATE       152
108507dc194Richard Lowe#define DW_DLE_DEBUG_FUNCNAMES_NULL            153
108607dc194Richard Lowe#define DW_DLE_DEBUG_FUNCNAMES_VERSION_ERROR   154
108707dc194Richard Lowe#define DW_DLE_DEBUG_FUNCNAMES_LENGTH_BAD      155
108807dc194Richard Lowe#define DW_DLE_FUNC_NULL                       156
108907dc194Richard Lowe#define DW_DLE_FUNC_CONTEXT_NULL               157
109007dc194Richard Lowe#define DW_DLE_DEBUG_TYPENAMES_DUPLICATE       158
109107dc194Richard Lowe#define DW_DLE_DEBUG_TYPENAMES_NULL            159
109207dc194Richard Lowe#define DW_DLE_DEBUG_TYPENAMES_VERSION_ERROR   160
109307dc194Richard Lowe#define DW_DLE_DEBUG_TYPENAMES_LENGTH_BAD      161
109407dc194Richard Lowe#define DW_DLE_TYPE_NULL                       162
109507dc194Richard Lowe#define DW_DLE_TYPE_CONTEXT_NULL               163
109607dc194Richard Lowe#define DW_DLE_DEBUG_VARNAMES_DUPLICATE        164
109707dc194Richard Lowe#define DW_DLE_DEBUG_VARNAMES_NULL             165
109807dc194Richard Lowe#define DW_DLE_DEBUG_VARNAMES_VERSION_ERROR    166
109907dc194Richard Lowe#define DW_DLE_DEBUG_VARNAMES_LENGTH_BAD       167
110007dc194Richard Lowe#define DW_DLE_VAR_NULL                        168
110107dc194Richard Lowe#define DW_DLE_VAR_CONTEXT_NULL                169
110207dc194Richard Lowe#define DW_DLE_DEBUG_WEAKNAMES_DUPLICATE       170
110307dc194Richard Lowe#define DW_DLE_DEBUG_WEAKNAMES_NULL            171
110407dc194Richard Lowe#define DW_DLE_DEBUG_WEAKNAMES_VERSION_ERROR   172
110507dc194Richard Lowe#define DW_DLE_DEBUG_WEAKNAMES_LENGTH_BAD      173
110607dc194Richard Lowe#define DW_DLE_WEAK_NULL                       174
110707dc194Richard Lowe#define DW_DLE_WEAK_CONTEXT_NULL               175
110807dc194Richard Lowe#define DW_DLE_LOCDESC_COUNT_WRONG             176
110907dc194Richard Lowe#define DW_DLE_MACINFO_STRING_NULL             177
111007dc194Richard Lowe#define DW_DLE_MACINFO_STRING_EMPTY            178
111107dc194Richard Lowe#define DW_DLE_MACINFO_INTERNAL_ERROR_SPACE    179
111207dc194Richard Lowe#define DW_DLE_MACINFO_MALLOC_FAIL             180
111307dc194Richard Lowe#define DW_DLE_DEBUGMACINFO_ERROR              181
111407dc194Richard Lowe#define DW_DLE_DEBUG_MACRO_LENGTH_BAD          182
111507dc194Richard Lowe#define DW_DLE_DEBUG_MACRO_MAX_BAD             183
111607dc194Richard Lowe#define DW_DLE_DEBUG_MACRO_INTERNAL_ERR        184
111707dc194Richard Lowe#define DW_DLE_DEBUG_MACRO_MALLOC_SPACE        185
111807dc194Richard Lowe#define DW_DLE_DEBUG_MACRO_INCONSISTENT        186
111907dc194Richard Lowe#define DW_DLE_DF_NO_CIE_AUGMENTATION          187
11204d9fdb4Robert Mustacchi#define DW_DLE_DF_REG_NUM_TOO_HIGH             188
11214d9fdb4Robert Mustacchi#define DW_DLE_DF_MAKE_INSTR_NO_INIT           189
112207dc194Richard Lowe#define DW_DLE_DF_NEW_LOC_LESS_OLD_LOC         190
112307dc194Richard Lowe#define DW_DLE_DF_POP_EMPTY_STACK              191
112407dc194Richard Lowe#define DW_DLE_DF_ALLOC_FAIL                   192
112507dc194Richard Lowe#define DW_DLE_DF_FRAME_DECODING_ERROR         193
112607dc194Richard Lowe#define DW_DLE_DEBUG_LOC_SECTION_SHORT         194
112707dc194Richard Lowe#define DW_DLE_FRAME_AUGMENTATION_UNKNOWN      195
112807dc194Richard Lowe#define DW_DLE_PUBTYPE_CONTEXT                 196 /* Unused. */
112907dc194Richard Lowe#define DW_DLE_DEBUG_PUBTYPES_LENGTH_BAD       197
113007dc194Richard Lowe#define DW_DLE_DEBUG_PUBTYPES_VERSION_ERROR    198
113107dc194Richard Lowe#define DW_DLE_DEBUG_PUBTYPES_DUPLICATE        199
113207dc194Richard Lowe#define DW_DLE_FRAME_CIE_DECODE_ERROR          200
113307dc194Richard Lowe#define DW_DLE_FRAME_REGISTER_UNREPRESENTABLE  201
113407dc194Richard Lowe#define DW_DLE_FRAME_REGISTER_COUNT_MISMATCH   202
113507dc194Richard Lowe#define DW_DLE_LINK_LOOP                       203
113607dc194Richard Lowe#define DW_DLE_STRP_OFFSET_BAD                 204
113707dc194Richard Lowe#define DW_DLE_DEBUG_RANGES_DUPLICATE          205
113807dc194Richard Lowe#define DW_DLE_DEBUG_RANGES_OFFSET_BAD         206
113907dc194Richard Lowe#define DW_DLE_DEBUG_RANGES_MISSING_END        207
114007dc194Richard Lowe#define DW_DLE_DEBUG_RANGES_OUT_OF_MEM         208
114107dc194Richard Lowe#define DW_DLE_DEBUG_SYMTAB_ERR                209
114207dc194Richard Lowe#define DW_DLE_DEBUG_STRTAB_ERR                210
114307dc194Richard Lowe#define DW_DLE_RELOC_MISMATCH_INDEX            211
114407dc194Richard Lowe#define DW_DLE_RELOC_MISMATCH_RELOC_INDEX      212
114507dc194Richard Lowe#define DW_DLE_RELOC_MISMATCH_STRTAB_INDEX     213
114607dc194Richard Lowe#define DW_DLE_RELOC_SECTION_MISMATCH          214
114707dc194Richard Lowe#define DW_DLE_RELOC_SECTION_MISSING_INDEX     215
114807dc194Richard Lowe#define DW_DLE_RELOC_SECTION_LENGTH_ODD        216
114907dc194Richard Lowe#define DW_DLE_RELOC_SECTION_PTR_NULL          217
115007dc194Richard Lowe#define DW_DLE_RELOC_SECTION_MALLOC_FAIL       218
115107dc194Richard Lowe#define DW_DLE_NO_ELF64_SUPPORT                219
115207dc194Richard Lowe#define DW_DLE_MISSING_ELF64_SUPPORT           220
115307dc194Richard Lowe#define DW_DLE_ORPHAN_FDE                      221
115407dc194Richard Lowe#define DW_DLE_DUPLICATE_INST_BLOCK            222
115507dc194Richard Lowe#define DW_DLE_BAD_REF_SIG8_FORM               223
115607dc194Richard Lowe#define DW_DLE_ATTR_EXPRLOC_FORM_BAD           224
115707dc194Richard Lowe#define DW_DLE_FORM_SEC_OFFSET_LENGTH_BAD      225
115807dc194Richard Lowe#define DW_DLE_NOT_REF_FORM                    226
115907dc194Richard Lowe#define DW_DLE_DEBUG_FRAME_LENGTH_NOT_MULTIPLE 227
11604d9fdb4Robert Mustacchi#define DW_DLE_REF_SIG8_NOT_HANDLED            228
11614d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_FRAME_POSSIBLE_ADDRESS_BOTCH 229
11624d9fdb4Robert Mustacchi#define DW_DLE_LOC_BAD_TERMINATION             230
11634d9fdb4Robert Mustacchi#define DW_DLE_SYMTAB_SECTION_LENGTH_ODD       231
11644d9fdb4Robert Mustacchi#define DW_DLE_RELOC_SECTION_SYMBOL_INDEX_BAD  232
11654d9fdb4Robert Mustacchi#define DW_DLE_RELOC_SECTION_RELOC_TARGET_SIZE_UNKNOWN  233
11664d9fdb4Robert Mustacchi#define DW_DLE_SYMTAB_SECTION_ENTRYSIZE_ZERO   234
11674d9fdb4Robert Mustacchi#define DW_DLE_LINE_NUMBER_HEADER_ERROR        235
11684d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_TYPES_NULL                236
11694d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_TYPES_DUPLICATE           237
11704d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_TYPES_ONLY_DWARF4         238
11714d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_TYPEOFFSET_BAD            239
11724d9fdb4Robert Mustacchi#define DW_DLE_GNU_OPCODE_ERROR                240
11734d9fdb4Robert Mustacchi#define DW_DLE_DEBUGPUBTYPES_ERROR             241
11744d9fdb4Robert Mustacchi#define DW_DLE_AT_FIXUP_NULL                   242
11754d9fdb4Robert Mustacchi#define DW_DLE_AT_FIXUP_DUP                    243
11764d9fdb4Robert Mustacchi#define DW_DLE_BAD_ABINAME                     244
11774d9fdb4Robert Mustacchi#define DW_DLE_TOO_MANY_DEBUG                  245
11784d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_STR_OFFSETS_DUPLICATE     246
11794d9fdb4Robert Mustacchi#define DW_DLE_SECTION_DUPLICATION             247
11804d9fdb4Robert Mustacchi#define DW_DLE_SECTION_ERROR                   248
11814d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_ADDR_DUPLICATE            249
11824d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_CU_UNAVAILABLE_FOR_FORM   250
11834d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_FORM_HANDLING_INCOMPLETE  251
11844d9fdb4Robert Mustacchi#define DW_DLE_NEXT_DIE_PAST_END               252
11854d9fdb4Robert Mustacchi#define DW_DLE_NEXT_DIE_WRONG_FORM             253
11864d9fdb4Robert Mustacchi#define DW_DLE_NEXT_DIE_NO_ABBREV_LIST         254
11874d9fdb4Robert Mustacchi#define DW_DLE_NESTED_FORM_INDIRECT_ERROR      255
11884d9fdb4Robert Mustacchi#define DW_DLE_CU_DIE_NO_ABBREV_LIST           256
11894d9fdb4Robert Mustacchi#define DW_DLE_MISSING_NEEDED_DEBUG_ADDR_SECTION 257
11904d9fdb4Robert Mustacchi#define DW_DLE_ATTR_FORM_NOT_ADDR_INDEX        258
11914d9fdb4Robert Mustacchi#define DW_DLE_ATTR_FORM_NOT_STR_INDEX         259
11924d9fdb4Robert Mustacchi#define DW_DLE_DUPLICATE_GDB_INDEX             260
11934d9fdb4Robert Mustacchi#define DW_DLE_ERRONEOUS_GDB_INDEX_SECTION     261
11944d9fdb4Robert Mustacchi#define DW_DLE_GDB_INDEX_COUNT_ERROR           262
11954d9fdb4Robert Mustacchi#define DW_DLE_GDB_INDEX_COUNT_ADDR_ERROR      263
11964d9fdb4Robert Mustacchi#define DW_DLE_GDB_INDEX_INDEX_ERROR           264
11974d9fdb4Robert Mustacchi#define DW_DLE_GDB_INDEX_CUVEC_ERROR           265
11984d9fdb4Robert Mustacchi#define DW_DLE_DUPLICATE_CU_INDEX              266
11994d9fdb4Robert Mustacchi#define DW_DLE_DUPLICATE_TU_INDEX              267
12004d9fdb4Robert Mustacchi#define DW_DLE_XU_TYPE_ARG_ERROR               268
12014d9fdb4Robert Mustacchi#define DW_DLE_XU_IMPOSSIBLE_ERROR             269
12024d9fdb4Robert Mustacchi#define DW_DLE_XU_NAME_COL_ERROR               270
12034d9fdb4Robert Mustacchi#define DW_DLE_XU_HASH_ROW_ERROR               271
12044d9fdb4Robert Mustacchi#define DW_DLE_XU_HASH_INDEX_ERROR             272
12054d9fdb4Robert Mustacchi/* ..._FAILSAFE_ERRVAL is an aid when out of memory. */
12064d9fdb4Robert Mustacchi#define DW_DLE_FAILSAFE_ERRVAL                 273
12074d9fdb4Robert Mustacchi#define DW_DLE_ARANGE_ERROR                    274
12084d9fdb4Robert Mustacchi#define DW_DLE_PUBNAMES_ERROR                  275
12094d9fdb4Robert Mustacchi#define DW_DLE_FUNCNAMES_ERROR                 276
12104d9fdb4Robert Mustacchi#define DW_DLE_TYPENAMES_ERROR                 277
12114d9fdb4Robert Mustacchi#define DW_DLE_VARNAMES_ERROR                  278
12124d9fdb4Robert Mustacchi#define DW_DLE_WEAKNAMES_ERROR                 279
12134d9fdb4Robert Mustacchi#define DW_DLE_RELOCS_ERROR                    280
12144d9fdb4Robert Mustacchi#define DW_DLE_ATTR_OUTSIDE_SECTION            281
12154d9fdb4Robert Mustacchi#define DW_DLE_FISSION_INDEX_WRONG             282
12164d9fdb4Robert Mustacchi#define DW_DLE_FISSION_VERSION_ERROR           283
12174d9fdb4Robert Mustacchi#define DW_DLE_NEXT_DIE_LOW_ERROR              284
12184d9fdb4Robert Mustacchi#define DW_DLE_CU_UT_TYPE_ERROR                285
12194d9fdb4Robert Mustacchi#define DW_DLE_NO_SUCH_SIGNATURE_FOUND         286
12204d9fdb4Robert Mustacchi#define DW_DLE_SIGNATURE_SECTION_NUMBER_WRONG  287
12214d9fdb4Robert Mustacchi#define DW_DLE_ATTR_FORM_NOT_DATA8             288
12224d9fdb4Robert Mustacchi#define DW_DLE_SIG_TYPE_WRONG_STRING           289
12234d9fdb4Robert Mustacchi#define DW_DLE_MISSING_REQUIRED_TU_OFFSET_HASH 290
12244d9fdb4Robert Mustacchi#define DW_DLE_MISSING_REQUIRED_CU_OFFSET_HASH 291
12254d9fdb4Robert Mustacchi#define DW_DLE_DWP_MISSING_DWO_ID              292
12264d9fdb4Robert Mustacchi#define DW_DLE_DWP_SIBLING_ERROR               293
12274d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_FISSION_INCOMPLETE        294
12284d9fdb4Robert Mustacchi#define DW_DLE_FISSION_SECNUM_ERR              295
12294d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_MACRO_DUPLICATE           296
12304d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_NAMES_DUPLICATE           297
12314d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_LINE_STR_DUPLICATE        298
12324d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_SUP_DUPLICATE             299
12334d9fdb4Robert Mustacchi#define DW_DLE_NO_SIGNATURE_TO_LOOKUP          300
12344d9fdb4Robert Mustacchi#define DW_DLE_NO_TIED_ADDR_AVAILABLE          301
12354d9fdb4Robert Mustacchi#define DW_DLE_NO_TIED_SIG_AVAILABLE           302
12364d9fdb4Robert Mustacchi#define DW_DLE_STRING_NOT_TERMINATED           303
12374d9fdb4Robert Mustacchi#define DW_DLE_BAD_LINE_TABLE_OPERATION        304
12384d9fdb4Robert Mustacchi#define DW_DLE_LINE_CONTEXT_BOTCH              305
12394d9fdb4Robert Mustacchi#define DW_DLE_LINE_CONTEXT_INDEX_WRONG        306
12404d9fdb4Robert Mustacchi#define DW_DLE_NO_TIED_STRING_AVAILABLE        307
12414d9fdb4Robert Mustacchi#define DW_DLE_NO_TIED_FILE_AVAILABLE          308
12424d9fdb4Robert Mustacchi#define DW_DLE_CU_TYPE_MISSING                 309
12434d9fdb4Robert Mustacchi#define DW_DLE_LLE_CODE_UNKNOWN                310
12444d9fdb4Robert Mustacchi#define DW_DLE_LOCLIST_INTERFACE_ERROR         311
12454d9fdb4Robert Mustacchi#define DW_DLE_LOCLIST_INDEX_ERROR             312
12464d9fdb4Robert Mustacchi#define DW_DLE_INTERFACE_NOT_SUPPORTED         313
12474d9fdb4Robert Mustacchi#define DW_DLE_ZDEBUG_REQUIRES_ZLIB            314
12484d9fdb4Robert Mustacchi#define DW_DLE_ZDEBUG_INPUT_FORMAT_ODD         315
12494d9fdb4Robert Mustacchi#define DW_DLE_ZLIB_BUF_ERROR                  316
12504d9fdb4Robert Mustacchi#define DW_DLE_ZLIB_DATA_ERROR                 317
12514d9fdb4Robert Mustacchi#define DW_DLE_MACRO_OFFSET_BAD                318
12524d9fdb4Robert Mustacchi#define DW_DLE_MACRO_OPCODE_BAD                319
12534d9fdb4Robert Mustacchi#define DW_DLE_MACRO_OPCODE_FORM_BAD           320
12544d9fdb4Robert Mustacchi#define DW_DLE_UNKNOWN_FORM                    321
12554d9fdb4Robert Mustacchi#define DW_DLE_BAD_MACRO_HEADER_POINTER        322
12564d9fdb4Robert Mustacchi#define DW_DLE_BAD_MACRO_INDEX                 323
12574d9fdb4Robert Mustacchi#define DW_DLE_MACRO_OP_UNHANDLED              324
12584d9fdb4Robert Mustacchi#define DW_DLE_MACRO_PAST_END                  325
12594d9fdb4Robert Mustacchi#define DW_DLE_LINE_STRP_OFFSET_BAD            326
12604d9fdb4Robert Mustacchi#define DW_DLE_STRING_FORM_IMPROPER            327
12614d9fdb4Robert Mustacchi#define DW_DLE_ELF_FLAGS_NOT_AVAILABLE         328
12624d9fdb4Robert Mustacchi#define DW_DLE_LEB_IMPROPER                    329
12634d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_LINE_RANGE_ZERO           330
12644d9fdb4Robert Mustacchi#define DW_DLE_READ_LITTLEENDIAN_ERROR         331
12654d9fdb4Robert Mustacchi#define DW_DLE_READ_BIGENDIAN_ERROR            332
12664d9fdb4Robert Mustacchi#define DW_DLE_RELOC_INVALID                   333
12674d9fdb4Robert Mustacchi#define DW_DLE_INFO_HEADER_ERROR               334
12684d9fdb4Robert Mustacchi#define DW_DLE_ARANGES_HEADER_ERROR            335
12694d9fdb4Robert Mustacchi#define DW_DLE_LINE_OFFSET_WRONG_FORM          336
12704d9fdb4Robert Mustacchi#define DW_DLE_FORM_BLOCK_LENGTH_ERROR         337
12714d9fdb4Robert Mustacchi#define DW_DLE_ZLIB_SECTION_SHORT              338
12724d9fdb4Robert Mustacchi#define DW_DLE_CIE_INSTR_PTR_ERROR             339
12734d9fdb4Robert Mustacchi#define DW_DLE_FDE_INSTR_PTR_ERROR             340
12744d9fdb4Robert Mustacchi#define DW_DLE_FISSION_ADDITION_ERROR          341
12754d9fdb4Robert Mustacchi#define DW_DLE_HEADER_LEN_BIGGER_THAN_SECSIZE  342
12764d9fdb4Robert Mustacchi#define DW_DLE_LOCEXPR_OFF_SECTION_END         343
12774d9fdb4Robert Mustacchi#define DW_DLE_POINTER_SECTION_UNKNOWN         344
12784d9fdb4Robert Mustacchi#define DW_DLE_ERRONEOUS_XU_INDEX_SECTION      345
12794d9fdb4Robert Mustacchi#define DW_DLE_DIRECTORY_FORMAT_COUNT_VS_DIRECTORIES_MISMATCH 346
12804d9fdb4Robert Mustacchi#define DW_DLE_COMPRESSED_EMPTY_SECTION        347
12814d9fdb4Robert Mustacchi#define DW_DLE_SIZE_WRAPAROUND                 348
12824d9fdb4Robert Mustacchi#define DW_DLE_ILLOGICAL_TSEARCH               349
12834d9fdb4Robert Mustacchi#define DW_DLE_BAD_STRING_FORM                 350
12844d9fdb4Robert Mustacchi#define DW_DLE_DEBUGSTR_ERROR                  351
12854d9fdb4Robert Mustacchi#define DW_DLE_DEBUGSTR_UNEXPECTED_REL         352
12864d9fdb4Robert Mustacchi#define DW_DLE_DISCR_ARRAY_ERROR               353
12874d9fdb4Robert Mustacchi#define DW_DLE_LEB_OUT_ERROR                   354
12884d9fdb4Robert Mustacchi#define DW_DLE_SIBLING_LIST_IMPROPER           355
12894d9fdb4Robert Mustacchi#define DW_DLE_LOCLIST_OFFSET_BAD              356
12904d9fdb4Robert Mustacchi#define DW_DLE_LINE_TABLE_BAD                  357
12914d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_LOClISTS_DUPLICATE        358
12924d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_RNGLISTS_DUPLICATE        359
12934d9fdb4Robert Mustacchi#define DW_DLE_ABBREV_OFF_END                  360
12944d9fdb4Robert Mustacchi#define DW_DLE_FORM_STRING_BAD_STRING          361
12954d9fdb4Robert Mustacchi#define DW_DLE_AUGMENTATION_STRING_OFF_END     362
12964d9fdb4Robert Mustacchi#define DW_DLE_STRING_OFF_END_PUBNAMES_LIKE    363
12974d9fdb4Robert Mustacchi#define DW_DLE_LINE_STRING_BAD                 364
12984d9fdb4Robert Mustacchi#define DW_DLE_DEFINE_FILE_STRING_BAD          365
12994d9fdb4Robert Mustacchi#define DW_DLE_MACRO_STRING_BAD                366
13004d9fdb4Robert Mustacchi#define DW_DLE_MACINFO_STRING_BAD              367
13014d9fdb4Robert Mustacchi#define DW_DLE_ZLIB_UNCOMPRESS_ERROR           368
13024d9fdb4Robert Mustacchi#define DW_DLE_IMPROPER_DWO_ID                 369
13034d9fdb4Robert Mustacchi#define DW_DLE_GROUPNUMBER_ERROR               370
13044d9fdb4Robert Mustacchi#define DW_DLE_ADDRESS_SIZE_ZERO               371
13054d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_NAMES_HEADER_ERROR        372
13064d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_NAMES_AUG_STRING_ERROR    373
13074d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_NAMES_PAD_NON_ZERO        374
13084d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_NAMES_OFF_END             375
13094d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_NAMES_ABBREV_OVERFLOW     376
13104d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_NAMES_ABBREV_CORRUPTION   377
13114d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_NAMES_NULL_POINTER        378
13124d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_NAMES_BAD_INDEX_ARG       379
13134d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_NAMES_ENTRYPOOL_OFFSET    380
13144d9fdb4Robert Mustacchi#define DW_DLE_DEBUG_NAMES_UNHANDLED_FORM      381
13154d9fdb4Robert Mustacchi#define DW_DLE_LNCT_CODE_UNKNOWN               382
13164d9fdb4Robert Mustacchi#define DW_DLE_LNCT_FORM_CODE_NOT_HANDLED      383
13174d9fdb4Robert Mustacchi#define DW_DLE_LINE_HEADER_LENGTH_BOTCH        384
13184d9fdb4Robert Mustacchi#define DW_DLE_STRING_HASHTAB_IDENTITY_ERROR   385
13194d9fdb4Robert Mustacchi#define DW_DLE_UNIT_TYPE_NOT_HANDLED           386
13204d9fdb4Robert Mustacchi#define DW_DLE_GROUP_MAP_ALLOC                 387
13214d9fdb4Robert Mustacchi#define DW_DLE_GROUP_MAP_DUPLICATE             388
13224d9fdb4Robert Mustacchi#define DW_DLE_GROUP_COUNT_ERROR               389
13234d9fdb4Robert Mustacchi#define DW_DLE_GROUP_INTERNAL_ERROR            390
13244d9fdb4Robert Mustacchi#define DW_DLE_GROUP_LOAD_ERROR                391
13254d9fdb4Robert Mustacchi#define DW_DLE_GROUP_LOAD_READ_ERROR           392
13264d9fdb4Robert Mustacchi#define DW_DLE_AUG_DATA_LENGTH_BAD             393
13274d9fdb4Robert Mustacchi#define DW_DLE_ABBREV_MISSING                  394
13284d9fdb4Robert Mustacchi#define DW_DLE_NO_TAG_FOR_DIE                  395
13294d9fdb4Robert Mustacchi#define DW_DLE_LOWPC_WRONG_CLASS               396
13304d9fdb4Robert Mustacchi#define DW_DLE_HIGHPC_WRONG_FORM               397
13314d9fdb4Robert Mustacchi#define DW_DLE_STR_OFFSETS_BASE_WRONG_FORM     398
13324d9fdb4Robert Mustacchi#define DW_DLE_DATA16_OUTSIDE_SECTION          399
13334d9fdb4Robert Mustacchi#define DW_DLE_LNCT_MD5_WRONG_FORM             400
13344d9fdb4Robert Mustacchi#define DW_DLE_LINE_HEADER_CORRUPT             401
13354d9fdb4Robert Mustacchi#define DW_DLE_STR_OFFSETS_NULLARGUMENT        402
13364d9fdb4Robert Mustacchi#define DW_DLE_STR_OFFSETS_NULL_DBG            403
13374d9fdb4Robert Mustacchi#define DW_DLE_STR_OFFSETS_NO_MAGIC            404
13384d9fdb4Robert Mustacchi#define DW_DLE_STR_OFFSETS_ARRAY_SIZE          405
13394d9fdb4Robert Mustacchi#define DW_DLE_STR_OFFSETS_VERSION_WRONG       406
13404d9fdb4Robert Mustacchi#define DW_DLE_STR_OFFSETS_ARRAY_INDEX_WRONG   407
13414d9fdb4Robert Mustacchi#define DW_DLE_STR_OFFSETS_EXTRA_BYTES         408
13424d9fdb4Robert Mustacchi#define DW_DLE_DUP_ATTR_ON_DIE                 409
13434d9fdb4Robert Mustacchi#define DW_DLE_SECTION_NAME_BIG                410
13444d9fdb4Robert Mustacchi#define DW_DLE_FILE_UNAVAILABLE                411
13454d9fdb4Robert Mustacchi#define DW_DLE_FILE_WRONG_TYPE                 412
13464d9fdb4Robert Mustacchi#define DW_DLE_SIBLING_OFFSET_WRONG            413
13474d9fdb4Robert Mustacchi#define DW_DLE_OPEN_FAIL                       414
13484d9fdb4Robert Mustacchi#define DW_DLE_OFFSET_SIZE                     415
13494d9fdb4Robert Mustacchi#define DW_DLE_MACH_O_SEGOFFSET_BAD            416
13504d9fdb4Robert Mustacchi#define DW_DLE_FILE_OFFSET_BAD                 417
13514d9fdb4Robert Mustacchi#define DW_DLE_SEEK_ERROR                      418
13524d9fdb4Robert Mustacchi#define DW_DLE_READ_ERROR                      419
13534d9fdb4Robert Mustacchi#define DW_DLE_ELF_CLASS_BAD                   420
13544d9fdb4Robert Mustacchi#define DW_DLE_ELF_ENDIAN_BAD                  421
13554d9fdb4Robert Mustacchi#define DW_DLE_ELF_VERSION_BAD                 422
13564d9fdb4Robert Mustacchi#define DW_DLE_FILE_TOO_SMALL                  423
13574d9fdb4Robert Mustacchi#define DW_DLE_PATH_SIZE_TOO_SMALL             424
13584d9fdb4Robert Mustacchi#define DW_DLE_BAD_TYPE_SIZE                   425
13594d9fdb4Robert Mustacchi#define DW_DLE_PE_SIZE_SMALL                   426
13604d9fdb4Robert Mustacchi#define DW_DLE_PE_OFFSET_BAD                   427
13614d9fdb4Robert Mustacchi#define DW_DLE_PE_STRING_TOO_LONG              428
13624d9fdb4Robert Mustacchi#define DW_DLE_IMAGE_FILE_UNKNOWN_TYPE         429
13634d9fdb4Robert Mustacchi#define DW_DLE_LINE_TABLE_LINENO_ERROR         430
13644d9fdb4Robert Mustacchi#define DW_DLE_PRODUCER_CODE_NOT_AVAILABLE     431
13654d9fdb4Robert Mustacchi#define DW_DLE_NO_ELF_SUPPORT                  432
13664d9fdb4Robert Mustacchi#define DW_DLE_NO_STREAM_RELOC_SUPPORT         433
13674d9fdb4Robert Mustacchi#define DW_DLE_RETURN_EMPTY_PUBNAMES_ERROR     434
13684d9fdb4Robert Mustacchi#define DW_DLE_SECTION_SIZE_ERROR              435
13694d9fdb4Robert Mustacchi#define DW_DLE_INTERNAL_NULL_POINTER           436
13704d9fdb4Robert Mustacchi#define DW_DLE_SECTION_STRING_OFFSET_BAD       437
13714d9fdb4Robert Mustacchi#define DW_DLE_SECTION_INDEX_BAD               438
13724d9fdb4Robert Mustacchi#define DW_DLE_INTEGER_TOO_SMALL               439
13734d9fdb4Robert Mustacchi#define DW_DLE_ELF_SECTION_LINK_ERROR          440
13744d9fdb4Robert Mustacchi#define DW_DLE_ELF_SECTION_GROUP_ERROR         441
13754d9fdb4Robert Mustacchi#define DW_DLE_ELF_SECTION_COUNT_MISMATCH      442
13764d9fdb4Robert Mustacchi#define DW_DLE_ELF_STRING_SECTION_MISSING      443
13774d9fdb4Robert Mustacchi#define DW_DLE_SEEK_OFF_END                    444
13784d9fdb4Robert Mustacchi#define DW_DLE_READ_OFF_END                    445
13794d9fdb4Robert Mustacchi#define DW_DLE_ELF_SECTION_ERROR               446
13804d9fdb4Robert Mustacchi#define DW_DLE_ELF_STRING_SECTION_ERROR        447
13814d9fdb4Robert Mustacchi#define DW_DLE_MIXING_SPLIT_DWARF_VERSIONS     448
13824d9fdb4Robert Mustacchi#define DW_DLE_TAG_CORRUPT                     449
13834d9fdb4Robert Mustacchi#define DW_DLE_FORM_CORRUPT                    450
13844d9fdb4Robert Mustacchi#define DW_DLE_ATTR_CORRUPT                    451
13854d9fdb4Robert Mustacchi#define DW_DLE_ABBREV_ATTR_DUPLICATION         452
13864d9fdb4Robert Mustacchi#define DW_DLE_DWP_SIGNATURE_MISMATCH          453
13874d9fdb4Robert Mustacchi#define DW_DLE_CU_UT_TYPE_VALUE                454
13884d9fdb4Robert Mustacchi#define DW_DLE_DUPLICATE_GNU_DEBUGLINK         455
13894d9fdb4Robert Mustacchi#define DW_DLE_CORRUPT_GNU_DEBUGLINK           456
13904d9fdb4Robert Mustacchi#define DW_DLE_CORRUPT_NOTE_GNU_DEBUGID        457
13914d9fdb4Robert Mustacchi#define DW_DLE_CORRUPT_GNU_DEBUGID_SIZE        458
13924d9fdb4Robert Mustacchi#define DW_DLE_CORRUPT_GNU_DEBUGID_STRING      459
13934d9fdb4Robert Mustacchi#define DW_DLE_HEX_STRING_ERROR                460
13944d9fdb4Robert Mustacchi#define DW_DLE_DECIMAL_STRING_ERROR            461
13954d9fdb4Robert Mustacchi#define DW_DLE_PRO_INIT_EXTRAS_UNKNOWN         462
13964d9fdb4Robert Mustacchi#define DW_DLE_PRO_INIT_EXTRAS_ERR             463
13974d9fdb4Robert Mustacchi#define DW_DLE_NULL_ARGS_DWARF_ADD_PATH        464
13984d9fdb4Robert Mustacchi#define DW_DLE_DWARF_INIT_DBG_NULL             465
13994d9fdb4Robert Mustacchi#define DW_DLE_ELF_RELOC_SECTION_ERROR         466
14004d9fdb4Robert Mustacchi#define DW_DLE_USER_DECLARED_ERROR             467
14014d9fdb4Robert Mustacchi#define DW_DLE_RNGLISTS_ERROR                  468
14024d9fdb4Robert Mustacchi#define DW_DLE_LOCLISTS_ERROR                  469
14034d9fdb4Robert Mustacchi
14044d9fdb4Robert Mustacchi    /* LAST MUST EQUAL LAST ERROR NUMBER */
14054d9fdb4Robert Mustacchi#define DW_DLE_LAST        469
140607dc194Richard Lowe
14077c478bdstevel@tonic-gate#define DW_DLE_LO_USER     0x10000
14087c478bdstevel@tonic-gate
14094d9fdb4Robert Mustacchi    /*  Taken as meaning 'undefined value', this is not
14104d9fdb4Robert Mustacchi        a column or register number.
14114d9fdb4Robert Mustacchi        Only present at libdwarf runtime. Never on disk.
14124d9fdb4Robert Mustacchi        DW_FRAME_* Values present on disk are in dwarf.h
14134d9fdb4Robert Mustacchi    */
14147c478bdstevel@tonic-gate#define DW_FRAME_UNDEFINED_VAL          1034
14157c478bdstevel@tonic-gate
14164d9fdb4Robert Mustacchi    /*  Taken as meaning 'same value' as caller had, not a column
14174d9fdb4Robert Mustacchi        or register number
14184d9fdb4Robert Mustacchi        Only present at libdwarf runtime. Never on disk.
14194d9fdb4Robert Mustacchi        DW_FRAME_* Values present on disk are in dwarf.h
14204d9fdb4Robert Mustacchi    */
14217c478bdstevel@tonic-gate#define DW_FRAME_SAME_VAL               1035
14227c478bdstevel@tonic-gate
14237c478bdstevel@tonic-gate
14247c478bdstevel@tonic-gate
14254d9fdb4Robert Mustacchi/* error return values
14267c478bdstevel@tonic-gate*/
14274d9fdb4Robert Mustacchi#define DW_DLV_BADADDR     (~(Dwarf_Addr)0)
142807dc194Richard Lowe    /* for functions returning target address */
14297c478bdstevel@tonic-gate
14304d9fdb4Robert Mustacchi#define DW_DLV_NOCOUNT     ((Dwarf_Signed)-1)
143107dc194Richard Lowe    /* for functions returning count */
14327c478bdstevel@tonic-gate
14334d9fdb4Robert Mustacchi#define DW_DLV_BADOFFSET   (~(Dwarf_Off)0)
143407dc194Richard Lowe    /* for functions returning offset */
14357c478bdstevel@tonic-gate
14367c478bdstevel@tonic-gate/* standard return values for functions */
14377c478bdstevel@tonic-gate#define DW_DLV_NO_ENTRY -1
14387c478bdstevel@tonic-gate#define DW_DLV_OK        0
14397c478bdstevel@tonic-gate#define DW_DLV_ERROR     1
14407c478bdstevel@tonic-gate
14417c478bdstevel@tonic-gate/* Special values for offset_into_exception_table field of dwarf fde's. */
14427c478bdstevel@tonic-gate/* The following value indicates that there is no Exception table offset
14437c478bdstevel@tonic-gate   associated with a dwarf frame. */
144407dc194Richard Lowe#define DW_DLX_NO_EH_OFFSET         (-1LL)
14457c478bdstevel@tonic-gate/* The following value indicates that the producer was unable to analyse the
14467c478bdstevel@tonic-gate   source file to generate Exception tables for this function. */
14477c478bdstevel@tonic-gate#define DW_DLX_EH_OFFSET_UNAVAILABLE  (-2LL)
14487c478bdstevel@tonic-gate
14494d9fdb4Robert Mustacchi/* The dwarf specification separates FORMs into
14504d9fdb4Robert Mustacchidifferent classes.  To do the seperation properly
14514d9fdb4Robert Mustacchirequires 4 pieces of data as of DWARF4 (thus the
14524d9fdb4Robert Mustacchifunction arguments listed here).
14534d9fdb4Robert MustacchiThe DWARF4 specification class definition suffices to
14544d9fdb4Robert Mustacchidescribe all DWARF versions.
14554d9fdb4Robert MustacchiSee section 7.5.4, Attribute Encodings.
14564d9fdb4Robert MustacchiA return of DW_FORM_CLASS_UNKNOWN means we could not properly figure
14574d9fdb4Robert Mustacchiout what form-class it is.
14584d9fdb4Robert Mustacchi
14594d9fdb4Robert Mustacchi    DW_FORM_CLASS_FRAMEPTR is MIPS/IRIX only, and refers
14604d9fdb4Robert Mustacchi    to the DW_AT_MIPS_fde attribute (a reference to the
14614d9fdb4Robert Mustacchi    .debug_frame section).
14624d9fdb4Robert Mustacchi
1463