libdwarf.h revision 07dc1947c362e187fb955d283b692f8769dd5def
/*
Copyright (C) 2000-2010 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright 2007-2010 Sun Microsystems, Inc. All rights reserved.
Portions Copyright 2008-2010 David Anderson. All rights reserved.
Portions Copyright 2008-2010 Arxan Technologies, Inc. All rights reserved.
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
For further information regarding this notice, see:
*/
#ifndef _LIBDWARF_H
#define _LIBDWARF_H
#ifdef __cplusplus
extern "C" {
#endif
/*
$Revision: #9 $ $Date: 2008/01/17 $
For libdwarf producers and consumers
The interface is defined as having 8-byte signed and unsigned
values so it can handle 64-or-32bit target on 64-or-32bit host.
Addr is the native size: it represents pointers on
the host machine (not the target!).
This contains declarations for types and all producer
and consumer functions.
Function declarations are written on a single line each here
so one can use grep to each declaration in its entirety.
The declarations are a little harder to read this way, but...
*/
struct Elf;
typedef struct Elf* dwarf_elf_handle;
/* To enable printing with printf regardless of the
actual underlying data type, we define the DW_PR_xxx macros. */
#if (_MIPS_SZLONG == 64)
/* Special case for MIPS, so -64 (LP64) build gets simple -long-.
Non-MIPS LP64 or ILP64 environments should probably ensure
_MIPS_SZLONG set to 64 everywhere this header is #included.
*/
typedef int Dwarf_Bool; /* boolean type */
typedef unsigned long Dwarf_Off; /* 4 or 8 byte file offset */
typedef unsigned long Dwarf_Unsigned; /* 4 or 8 byte unsigned value */
typedef unsigned short Dwarf_Half; /* 2 byte unsigned value */
typedef unsigned char Dwarf_Small; /* 1 byte unsigned value */
typedef signed long Dwarf_Signed; /* 4 or 8 byte signed value */
typedef unsigned long Dwarf_Addr; /* target memory address */
#define DW_PR_DUx "lx"
#define DW_PR_DSx "lx"
#define DW_PR_DUu "lu"
#define DW_PR_DSd "ld"
#else /* 32-bit */
/* This is for ILP32, allowing i/o of 64bit dwarf info.
Also should be fine for LP64 and ILP64 cases.
*/
typedef int Dwarf_Bool; /* boolean type */
typedef unsigned long long Dwarf_Off; /* 8 byte file offset */
typedef unsigned long long Dwarf_Unsigned; /* 8 byte unsigned value*/
typedef unsigned short Dwarf_Half; /* 2 byte unsigned value */
typedef unsigned char Dwarf_Small; /* 1 byte unsigned value */
typedef signed long long Dwarf_Signed; /* 8 byte signed value */
typedef unsigned long long Dwarf_Addr; /* target memory address */
#define DW_PR_DUx "llx"
#define DW_PR_DSx "llx"
#define DW_PR_DUu "llu"
#define DW_PR_DSd "lld"
#endif
/* Windows does not use std C formatting, so allow it. */
#define DW_PR_DUx "I64x"
#define DW_PR_DSx "I64x"
#define DW_PR_DUu "I64u"
#define DW_PR_DSd "I64d"
#endif /* HAVE_NONSTANDARD_FORMAT */
typedef void* Dwarf_Ptr; /* host machine pointer */
/* Used for DW_FORM_ref_sig8. It is not a string, it
is 8 bytes of a signature one would use to find
a type unit. See dwarf_formsig8()
*/
typedef struct {
char signature[8];
} Dwarf_Sig8;
/* Contains info on an uninterpreted block of data
*/
typedef struct {
which 'data' comes from. */
} Dwarf_Block;
/* location record
*/
typedef struct {
} Dwarf_Loc;
/* location description
*/
typedef struct {
/* non-0 if loclist, else debug_info*/
where loc-expr begins*/
/* First appears in DWARF3.
or an address (dwr_addr2 in DW_RANGES_ADDRESS_SELECTION) or
both are zero (DW_RANGES_END).
*/
typedef struct {
} Dwarf_Ranges;
/* Frame description instructions expanded.
*/
typedef struct {
/* Value may be signed, depends on op.
Any applicable data_alignment_factor has
not been applied, this is the raw offset. */
} Dwarf_Frame_Op; /* DWARF2 */
typedef struct {
/* Value may be signed, depends on op.
Any applicable data_alignment_factor has
not been applied, this is the raw offset. */
} Dwarf_Frame_Op3; /* DWARF3 and DWARF2 compatible */
/* ***IMPORTANT NOTE, TARGET DEPENDENCY ****
DW_REG_TABLE_SIZE must be at least as large as
the number of registers
(DW_FRAME_LAST_REG_NUM) as defined in dwarf.h
Preferably identical to DW_FRAME_LAST_REG_NUM.
Ensure [0-DW_REG_TABLE_SIZE] does not overlap
DW_FRAME_UNDEFINED_VAL or DW_FRAME_SAME_VAL.
Also ensure DW_FRAME_REG_INITIAL_VALUE is set to what
is appropriate to your cpu.
For various CPUs DW_FRAME_UNDEFINED_VAL is correct
as the value for DW_FRAME_REG_INITIAL_VALUE.
For consumer apps, this can be set dynamically: see
dwarf_set_frame_rule_table_size();
*/
#ifndef DW_REG_TABLE_SIZE
#define DW_REG_TABLE_SIZE 66
#endif
/* For MIPS, DW_FRAME_SAME_VAL is the correct default value
for a frame register value. For other CPUS another value
may be better, such as DW_FRAME_UNDEFINED_VAL.
See dwarf_set_frame_rule_table_size
*/
#ifndef DW_FRAME_REG_INITIAL_VALUE
#endif
/* Taken as meaning 'undefined value', this is not
a column or register number.
Only present at libdwarf runtime in the consumer
interfaces. Never on disk.
DW_FRAME_* Values present on disk are in dwarf.h
Ensure this is > DW_REG_TABLE_SIZE (the reg table
size is changeable at runtime with the *reg3() interfaces,
and this value must be greater than the reg table size).
*/
#define DW_FRAME_UNDEFINED_VAL 1034
/* Taken as meaning 'same value' as caller had, not a column
or register number.
Only present at libdwarf runtime in the consumer
interfaces. Never on disk.
DW_FRAME_* Values present on disk are in dwarf.h
Ensure this is > DW_REG_TABLE_SIZE (the reg table
size is changeable at runtime with the *reg3() interfaces,
and this value must be greater than the reg table size).
*/
#define DW_FRAME_SAME_VAL 1035
/* For DWARF3 consumer interfaces, make the CFA a column with no
real table number. This is what should have been done
for the DWARF2 interfaces. This actually works for
both DWARF2 and DWARF3, but see the libdwarf documentation
on Dwarf_Regtable3 and dwarf_get_fde_info_for_reg3()
and dwarf_get_fde_info_for_all_regs3()
Do NOT use this with the older dwarf_get_fde_info_for_reg()
or dwarf_get_fde_info_for_all_regs() consumer interfaces.
Must be higher than any register count for *any* ABI
(ensures maximum applicability with minimum effort).
Ensure this is > DW_REG_TABLE_SIZE (the reg table
size is changeable at runtime with the *reg3() interfaces,
and this value must be greater than the reg table size).
Only present at libdwarf runtime in the consumer
interfaces. Never on disk.
*/
#define DW_FRAME_CFA_COL3 1436
/* The following are all needed to evaluate DWARF3 register rules.
*/
#define DW_EXPR_OFFSET 0 /* DWARF2 only sees this. */
#define DW_EXPR_VAL_OFFSET 1
#define DW_EXPR_EXPRESSION 2
#define DW_EXPR_VAL_EXPRESSION 3
typedef struct Dwarf_Regtable_Entry_s {
/* For each index i (naming a hardware register with dwarf number
i) the following is true and defines the value of that register:
If dw_regnum is Register DW_FRAME_UNDEFINED_VAL
it is not DWARF register number but
a place holder indicating the register has no defined value.
If dw_regnum is Register DW_FRAME_SAME_VAL
it is not DWARF register number but
a place holder indicating the register has the same
value in the previous frame.
DW_FRAME_UNDEFINED_VAL, DW_FRAME_SAME_VAL are
only present at libdwarf runtime. Never on disk.
DW_FRAME_* Values present on disk are in dwarf.h
Otherwise: the register number is a DWARF register number
(see ABI documents for how this translates to hardware/
software register numbers in the machine hardware)
and the following applies:
if dw_value_type == DW_EXPR_OFFSET (the only case for dwarf2):
If dw_offset_relevant is non-zero, then
the value is stored at at the address CFA+N where
N is a signed offset.
Rule: Offset(N)
If dw_offset_relevant is zero, then the value of the register
is the value of (DWARF) register number dw_regnum.
Rule: register(F)
Other values of dw_value_type are an error.
*/
/* For DWARF2, always 0 */
/* The data type here should the larger of Dwarf_Addr
and Dwarf_Unsigned and Dwarf_Signed. */
typedef struct Dwarf_Regtable_s {
/* opaque type. Functional interface shown later. */
struct Dwarf_Reg_value3_s;
typedef struct Dwarf_Reg_value3_s Dwarf_Reg_Value3;
typedef struct Dwarf_Regtable_Entry3_s {
/* For each index i (naming a hardware register with dwarf number
i) the following is true and defines the value of that register:
If dw_regnum is Register DW_FRAME_UNDEFINED_VAL
it is not DWARF register number but
a place holder indicating the register has no defined value.
If dw_regnum is Register DW_FRAME_SAME_VAL
it is not DWARF register number but
a place holder indicating the register has the same
value in the previous frame.
DW_FRAME_UNDEFINED_VAL, DW_FRAME_SAME_VAL and
DW_FRAME_CFA_COL3 are only present at libdwarf runtime.
Never on disk.
DW_FRAME_* Values present on disk are in dwarf.h
Because DW_FRAME_SAME_VAL and DW_FRAME_UNDEFINED_VAL
and DW_FRAME_CFA_COL3 are defineable at runtime
consider the names symbolic in this comment, not absolute.
Otherwise: the register number is a DWARF register number
(see ABI documents for how this translates to hardware/
software register numbers in the machine hardware)
and the following applies:
In a cfa-defining entry (rt3_cfa_rule) the regnum is the
CFA 'register number'. Which is some 'normal' register,
not DW_FRAME_CFA_COL3, nor DW_FRAME_SAME_VAL, nor
DW_FRAME_UNDEFINED_VAL.
If dw_value_type == DW_EXPR_OFFSET (the only possible case for
dwarf2):
If dw_offset_relevant is non-zero, then
the value is stored at at the address
CFA+N where N is a signed offset.
dw_regnum is the cfa register rule which means
one ignores dw_regnum and uses the CFA appropriately.
So dw_offset_or_block_len is a signed value, really,
Rule: Offset(N)
If dw_offset_relevant is zero, then the value of the register
is the value of (DWARF) register number dw_regnum.
Rule: register(R)
If dw_value_type == DW_EXPR_VAL_OFFSET
the value of this register is CFA +N where N is a signed offset.
dw_regnum is the cfa register rule which means
one ignores dw_regnum and uses the CFA appropriately.
Rule: val_offset(N)
If dw_value_type == DW_EXPR_EXPRESSION
The value of the register is the value at the address
computed by evaluating the DWARF expression E.
Rule: expression(E)
The expression E byte stream is pointed to by dw_block_ptr.
The expression length in bytes is given by
dw_offset_or_block_len.
If dw_value_type == DW_EXPR_VAL_EXPRESSION
The value of the register is the value
computed by evaluating the DWARF expression E.
Rule: val_expression(E)
The expression E byte stream is pointed to by dw_block_ptr.
The expression length in bytes is given by
dw_offset_or_block_len.
Other values of dw_value_type are an error.
*/
/* For the DWARF3 version, moved the DW_FRAME_CFA_COL
out of the array and into its own struct.
Having it part of the array is not very easy to work
with from a portability point of view: changing
the number for every architecture is a pain (if one fails
to set it correctly a register rule gets clobbered when
setting CFA). With MIPS it just happened to be easy to use
DW_FRAME_CFA_COL (it was wrong conceptually but it was easy...).
rt3_rules and rt3_reg_table_size must be filled in before
calling libdwarf. Filled in with a pointer to an array
(pointer and array set up by the calling application)
of rt3_reg_table_size Dwarf_Regtable_Entry3_s structs.
libdwarf does not allocate or deallocate space for the
rules, you must do so. libdwarf will initialize the
contents rules array, you do not need to do so (though
if you choose to initialize the array somehow that is ok:
libdwarf will overwrite your initializations with its own).
*/
typedef struct Dwarf_Regtable3_s {
struct Dwarf_Regtable_Entry3_s rt3_cfa_rule;
struct Dwarf_Regtable_Entry3_s * rt3_rules;
/* Use for DW_EPXR_STANDARD., DW_EXPR_VAL_OFFSET.
Returns DW_DLV_OK if the value is available.
If DW_DLV_OK returns the regnum and offset thru the pointers
(which the consumer must use appropriately).
*/
/* Use for DW_EXPR_EXPRESSION, DW_EXPR_VAL_EXPRESSION.
Returns DW_DLV_OK if the value is available.
The caller must pass in the address of a valid
Dwarf_Block (the caller need not initialize it).
*/
/* For DW_DLC_SYMBOLIC_RELOCATIONS output to caller
v2, adding drd_length: some relocations are 4 and
some 8 bytes (pointers are 8, section offsets 4) in
some dwarf environments. (MIPS relocations are all one
size in any given ABI.) Changing drd_type to an unsigned char
to keep struct size down.
*/
enum Dwarf_Rel_Type {
dwarf_drt_none, /* Should not get to caller */
dwarf_drt_data_reloc, /* Simple normal relocation. */
dwarf_drt_segment_rel, /* Special reloc, exceptions. */
/* dwarf_drt_first_of_length_pair and drt_second
are for for the .word end - begin case. */
};
typedef struct Dwarf_P_Marker_s * Dwarf_P_Marker;
struct Dwarf_P_Marker_s {
};
typedef struct Dwarf_Relocation_Data_s * Dwarf_Relocation_Data;
struct Dwarf_Relocation_Data_s {
to keep size small in struct. */
unsigned char drd_length; /* Length in bytes of data being
relocated. 4 for 32bit data,
8 for 64bit data. */
};
typedef struct Dwarf_P_String_Attr_s * Dwarf_P_String_Attr;
struct Dwarf_P_String_Attr_s {
};
/* Opaque types for Consumer Library. */
typedef struct Dwarf_Debug_s* Dwarf_Debug;
typedef struct Dwarf_Die_s* Dwarf_Die;
typedef struct Dwarf_Line_s* Dwarf_Line;
typedef struct Dwarf_Global_s* Dwarf_Global;
typedef struct Dwarf_Func_s* Dwarf_Func;
typedef struct Dwarf_Type_s* Dwarf_Type;
typedef struct Dwarf_Var_s* Dwarf_Var;
typedef struct Dwarf_Weak_s* Dwarf_Weak;
typedef struct Dwarf_Error_s* Dwarf_Error;
typedef struct Dwarf_Attribute_s* Dwarf_Attribute;
typedef struct Dwarf_Abbrev_s* Dwarf_Abbrev;
typedef struct Dwarf_Fde_s* Dwarf_Fde;
typedef struct Dwarf_Cie_s* Dwarf_Cie;
typedef struct Dwarf_Arange_s* Dwarf_Arange;
/* Opaque types for Producer Library. */
typedef struct Dwarf_P_Debug_s* Dwarf_P_Debug;
typedef struct Dwarf_P_Die_s* Dwarf_P_Die;
typedef struct Dwarf_P_Attribute_s* Dwarf_P_Attribute;
typedef struct Dwarf_P_Fde_s* Dwarf_P_Fde;
typedef struct Dwarf_P_Expr_s* Dwarf_P_Expr;
typedef Dwarf_Unsigned Dwarf_Tag;
/* error handler function
*/
/* Begin libdwarf Object File Interface declarations.
As of February 2008 there are multiple dwarf_reader object access
initialization methods available:
The traditional dwarf_elf_init() and dwarf_init() and dwarf_finish()
which assume libelf and POSIX file access.
An object-file and library agnostic dwarf_object_init() and dwarf_object_finish()
which allow the coder to provide object access routines
abstracting away the elf interface. So there is no dependence in the
reader code on the object format and no dependence on libelf.
See the code in dwarf_elf_access.c and dwarf_original_elf_init.c
to see an example of initializing the structures mentioned below.
Projects using dwarf_elf_init() or dwarf_init() can ignore
the Dwarf_Obj_Access* structures entirely as all these details
are completed for you.
*/
typedef struct Dwarf_Obj_Access_Interface_s Dwarf_Obj_Access_Interface;
typedef struct Dwarf_Obj_Access_Methods_s Dwarf_Obj_Access_Methods;
typedef struct Dwarf_Obj_Access_Section_s Dwarf_Obj_Access_Section;
/* Used in the get_section interface function
in Dwarf_Obj_Access_Section_s. Since libdwarf
depends on standard DWARF section names an object
format that has no such names (but has some
method of setting up 'sections equivalents')
must arrange to return standard DWARF section
names in the 'name' field. libdwarf does
not free the strings in 'name'. */
struct Dwarf_Obj_Access_Section_s {
const char* name;
/* Set link to zero if it is meaningless. If non-zero
it should be a link to a rela section or from symtab
to strtab. In Elf it is sh_link. */
};
/* Returned by the get_endianness function in
Dwarf_Obj_Access_Methods_s. */
typedef enum {
/* The functions we need to access object data from libdwarf are declared here.
In these function pointer declarations
'void *obj' is intended to be a pointer (the object field in
Dwarf_Obj_Access_Interface_s)
that hides the library-specific and object-specific data that makes
it possible to handle multiple object formats and multiple libraries.
It's not required that one handles multiple such in a single libdwarf
archive/shared-library (but not ruled out either).
See dwarf_elf_object_access_internals_t and dwarf_elf_access.c
for an example.
*/
struct Dwarf_Obj_Access_Methods_s {
/**
* get_section_info
*
* Get address, size, and name info about a section.
*
* Parameters
* section_index - Zero-based index.
* return_section - Pointer to a structure in which section info
* will be placed. Caller must provide a valid pointer to a
* structure area. The structure's contents will be overwritten
* by the call to get_section_info.
* error - A pointer to an integer in which an error code may be stored.
*
* Return
* DW_DLV_OK - Everything ok.
* DW_DLV_ERROR - Error occurred. Use 'error' to determine the
* libdwarf defined error.
* DW_DLV_NO_ENTRY - No such section.
*/
/**
* get_byte_order
*
* Get whether the object file represented by this interface is big-endian
* (DW_OBJECT_MSB) or little endian (DW_OBJECT_LSB).
*
* Parameters
* obj - Equivalent to 'this' in OO languages.
*
* Return
* Endianness of object. Cannot fail.
*/
/**
* get_length_size
*
* Get the size of a length field in the underlying object file.
* libdwarf currently supports * 4 and 8 byte sizes, but may
* support larger in the future.
* Perhaps the return type should be an enumeration?
*
* Parameters
* obj - Equivalent to 'this' in OO languages.
*
* Return
* Size of length. Cannot fail.
*/
/**
* get_pointer_size
*
* Get the size of a pointer field in the underlying object file.
* libdwarf currently supports 4 and 8 byte sizes.
* Perhaps the return type should be an enumeration?
* Return
* Size of pointer. Cannot fail.
*/
/**
* get_section_count
*
* Get the number of sections in the object file.
*
* Parameters
*
* Return
* Number of sections
*/
/**
* load_section
*
* Get a pointer to an array of bytes that represent the section.
*
* Parameters
* section_index - Zero-based index.
* return_data - The address of a pointer to which the section data block
* will be assigned.
* error - Pointer to an integer for returning libdwarf-defined
* error numbers.
*
* Return
* DW_DLV_OK - No error.
* DW_DLV_ERROR - Error. Use 'error' to indicate a libdwarf-defined
* error number.
* DW_DLV_NO_ENTRY - No such section.
*/
/**
* relocate_a_section
* If relocations are not supported leave this pointer NULL.
*
* Get a pointer to an array of bytes that represent the section.
*
* Parameters
* section_index - Zero-based index of the section to be relocated.
* error - Pointer to an integer for returning libdwarf-defined
* error numbers.
*
* Return
* DW_DLV_OK - No error.
* DW_DLV_ERROR - Error. Use 'error' to indicate a libdwarf-defined
* error number.
* DW_DLV_NO_ENTRY - No such section.
*/
int* error);
};
/* These structures are allocated and deallocated by your code
when you are using the libdwarf Object File Interface
[dwarf_object_init() and dwarf_object_finish()] directly.
dwarf_object_finish() does not free
struct Dwarf_Obj_Access_Interface_s or its content.
(libdwarf does record a pointer to this struct: you must
ensure that pointer remains valid for as long as
a libdwarf instance is open (meaning
after dwarf_init() and before dwarf_finish()).
If you are reading Elf objects and libelf use dwarf_init()
or dwarf_elf_init() which take care of these details.
*/
struct Dwarf_Obj_Access_Interface_s {
/* object is a void* as it hides the data the object access routines
need (which varies by library in use and object format).
*/
void* object;
const Dwarf_Obj_Access_Methods * methods;
};
/* End libdwarf Object File Interface */
/*
Dwarf_dealloc() alloc_type arguments.
Argument points to:
*/
/* The augmenter string for CIE */
#define DW_CIE_AUGMENTER_STRING_V0 "z"
/* dwarf_init() access arguments
*/
#define DW_DLC_READ 0 /* read only access */
/* pro_init() access flag modifiers
If HAVE_DWARF2_99_EXTENSION is defined at libdwarf build time
and DW_DLC_OFFSET_SIZE_64 is passed in pro_init() flags then the DWARF3
64 bit offset extension is used to generate 64 bit offsets.
*/
/* dwarf_pro_init() access flag modifiers
*/
/* Usable with assembly output because it is up to the producer to
deal with locations in whatever manner the producer code wishes.
Possibly emitting text an assembler will recognize. */
#define DW_DLC_SYMBOLIC_RELOCATIONS 0x04000000
#if 0
/*
The libdwarf producer interfaces jumble these two semantics together in
confusing ways. We *should* have flags like these...
But changing the code means a lot of diffs. So for now,
we leave things as they are
*/
#endif
/* dwarf_pcline() slide arguments
*/
#define DW_DLS_NOSLIDE 0 /* match exactly without sliding */
/* libdwarf error numbers
*/
#define DW_DLE_NE 0 /* no error */
/* It is not an allowed size (64 or 32) */
/* Error codes defined by the current Libdwarf Implementation. */
#define DW_DLE_DBG_ALLOC 23
#define DW_DLE_FSTAT_ERROR 24
#define DW_DLE_FSTAT_MODE_ERROR 25
#define DW_DLE_INIT_ACCESS_WRONG 26
#define DW_DLE_ELF_BEGIN_ERROR 27
#define DW_DLE_ELF_GETEHDR_ERROR 28
#define DW_DLE_ELF_GETSHDR_ERROR 29
#define DW_DLE_ELF_STRPTR_ERROR 30
#define DW_DLE_DEBUG_INFO_DUPLICATE 31
#define DW_DLE_DEBUG_INFO_NULL 32
#define DW_DLE_DEBUG_ABBREV_DUPLICATE 33
#define DW_DLE_DEBUG_ABBREV_NULL 34
#define DW_DLE_DEBUG_ARANGES_DUPLICATE 35
#define DW_DLE_DEBUG_ARANGES_NULL 36
#define DW_DLE_DEBUG_LINE_DUPLICATE 37
#define DW_DLE_DEBUG_LINE_NULL 38
#define DW_DLE_DEBUG_LOC_DUPLICATE 39
#define DW_DLE_DEBUG_LOC_NULL 40
#define DW_DLE_DEBUG_MACINFO_DUPLICATE 41
#define DW_DLE_DEBUG_MACINFO_NULL 42
#define DW_DLE_DEBUG_PUBNAMES_DUPLICATE 43
#define DW_DLE_DEBUG_PUBNAMES_NULL 44
#define DW_DLE_DEBUG_STR_DUPLICATE 45
#define DW_DLE_DEBUG_STR_NULL 46
#define DW_DLE_CU_LENGTH_ERROR 47
#define DW_DLE_VERSION_STAMP_ERROR 48
#define DW_DLE_ABBREV_OFFSET_ERROR 49
#define DW_DLE_ADDRESS_SIZE_ERROR 50
#define DW_DLE_DEBUG_INFO_PTR_NULL 51
#define DW_DLE_DIE_NULL 52
#define DW_DLE_STRING_OFFSET_BAD 53
#define DW_DLE_DEBUG_LINE_LENGTH_BAD 54
#define DW_DLE_LINE_PROLOG_LENGTH_BAD 55
#define DW_DLE_LINE_NUM_OPERANDS_BAD 56
#define DW_DLE_LINE_EXT_OPCODE_BAD 58
#define DW_DLE_DWARF_LINE_NULL 59
#define DW_DLE_INCL_DIR_NUM_BAD 60
#define DW_DLE_LINE_FILE_NUM_BAD 61
#define DW_DLE_ALLOC_FAIL 62
#define DW_DLE_NO_CALLBACK_FUNC 63
#define DW_DLE_SECT_ALLOC 64
#define DW_DLE_FILE_ENTRY_ALLOC 65
#define DW_DLE_LINE_ALLOC 66
#define DW_DLE_FPGM_ALLOC 67
#define DW_DLE_INCDIR_ALLOC 68
#define DW_DLE_STRING_ALLOC 69
#define DW_DLE_CHUNK_ALLOC 70
#define DW_DLE_BYTEOFF_ERR 71
#define DW_DLE_CIE_ALLOC 72
#define DW_DLE_FDE_ALLOC 73
#define DW_DLE_REGNO_OVFL 74
#define DW_DLE_CIE_OFFS_ALLOC 75
#define DW_DLE_WRONG_ADDRESS 76
#define DW_DLE_EXTRA_NEIGHBORS 77
#define DW_DLE_WRONG_TAG 78
#define DW_DLE_DIE_ALLOC 79
#define DW_DLE_PARENT_EXISTS 80
#define DW_DLE_DBG_NULL 81
#define DW_DLE_DEBUGLINE_ERROR 82
#define DW_DLE_DEBUGFRAME_ERROR 83
#define DW_DLE_DEBUGINFO_ERROR 84
#define DW_DLE_ATTR_ALLOC 85
#define DW_DLE_ABBREV_ALLOC 86
#define DW_DLE_OFFSET_UFLW 87
#define DW_DLE_ELF_SECT_ERR 88
#define DW_DLE_DEBUG_FRAME_LENGTH_BAD 89
#define DW_DLE_FRAME_VERSION_BAD 90
#define DW_DLE_CIE_RET_ADDR_REG_ERROR 91
#define DW_DLE_FDE_NULL 92
#define DW_DLE_FDE_DBG_NULL 93
#define DW_DLE_CIE_NULL 94
#define DW_DLE_CIE_DBG_NULL 95
#define DW_DLE_FRAME_TABLE_COL_BAD 96
#define DW_DLE_PC_NOT_IN_FDE_RANGE 97
#define DW_DLE_CIE_INSTR_EXEC_ERROR 98
#define DW_DLE_FRAME_INSTR_EXEC_ERROR 99
#define DW_DLE_FDE_PTR_NULL 100
#define DW_DLE_RET_OP_LIST_NULL 101
#define DW_DLE_LINE_CONTEXT_NULL 102
#define DW_DLE_DBG_NO_CU_CONTEXT 103
#define DW_DLE_DIE_NO_CU_CONTEXT 104
#define DW_DLE_FIRST_DIE_NOT_CU 105
#define DW_DLE_NEXT_DIE_PTR_NULL 106
#define DW_DLE_DEBUG_FRAME_DUPLICATE 107
#define DW_DLE_DEBUG_FRAME_NULL 108
#define DW_DLE_ABBREV_DECODE_ERROR 109
#define DW_DLE_DWARF_ABBREV_NULL 110
#define DW_DLE_ATTR_NULL 111
#define DW_DLE_DIE_BAD 112
#define DW_DLE_DIE_ABBREV_BAD 113
#define DW_DLE_ATTR_FORM_BAD 114
#define DW_DLE_ATTR_NO_CU_CONTEXT 115
#define DW_DLE_ATTR_FORM_SIZE_BAD 116
#define DW_DLE_ATTR_DBG_NULL 117
#define DW_DLE_BAD_REF_FORM 118
#define DW_DLE_ATTR_FORM_OFFSET_BAD 119
#define DW_DLE_LINE_OFFSET_BAD 120
#define DW_DLE_DEBUG_STR_OFFSET_BAD 121
#define DW_DLE_STRING_PTR_NULL 122
#define DW_DLE_PUBNAMES_VERSION_ERROR 123
#define DW_DLE_PUBNAMES_LENGTH_BAD 124
#define DW_DLE_GLOBAL_NULL 125
#define DW_DLE_GLOBAL_CONTEXT_NULL 126
#define DW_DLE_DIR_INDEX_BAD 127
#define DW_DLE_LOC_EXPR_BAD 128
#define DW_DLE_DIE_LOC_EXPR_BAD 129
#define DW_DLE_ADDR_ALLOC 130
#define DW_DLE_OFFSET_BAD 131
#define DW_DLE_MAKE_CU_CONTEXT_FAIL 132
#define DW_DLE_REL_ALLOC 133
#define DW_DLE_ARANGE_OFFSET_BAD 134
#define DW_DLE_SEGMENT_SIZE_BAD 135
#define DW_DLE_ARANGE_LENGTH_BAD 136
#define DW_DLE_ARANGE_DECODE_ERROR 137
#define DW_DLE_ARANGES_NULL 138
#define DW_DLE_ARANGE_NULL 139
#define DW_DLE_NO_FILE_NAME 140
#define DW_DLE_NO_COMP_DIR 141
#define DW_DLE_CU_ADDRESS_SIZE_BAD 142
#define DW_DLE_INPUT_ATTR_BAD 143
#define DW_DLE_EXPR_NULL 144
#define DW_DLE_BAD_EXPR_OPCODE 145
#define DW_DLE_EXPR_LENGTH_BAD 146
#define DW_DLE_MULTIPLE_RELOC_IN_EXPR 147
#define DW_DLE_ELF_GETIDENT_ERROR 148
#define DW_DLE_NO_AT_MIPS_FDE 149
#define DW_DLE_NO_CIE_FOR_FDE 150
#define DW_DLE_DIE_ABBREV_LIST_NULL 151
#define DW_DLE_DEBUG_FUNCNAMES_DUPLICATE 152
#define DW_DLE_DEBUG_FUNCNAMES_NULL 153
#define DW_DLE_DEBUG_FUNCNAMES_VERSION_ERROR 154
#define DW_DLE_DEBUG_FUNCNAMES_LENGTH_BAD 155
#define DW_DLE_FUNC_NULL 156
#define DW_DLE_FUNC_CONTEXT_NULL 157
#define DW_DLE_DEBUG_TYPENAMES_DUPLICATE 158
#define DW_DLE_DEBUG_TYPENAMES_NULL 159
#define DW_DLE_DEBUG_TYPENAMES_VERSION_ERROR 160
#define DW_DLE_DEBUG_TYPENAMES_LENGTH_BAD 161
#define DW_DLE_TYPE_NULL 162
#define DW_DLE_TYPE_CONTEXT_NULL 163
#define DW_DLE_DEBUG_VARNAMES_DUPLICATE 164
#define DW_DLE_DEBUG_VARNAMES_NULL 165
#define DW_DLE_DEBUG_VARNAMES_VERSION_ERROR 166
#define DW_DLE_DEBUG_VARNAMES_LENGTH_BAD 167
#define DW_DLE_VAR_NULL 168
#define DW_DLE_VAR_CONTEXT_NULL 169
#define DW_DLE_DEBUG_WEAKNAMES_DUPLICATE 170
#define DW_DLE_DEBUG_WEAKNAMES_NULL 171
#define DW_DLE_DEBUG_WEAKNAMES_VERSION_ERROR 172
#define DW_DLE_DEBUG_WEAKNAMES_LENGTH_BAD 173
#define DW_DLE_WEAK_NULL 174
#define DW_DLE_WEAK_CONTEXT_NULL 175
#define DW_DLE_LOCDESC_COUNT_WRONG 176
#define DW_DLE_MACINFO_STRING_NULL 177
#define DW_DLE_MACINFO_STRING_EMPTY 178
#define DW_DLE_MACINFO_INTERNAL_ERROR_SPACE 179
#define DW_DLE_MACINFO_MALLOC_FAIL 180
#define DW_DLE_DEBUGMACINFO_ERROR 181
#define DW_DLE_DEBUG_MACRO_LENGTH_BAD 182
#define DW_DLE_DEBUG_MACRO_MAX_BAD 183
#define DW_DLE_DEBUG_MACRO_INTERNAL_ERR 184
#define DW_DLE_DEBUG_MACRO_MALLOC_SPACE 185
#define DW_DLE_DEBUG_MACRO_INCONSISTENT 186
#define DW_DLE_DF_NO_CIE_AUGMENTATION 187
#define DW_DLE_DF_REG_NUM_TOO_HIGH 188
#define DW_DLE_DF_MAKE_INSTR_NO_INIT 189
#define DW_DLE_DF_NEW_LOC_LESS_OLD_LOC 190
#define DW_DLE_DF_POP_EMPTY_STACK 191
#define DW_DLE_DF_ALLOC_FAIL 192
#define DW_DLE_DF_FRAME_DECODING_ERROR 193
#define DW_DLE_DEBUG_LOC_SECTION_SHORT 194
#define DW_DLE_FRAME_AUGMENTATION_UNKNOWN 195
#define DW_DLE_DEBUG_PUBTYPES_LENGTH_BAD 197
#define DW_DLE_DEBUG_PUBTYPES_VERSION_ERROR 198
#define DW_DLE_DEBUG_PUBTYPES_DUPLICATE 199
#define DW_DLE_FRAME_CIE_DECODE_ERROR 200
#define DW_DLE_FRAME_REGISTER_UNREPRESENTABLE 201
#define DW_DLE_FRAME_REGISTER_COUNT_MISMATCH 202
#define DW_DLE_LINK_LOOP 203
#define DW_DLE_STRP_OFFSET_BAD 204
#define DW_DLE_DEBUG_RANGES_DUPLICATE 205
#define DW_DLE_DEBUG_RANGES_OFFSET_BAD 206
#define DW_DLE_DEBUG_RANGES_MISSING_END 207
#define DW_DLE_DEBUG_RANGES_OUT_OF_MEM 208
#define DW_DLE_DEBUG_SYMTAB_ERR 209
#define DW_DLE_DEBUG_STRTAB_ERR 210
#define DW_DLE_RELOC_MISMATCH_INDEX 211
#define DW_DLE_RELOC_MISMATCH_RELOC_INDEX 212
#define DW_DLE_RELOC_MISMATCH_STRTAB_INDEX 213
#define DW_DLE_RELOC_SECTION_MISMATCH 214
#define DW_DLE_RELOC_SECTION_MISSING_INDEX 215
#define DW_DLE_RELOC_SECTION_LENGTH_ODD 216
#define DW_DLE_RELOC_SECTION_PTR_NULL 217
#define DW_DLE_RELOC_SECTION_MALLOC_FAIL 218
#define DW_DLE_NO_ELF64_SUPPORT 219
#define DW_DLE_MISSING_ELF64_SUPPORT 220
#define DW_DLE_ORPHAN_FDE 221
#define DW_DLE_DUPLICATE_INST_BLOCK 222
#define DW_DLE_BAD_REF_SIG8_FORM 223
#define DW_DLE_ATTR_EXPRLOC_FORM_BAD 224
#define DW_DLE_FORM_SEC_OFFSET_LENGTH_BAD 225
#define DW_DLE_NOT_REF_FORM 226
#define DW_DLE_DEBUG_FRAME_LENGTH_NOT_MULTIPLE 227
/* DW_DLE_LAST MUST EQUAL LAST ERROR NUMBER */
#define DW_DLE_LAST 227
#define DW_DLE_LO_USER 0x10000
/* Taken as meaning 'undefined value', this is not
a column or register number.
Only present at libdwarf runtime. Never on disk.
DW_FRAME_* Values present on disk are in dwarf.h
*/
#define DW_FRAME_UNDEFINED_VAL 1034
/* Taken as meaning 'same value' as caller had, not a column
or register number
Only present at libdwarf runtime. Never on disk.
DW_FRAME_* Values present on disk are in dwarf.h
*/
#define DW_FRAME_SAME_VAL 1035
/* error return values
*/
#define DW_DLV_BADADDR (~(Dwarf_Addr)0)
/* for functions returning target address */
/* for functions returning count */
#define DW_DLV_BADOFFSET (~(Dwarf_Off)0)
/* for functions returning offset */
/* standard return values for functions */
#define DW_DLV_NO_ENTRY -1
#define DW_DLV_OK 0
#define DW_DLV_ERROR 1
/* Special values for offset_into_exception_table field of dwarf fde's. */
/* The following value indicates that there is no Exception table offset
associated with a dwarf frame. */
#define DW_DLX_NO_EH_OFFSET (-1LL)
/* The following value indicates that the producer was unable to analyse the
source file to generate Exception tables for this function. */
#define DW_DLX_EH_OFFSET_UNAVAILABLE (-2LL)
/*===========================================================================*/
/* Dwarf consumer interface initialization and termination operations */
/* Initialization based on Unix open fd (using libelf internally). */
int dwarf_init(int /*fd*/,
Dwarf_Unsigned /*access*/,
Dwarf_Handler /*errhand*/,
Dwarf_Ptr /*errarg*/,
Dwarf_Debug* /*dbg*/,
Dwarf_Error* /*error*/);
/* Initialization based on libelf/sgi-fastlibelf open pointer. */
Dwarf_Unsigned /*access*/,
Dwarf_Handler /*errhand*/,
Dwarf_Ptr /*errarg*/,
Dwarf_Debug* /*dbg*/,
Dwarf_Error* /*error*/);
/* Undocumented function for memory allocator. */
dwarf_elf_handle* /*return_elfptr*/,
Dwarf_Error* /*error*/);
Dwarf_Handler /* errhand */,
Dwarf_Ptr /* errarg */,
Dwarf_Debug* /* dbg */,
Dwarf_Error* /* error */);
Dwarf_Error* /* error */);
/* die traversal operations */
Dwarf_Unsigned* /*cu_header_length*/,
Dwarf_Half* /*version_stamp*/,
Dwarf_Off* /*abbrev_offset*/,
Dwarf_Half* /*address_size*/,
Dwarf_Half* /*length_size*/,
Dwarf_Half* /*extension_size*/,
Dwarf_Unsigned* /*next_cu_header_offset*/,
Dwarf_Error* /*error*/);
/* The following is now obsolete, though supported. November 2009. */
Dwarf_Unsigned* /*cu_header_length*/,
Dwarf_Half* /*version_stamp*/,
Dwarf_Off* /*abbrev_offset*/,
Dwarf_Half* /*address_size*/,
Dwarf_Unsigned* /*next_cu_header_offset*/,
Dwarf_Error* /*error*/);
Dwarf_Die /*die*/,
Dwarf_Die* /*return_siblingdie*/,
Dwarf_Error* /*error*/);
Dwarf_Die* /*return_childdie*/,
Dwarf_Error* /*error*/);
/* Finding die given global (not CU-relative) offset */
Dwarf_Off /*offset*/,
Dwarf_Die* /*return_die*/,
Dwarf_Error* /*error*/);
/* Higher level functions (Unimplemented) */
Dwarf_Addr /*pc*/,
Dwarf_Die* /*return_die*/,
Dwarf_Error* /*error*/);
/* Unimplemented */
Dwarf_Addr /*pc*/,
Dwarf_Die* /*return_die*/,
Dwarf_Error* /*error*/);
/* Unimplemented */
Dwarf_Addr /*pc*/,
Dwarf_Die* /*return_die*/,
Dwarf_Error* /*error*/);
/* operations on DIEs */
Dwarf_Half* /*return_tag*/,
Dwarf_Error* /*error*/);
/* utility? */
/* dwarf_dieoffset returns the global debug_info
section offset, not the CU relative offset. */
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
/* dwarf_CU_dieoffset_given_die returns
the global debug_info section offset of the CU die
that is the CU containing the given_die
(the passed in DIE can be any DIE).
This information makes it possible for a consumer to
find and print CU context information for any die.
See also dwarf_get_cu_die_offset_given_cu_header_offset(). */
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
/* dwarf_die_CU_offset returns the CU relative offset
not the global debug_info section offset, given
any DIE in the CU. See also dwarf_CU_dieoffset_given_die().
*/
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
Dwarf_Off* /*return_CU_header_offset*/,
Dwarf_Off* /*return_CU_length_bytes*/,
Dwarf_Error* /*error*/);
Dwarf_Half /*attr*/,
Dwarf_Attribute * /*returned_attr*/,
Dwarf_Error* /*error*/);
char ** /*diename*/,
Dwarf_Error* /*error*/);
/* Returns the abbrev code of the die. Cannot fail. */
/* convenience functions, alternative to using dwarf_attrlist() */
Dwarf_Half /*attr*/,
Dwarf_Bool * /*returned_bool*/,
Dwarf_Error* /*error*/);
/* dwarf_loclist_n preferred over dwarf_loclist */
Dwarf_Locdesc*** /*llbuf*/,
Dwarf_Signed * /*locCount*/,
Dwarf_Error* /*error*/);
Dwarf_Locdesc** /*llbuf*/,
Dwarf_Signed * /*locCount*/,
Dwarf_Error* /*error*/);
/* Extracts a dwarf expression from an expression byte stream.
Useful to get expressions from DW_CFA_def_cfa_expression
DW_CFA_expression DW_CFA_val_expression expression bytes.
27 April 2009: dwarf_loclist_from_expr() interface with
no addr_size is obsolete but supported,
use dwarf_loclist_from_expr_a() instead.
*/
Dwarf_Locdesc ** llbuf,
/* dwarf_loclist_from_expr_a() new 27 Apr 2009: added addr_size argument. */
Dwarf_Locdesc ** llbuf,
/* Unimplemented */
Dwarf_Locdesc ** /*returned_locdesc*/,
Dwarf_Error* /*error*/);
/* Unimplemented */
Dwarf_Signed * /*returned_count*/,
Dwarf_Error* /*error*/);
/* Unimplemented */
Dwarf_Unsigned /*ssndx*/,
Dwarf_Die * /*returned_die*/,
Dwarf_Error* /*error*/);
Dwarf_Addr * /*returned_addr*/,
Dwarf_Error* /*error*/);
Dwarf_Addr * /*returned_addr*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned * /*returned_size*/,
Dwarf_Error* /*error*/);
/* Unimplemented */
Dwarf_Bool * /*returned_bool*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned * /*returned_size*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned * /*returned_offset*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned * /*returned_lang*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned * /*returned_order*/,
Dwarf_Error* /*error*/);
/* end of convenience function list */
/* this is the main interface to attributes of a DIE */
Dwarf_Attribute** /*attrbuf*/,
Dwarf_Signed * /*attrcount*/,
Dwarf_Error* /*error*/);
/* query operations for attributes */
Dwarf_Half /*form*/,
Dwarf_Bool * /*returned_bool*/,
Dwarf_Error* /*error*/);
Dwarf_Half * /*returned_form*/,
Dwarf_Error* /*error*/);
Dwarf_Half * /*returned_form*/,
Dwarf_Error* /*error*/);
Dwarf_Half * /*returned_attr_num*/,
Dwarf_Error* /*error*/);
/*
The following are concerned with the Primary Interface: getting
the actual data values. One function per 'kind' of FORM.
*/
/* dwarf_formref returns, thru return_offset, a CU-relative offset
and does not allow DW_FORM_ref_addr*/
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
/* dwarf_global_formref returns, thru return_offset,
a debug_info-relative offset and does allow all reference forms*/
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
/* dwarf_formsig8 returns in the caller-provided 8 byte area
the 8 bytes of a DW_FORM_ref_sig8. Not a string. */
Dwarf_Sig8 * /*returned sig bytes*/,
Dwarf_Error* /*error*/);
Dwarf_Addr * /*returned_addr*/,
Dwarf_Error* /*error*/);
Dwarf_Bool * /*returned_bool*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned * /*returned_val*/,
Dwarf_Error* /*error*/);
Dwarf_Signed * /*returned_val*/,
Dwarf_Error* /*error*/);
Dwarf_Block ** /*returned_block*/,
Dwarf_Error* /*error*/);
char ** /*returned_string*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned * /*return_exprlen*/,
Dwarf_Ptr * /*block_ptr*/,
Dwarf_Error * /*error*/);
/* end attribute query operations. */
/* line number operations */
/* dwarf_srclines is the normal interface */
Dwarf_Line** /*linebuf*/,
Dwarf_Signed * /*linecount*/,
Dwarf_Error* /*error*/);
/* dwarf_srclines_dealloc, created July 2005, is the new
method for deallocating what dwarf_srclines returns.
More complete free than using dwarf_dealloc directly. */
Dwarf_Line* /*linebuf*/,
Dwarf_Signed /*count */);
char*** /*srcfiles*/,
Dwarf_Signed * /*filecount*/,
Dwarf_Error* /*error*/);
/* Unimplemented. */
Dwarf_Line * /*returned_line*/,
Dwarf_Error * /*error*/);
Dwarf_Bool * /*returned_bool*/,
Dwarf_Error* /*error*/);
Dwarf_Bool * /*returned_bool*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned * /*returned_lineno*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned * /*ret_fileno*/,
Dwarf_Error * /*error*/);
Dwarf_Addr * /*returned_addr*/,
Dwarf_Error* /*error*/);
Dwarf_Signed * /*returned_lineoffset*/,
Dwarf_Error* /*error*/);
char ** /*returned_name*/,
Dwarf_Error* /*error*/);
Dwarf_Bool * /*returned_bool*/,
Dwarf_Error* /*error*/);
/* tertiary interface to line info */
/* Unimplemented */
Dwarf_Addr /*pc*/,
Dwarf_Line** /*linebuf*/,
Dwarf_Signed * /*linecount*/,
Dwarf_Signed /*slide*/,
Dwarf_Error* /*error*/);
/* end line number operations */
/* global name space operations (.debug_pubnames access) */
Dwarf_Global** /*globals*/,
Dwarf_Signed * /*number_of_globals*/,
Dwarf_Error* /*error*/);
Dwarf_Global* /*globals*/,
Dwarf_Signed /*number_of_globals*/);
char ** /*returned_name*/,
Dwarf_Error* /*error*/);
Dwarf_Off* /*return_offset*/,
Dwarf_Error * /*error*/);
/* This returns the CU die global offset if one knows the
CU header global offset.
See also dwarf_CU_dieoffset_given_die(). */
Dwarf_Debug /*dbg*/,
Dwarf_Off /*in_cu_header_offset*/,
Dwarf_Off * /*out_cu_die_offset*/,
Dwarf_Error * /*err*/);
#ifdef __sgi /* pragma is sgi MIPS only */
#endif
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
char ** /*returned_name*/,
Dwarf_Off* /*die_offset*/,
Dwarf_Off* /*cu_offset*/,
Dwarf_Error* /*error*/);
/* Static function name operations. */
Dwarf_Func** /*funcs*/,
Dwarf_Signed * /*number_of_funcs*/,
Dwarf_Error* /*error*/);
Dwarf_Func* /*funcs*/,
Dwarf_Signed /*number_of_funcs*/);
char ** /*returned_name*/,
Dwarf_Error* /*error*/);
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
char ** /*returned_name*/,
Dwarf_Off* /*die_offset*/,
Dwarf_Off* /*cu_offset*/,
Dwarf_Error* /*error*/);
/* User-defined type name operations, SGI IRIX .debug_typenames section.
Same content as DWARF3 .debug_pubtypes, but defined years before
.debug_pubtypes was defined. SGI IRIX only. */
Dwarf_Type** /*types*/,
Dwarf_Signed * /*number_of_types*/,
Dwarf_Error* /*error*/);
Dwarf_Type* /*types*/,
Dwarf_Signed /*number_of_types*/);
char ** /*returned_name*/,
Dwarf_Error* /*error*/);
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
char ** /*returned_name*/,
Dwarf_Off* /*die_offset*/,
Dwarf_Off* /*cu_offset*/,
Dwarf_Error* /*error*/);
/* User-defined type name operations, DWARF3 .debug_pubtypes section.
*/
Dwarf_Type** /*types*/,
Dwarf_Signed * /*number_of_types*/,
Dwarf_Error* /*error*/);
Dwarf_Type* /*pubtypes*/,
Dwarf_Signed /*number_of_pubtypes*/);
char ** /*returned_name*/,
Dwarf_Error* /*error*/);
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
char ** /*returned_name*/,
Dwarf_Off* /*die_offset*/,
Dwarf_Off* /*cu_offset*/,
Dwarf_Error* /*error*/);
/* File-scope static variable name operations. */
Dwarf_Var** /*vars*/,
Dwarf_Signed * /*number_of_vars*/,
Dwarf_Error* /*error*/);
Dwarf_Var* /*vars*/,
Dwarf_Signed /*number_of_vars*/);
char ** /*returned_name*/,
Dwarf_Error* /*error*/);
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
char ** /*returned_name*/,
Dwarf_Off* /*die_offset*/,
Dwarf_Off* /*cu_offset*/,
Dwarf_Error* /*error*/);
/* weak name operations. */
Dwarf_Weak** /*weaks*/,
Dwarf_Signed * /*number_of_weaks*/,
Dwarf_Error* /*error*/);
Dwarf_Weak* /*weaks*/,
Dwarf_Signed /*number_of_weaks*/);
char ** /*returned_name*/,
Dwarf_Error* /*error*/);
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
char ** /*returned_name*/,
Dwarf_Off* /*die_offset*/,
Dwarf_Off* /*cu_offset*/,
Dwarf_Error* /*error*/);
/* location list section operation. (.debug_loc access) */
Dwarf_Unsigned /*offset*/,
Dwarf_Addr* /*hipc*/,
Dwarf_Addr* /*lopc*/,
Dwarf_Ptr* /*data*/,
Dwarf_Unsigned* /*entry_len*/,
Dwarf_Unsigned* /*next_entry*/,
Dwarf_Error* /*error*/);
/* abbreviation section operations */
Dwarf_Unsigned /*offset*/,
Dwarf_Abbrev * /*returned_abbrev*/,
Dwarf_Unsigned* /*length*/,
Dwarf_Unsigned* /*attr_count*/,
Dwarf_Error* /*error*/);
Dwarf_Half* /*return_tag_number*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned* /*return_code_number*/,
Dwarf_Error* /*error*/);
Dwarf_Signed* /*return_flag*/,
Dwarf_Error* /*error*/);
Dwarf_Signed /*index*/,
Dwarf_Half * /*returned_attr_num*/,
Dwarf_Signed* /*form*/,
Dwarf_Off* /*offset*/,
Dwarf_Error* /*error*/);
/* consumer string section operation */
Dwarf_Off /*offset*/,
char** /*string*/,
Dwarf_Signed * /*strlen_of_string*/,
Dwarf_Error* /*error*/);
/* Consumer op on gnu .eh_frame info */
Dwarf_Debug /*dbg*/,
Dwarf_Cie** /*cie_data*/,
Dwarf_Signed* /*cie_element_count*/,
Dwarf_Fde** /*fde_data*/,
Dwarf_Signed* /*fde_element_count*/,
Dwarf_Error* /*error*/);
/* consumer operations on frame info: .debug_frame */
Dwarf_Cie** /*cie_data*/,
Dwarf_Signed* /*cie_element_count*/,
Dwarf_Fde** /*fde_data*/,
Dwarf_Signed* /*fde_element_count*/,
Dwarf_Error* /*error*/);
/* Release storage gotten by dwarf_get_fde_list_eh() or
dwarf_get_fde_list() */
Dwarf_Addr* /*low_pc*/,
Dwarf_Unsigned* /*func_length*/,
Dwarf_Ptr* /*fde_bytes*/,
Dwarf_Unsigned* /*fde_byte_length*/,
Dwarf_Off* /*cie_offset*/,
Dwarf_Signed* /*cie_index*/,
Dwarf_Off* /*fde_offset*/,
Dwarf_Error* /*error*/);
/* Useful for IRIX only: see dwarf_get_cie_augmentation_data()
dwarf_get_fde_augmentation_data() for GNU .eh_frame. */
Dwarf_Signed* /* offset_into_exception_tables */,
Dwarf_Error* /*error*/);
Dwarf_Cie * /*cie_returned*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned * /*bytes_in_cie*/,
Dwarf_Small* /*version*/,
char ** /*augmenter*/,
Dwarf_Unsigned* /*code_alignment_factor*/,
Dwarf_Signed* /*data_alignment_factor*/,
Dwarf_Half* /*return_address_register_rule*/,
Dwarf_Ptr* /*initial_instructions*/,
Dwarf_Unsigned* /*initial_instructions_length*/,
Dwarf_Error* /*error*/);
/* dwarf_get_cie_index new September 2009. */
int dwarf_get_cie_index(
Dwarf_Cie /*cie*/,
Dwarf_Signed* /*index*/,
Dwarf_Error* /*error*/ );
Dwarf_Error * /*error*/);
Dwarf_Addr /*pc_requested*/,
Dwarf_Regtable* /*reg_table*/,
Dwarf_Addr* /*row_pc*/,
Dwarf_Error* /*error*/);
Dwarf_Addr /*pc_requested*/,
Dwarf_Regtable3* /*reg_table*/,
Dwarf_Addr* /*row_pc*/,
Dwarf_Error* /*error*/);
/* In this older interface DW_FRAME_CFA_COL is a meaningful
column (which does not work well with DWARF3 or
non-MIPS architectures). */
Dwarf_Half /*table_column*/,
Dwarf_Addr /*pc_requested*/,
Dwarf_Signed* /*offset_relevant*/,
Dwarf_Signed* /*register*/,
Dwarf_Signed* /*offset*/,
Dwarf_Addr* /*row_pc*/,
Dwarf_Error* /*error*/);
/* See discussion of dw_value_type, libdwarf.h.
Use of DW_FRAME_CFA_COL is not meaningful in this interface.
See dwarf_get_fde_info_for_cfa_reg3().
*/
/* dwarf_get_fde_info_for_reg3 is useful on a single column, but
it is inefficient to iterate across all table_columns using this
function. Instead call dwarf_get_fde_info_for_all_regs3() and index
into the table it fills in. */
Dwarf_Half /*table_column*/,
Dwarf_Addr /*pc_requested*/,
Dwarf_Small * /*value_type*/,
Dwarf_Signed * /*offset_relevant*/,
Dwarf_Signed* /*register*/,
Dwarf_Signed* /*offset_or_block_len*/,
Dwarf_Ptr * /*block_ptr */,
Dwarf_Addr* /*row_pc_out*/,
Dwarf_Error* /*error*/);
/* Use this to get the cfa. */
Dwarf_Addr /*pc_requested*/,
Dwarf_Small * /*value_type*/,
Dwarf_Signed * /*offset_relevant*/,
Dwarf_Signed* /*register*/,
Dwarf_Signed* /*offset_or_block_len*/,
Dwarf_Ptr * /*block_ptr */,
Dwarf_Addr* /*row_pc_out*/,
Dwarf_Error* /*error*/);
Dwarf_Die /*subr_die */,
Dwarf_Fde * /*returned_fde*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned /*fde_index*/,
Dwarf_Fde * /*returned_fde*/,
Dwarf_Error* /*error*/);
Dwarf_Addr /*pc_of_interest*/,
Dwarf_Fde * /*returned_fde*/,
Dwarf_Addr* /*lopc*/,
Dwarf_Addr* /*hipc*/,
Dwarf_Error* /*error*/);
/* GNU .eh_frame augmentation information, raw form, see
Linux Standard Base Core Specification version 3.0 . */
Dwarf_Small ** /* augdata */,
Dwarf_Unsigned * /* augdata_len */,
Dwarf_Error* /*error*/);
/* GNU .eh_frame augmentation information, raw form, see
Linux Standard Base Core Specification version 3.0 . */
Dwarf_Small ** /* augdata */,
Dwarf_Unsigned * /* augdata_len */,
Dwarf_Error* /*error*/);
Dwarf_Ptr /*instruction*/,
Dwarf_Unsigned /*i_length*/,
Dwarf_Frame_Op** /*returned_op_list*/,
Dwarf_Signed* /*op_count*/,
Dwarf_Error* /*error*/);
/* Operations on .debug_aranges. */
Dwarf_Arange** /*aranges*/,
Dwarf_Signed * /*arange_count*/,
Dwarf_Error* /*error*/);
int dwarf_get_arange(
Dwarf_Arange* /*aranges*/,
Dwarf_Unsigned /*arange_count*/,
Dwarf_Addr /*address*/,
Dwarf_Arange * /*returned_arange*/,
Dwarf_Error* /*error*/);
Dwarf_Arange /*arange*/,
Dwarf_Off* /*return_offset*/,
Dwarf_Error* /*error*/);
Dwarf_Arange /*arange*/,
Dwarf_Off* /*return_cu_header_offset*/,
Dwarf_Error* /*error*/);
#ifdef __sgi /* pragma is sgi MIPS only */
#endif
/* DWARF2,3 interface. No longer really adequate (it was never
right for segmented address spaces, please switch
to using dwarf_get_arange_info_b instead.
There is no effective difference between these
functions if the address space
of the target is not segmented. */
Dwarf_Arange /*arange*/,
Dwarf_Addr* /*start*/,
Dwarf_Unsigned* /*length*/,
Dwarf_Off* /*cu_die_offset*/,
Dwarf_Error* /*error*/ );
/* New for DWARF4, entries may have segment information.
*segment is only meaningful if *segment_entry_size is non-zero. */
Dwarf_Arange /*arange*/,
Dwarf_Unsigned* /*segment*/,
Dwarf_Unsigned* /*segment_entry_size*/,
Dwarf_Addr * /*start*/,
Dwarf_Unsigned* /*length*/,
Dwarf_Off * /*cu_die_offset*/,
Dwarf_Error * /*error*/ );
/* consumer .debug_macinfo information interface.
*/
struct Dwarf_Macro_Details_s {
of this macro info */
applicable and vend_def # if
vendor_extension op
*/
applies to define undef start_file
*/
char * dmd_macro; /* macro name (with value for defineop)
string from vendor ext
*/
};
/* dwarf_print_lines is for use by dwarfdump: it prints
line info to stdout.
The _dwarf name is obsolete. Use dwarf_ instead.
Added extra argnument 2/2009 for better checking.
*/
int * /*error_count_out */);
/* dwarf_check_lineheader lets dwarfdump get detailed messages
about some compiler errors we detect.
We return the count of detected errors throught the
pointer.
*/
/* dwarf_ld_sort_lines helps SGI IRIX ld
rearrange lines in .debug_line in a .o created with a text
section per function.
-OPT:procedure_reorder=ON
where ld-cord (cord(1)ing by ld,
not by cord(1)) may have changed the function order.
The _dwarf name is obsolete. Use dwarf_ instead.
*/
int _dwarf_ld_sort_lines(
void * /*orig_buffer*/,
unsigned long /* buffer_len*/,
int /*is_64_bit*/,
int * /*any_change*/,
int * /*err_code*/);
int dwarf_ld_sort_lines(
void * /*orig_buffer*/,
unsigned long /*buffer_len*/,
int /*is_64_bit*/,
int * /*any_change*/,
int * /*err_code*/);
/* Used by dwarfdump -v to print fde offsets from debugging
info.
The _dwarf name is obsolete. Use dwarf_ instead.
*/
Dwarf_Fde /*in_fde*/,
Dwarf_Off * /*fde_off*/,
Dwarf_Off * /*cie_off*/,
Dwarf_Error * /*err*/);
Dwarf_Fde /*in_fde*/,
Dwarf_Off * /*fde_off*/,
Dwarf_Off * /*cie_off*/,
Dwarf_Error * /*err*/);
/* Used by dwarfdump -v to print cie offsets from debugging
info.
The _dwarf name is obsolete. Use dwarf_ instead.
*/
Dwarf_Cie /*in_cie*/,
Dwarf_Off * /*cie_off */,
Dwarf_Error * /*err*/);
Dwarf_Cie /*in_cie*/,
Dwarf_Off * /*cie_off*/,
Dwarf_Error * /*err*/);
typedef struct Dwarf_Macro_Details_s Dwarf_Macro_Details;
char * /*requested_macro_name*/,
Dwarf_Addr /*pc_of_request*/,
char ** /*returned_macro_value*/,
Dwarf_Error * /*error*/);
Dwarf_Addr /*pc_of_request*/,
Dwarf_Signed * /*returned_count*/,
char *** /*returned_pointers_to_macros*/,
Dwarf_Error * /*error*/);
char *dwarf_find_macro_value_start(char * /*macro_string*/);
Dwarf_Off /*macro_offset*/,
Dwarf_Unsigned /*maximum_count*/,
Dwarf_Signed * /*entry_count*/,
Dwarf_Macro_Details ** /*details*/,
Dwarf_Error * /*err*/);
Dwarf_Half * /*addr_size*/,
Dwarf_Error * /*error*/);
Dwarf_Half * /*addr_size*/,
Dwarf_Error * /*error*/);
/* The dwarf specification separates FORMs into
different classes. To do the seperation properly
requires 4 pieces of data as of DWARF4 (thus the
function arguments listed here).
The DWARF4 specification class definition suffices to
describe all DWARF versions.
See section 7.5.4, Attribute Encodings.
A return of DW_FORM_CLASS_UNKNOWN means we could not properly figure
out what form-class it is.
to the DW_AT_MIPS_fde attribute (a reference to the
.debug_frame section).
*/
enum Dwarf_Form_Class {
};
Dwarf_Half /* dwversion */,
Dwarf_Half /* attrnum */,
Dwarf_Half /*offset_size */,
Dwarf_Half /*form*/);
/* utility operations */
/* stringcheck zero is default and means do all
** string length validity checks.
** Call with parameter value 1 to turn off many such checks (and
** increase performance).
** Call with zero for safest running.
** Actual value saved and returned is only 8 bits! Upper bits
** ignored by libdwarf (and zero on return).
** Returns previous value.
*/
int dwarf_set_stringcheck(int /*stringcheck*/);
/* 'apply' defaults to 1 and means do all
* 'rela' relocations on reading in a dwarf object section with
* such relocations.
* Call with parameter value 0 to turn off application of
* such relocations.
* Since the static linker leaves 'bogus' data in object sections
* with a 'rela' relocation section such data cannot be read
* sensibly without processing the relocations. Such relocations
* do not exist in executables and shared objects (.so), the
* relocations only exist in plain .o relocatable object files.
* Actual value saved and returned is only 8 bits! Upper bits
* ignored by libdwarf (and zero on return).
* Returns previous value.
* */
int dwarf_set_reloc_application(int /*apply*/);
/* Unimplemented */
/* Unimplemented */
Dwarf_Unsigned /*type*/);
/* DWARF Producer Interface */
typedef int (*Dwarf_Callback_Func)(
char* /*name*/,
int /*size*/,
Dwarf_Unsigned /*type*/,
Dwarf_Unsigned /*flags*/,
Dwarf_Unsigned /*link*/,
Dwarf_Unsigned /*info*/,
int* /*sect name index*/,
int* /*error*/);
Dwarf_Unsigned /*creation_flags*/,
Dwarf_Callback_Func /*func*/,
Dwarf_Handler /*errhand*/,
Dwarf_Ptr /*errarg*/,
Dwarf_Error* /*error*/);
typedef int (*Dwarf_Callback_Func_b)(
char* /*name*/,
int /*size*/,
Dwarf_Unsigned /*type*/,
Dwarf_Unsigned /*flags*/,
Dwarf_Unsigned /*link*/,
Dwarf_Unsigned /*info*/,
Dwarf_Unsigned* /*sect_name_index*/,
int* /*error*/);
Dwarf_Unsigned /*flags*/,
Dwarf_Callback_Func_b /*func*/,
Dwarf_Handler /*errhand*/,
Dwarf_Ptr /*errarg*/,
Dwarf_Error * /*error*/);
Dwarf_Error* /*error*/);
Dwarf_Signed /*dwarf_section*/,
Dwarf_Signed* /*elf_section_index*/,
Dwarf_Unsigned* /*length*/,
Dwarf_Error* /*error*/);
Dwarf_P_Debug /*dbg*/,
Dwarf_Unsigned * /*count_of_relocation_sections*/,
int * /*drd_buffer_version*/,
Dwarf_Error* /*error*/);
Dwarf_P_Debug /*dbg*/,
Dwarf_Signed * /*elf_section_index*/,
Dwarf_Signed * /*elf_section_index_link*/,
Dwarf_Unsigned * /*relocation_buffer_count*/,
Dwarf_Relocation_Data * /*reldata_buffer*/,
Dwarf_Error* /*error*/);
/* v1: no drd_length field, enum explicit */
/* v2: has the drd_length field, enum value in uchar member */
#define DWARF_DRD_BUFFER_VERSION 2
/* Markers are not written to DWARF2/3/4, they are user
defined and may be used for any purpose.
*/
Dwarf_P_Debug /*dbg*/,
Dwarf_P_Marker * /*marker_list*/,
Dwarf_Unsigned * /*marker_count*/,
Dwarf_Error * /*error*/);
int *,
Dwarf_Error *);
Dwarf_Signed *,
Dwarf_Error *);
Dwarf_Error* /*error*/);
/* Producer attribute addition functions. */
Dwarf_P_Die /*ownerdie*/,
Dwarf_Half /*attr*/,
Dwarf_Unsigned /*pc_value*/,
Dwarf_Signed /*sym_index*/,
Dwarf_Error* /*error*/);
Dwarf_P_Die /*ownerdie*/,
Dwarf_Half /*attr*/,
Dwarf_Small* /*block_data*/,
Dwarf_Unsigned /*block_len*/,
Dwarf_Error* /*error*/);
Dwarf_P_Die /*ownerdie*/,
Dwarf_Half /*attr*/,
Dwarf_Unsigned /*pc_value*/,
Dwarf_Unsigned /*sym_index*/,
Dwarf_Error* /*error*/);
Dwarf_P_Die /*ownerdie*/,
Dwarf_Half /*attr*/,
Dwarf_Unsigned /*pc_value*/,
Dwarf_Unsigned /*sym_index*/,
Dwarf_Error* /*error*/);
Dwarf_P_Die /*ownerdie*/,
Dwarf_Half /*attr*/,
Dwarf_Unsigned /*value*/,
Dwarf_Error* /*error*/);
Dwarf_P_Die /*ownerdie*/,
Dwarf_Half /*attr*/,
Dwarf_Signed /*value*/,
Dwarf_Error* /*error*/);
Dwarf_P_Die /*ownerdie*/,
Dwarf_Half /*attr*/,
Dwarf_P_Die /*otherdie*/,
Dwarf_Error* /*error*/);
Dwarf_P_Debug /* dbg*/,
Dwarf_P_Die /*ownerdie*/,
Dwarf_Half /*attr*/,
Dwarf_Unsigned /*pcvalue*/,
Dwarf_Unsigned /*sym_index*/,
Dwarf_Error* /*error*/);
char* /*string_value*/,
Dwarf_Error* /*error*/);
Dwarf_P_Die /*ownerdie*/,
Dwarf_Half /*attr*/,
Dwarf_P_Expr /*loc_expr*/,
Dwarf_Error* /*error*/);
Dwarf_P_Die /*ownerdie*/,
Dwarf_Half /*attr*/,
char* /*string*/,
Dwarf_Error* /*error*/);
Dwarf_P_Die /*ownerdie*/,
Dwarf_Half /*attr*/,
Dwarf_Small /*flag*/,
Dwarf_Error* /*error*/);
char* /*producer_string*/,
Dwarf_Error* /*error*/);
Dwarf_Signed /*signed_value*/,
Dwarf_Error* /*error*/);
Dwarf_P_Die /*ownerdie*/,
Dwarf_Unsigned /*unsigned_value*/,
Dwarf_Error* /*error*/);
char* /*current_working_directory*/,
Dwarf_Error* /*error*/);
char* /*name*/,
Dwarf_Error* /*error*/);
/* Producer line creation functions (.debug_line) */
char* /*name*/,
Dwarf_Error* /*error*/);
char* /*name*/,
Dwarf_Unsigned /*dir_index*/,
Dwarf_Unsigned /*time_last_modified*/,
Dwarf_Unsigned /*length*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned /*file_index*/,
Dwarf_Addr /*code_address*/,
Dwarf_Unsigned /*lineno*/,
Dwarf_Signed /*column_number*/,
Dwarf_Bool /*is_source_stmt_begin*/,
Dwarf_Bool /*is_basic_block_begin*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned /*offset*/,
Dwarf_Unsigned /*symbol_index*/,
Dwarf_Error* /*error*/);
Dwarf_Addr /*end_address*/,
Dwarf_Error* /*error*/);
/* Producer .debug_frame functions */
char* /*augmenter*/,
Dwarf_Small /*code_alignent_factor*/,
Dwarf_Small /*data_alignment_factor*/,
Dwarf_Small /*return_address_reg*/,
Dwarf_Ptr /*initialization_bytes*/,
Dwarf_Unsigned /*init_byte_len*/,
Dwarf_Error* /*error*/);
Dwarf_P_Debug /*dbg*/,
Dwarf_P_Fde /*fde*/,
Dwarf_P_Die /*corresponding subprogram die*/,
Dwarf_Unsigned /*cie_to_use*/,
Dwarf_Unsigned /*virt_addr_of_described_code*/,
Dwarf_Unsigned /*length_of_code*/,
Dwarf_Unsigned /*symbol_index*/,
Dwarf_Error* /*error*/);
Dwarf_P_Debug /*dbg*/,
Dwarf_P_Fde /*fde*/,
Dwarf_P_Die /*die*/,
Dwarf_Unsigned /*cie*/,
Dwarf_Addr /*virt_addr*/,
Dwarf_Unsigned /*code_len*/,
Dwarf_Unsigned /*sym_idx*/,
Dwarf_Unsigned /*sym_idx_of_end*/,
Dwarf_Addr /*offset_from_end_sym*/,
Dwarf_Error* /*error*/);
Dwarf_P_Fde /*fde*/,
Dwarf_P_Die /*die*/,
Dwarf_Unsigned /*cie*/,
Dwarf_Addr /*virt_addr*/,
Dwarf_Unsigned /*code_len*/,
Dwarf_Unsigned /*symidx*/,
Dwarf_Unsigned /*end_symbol */,
Dwarf_Addr /*offset_from_end_symbol */,
Dwarf_Signed /*offset_into_exception_tables*/,
Dwarf_Unsigned /*exception_table_symbol*/,
Dwarf_Error* /*error*/);
Dwarf_P_Fde /*fde*/,
Dwarf_P_Die /*die*/,
Dwarf_Unsigned /*cie*/,
Dwarf_Addr /*virt_addr*/,
Dwarf_Unsigned /*code_len*/,
Dwarf_Unsigned /*symidx*/,
Dwarf_Signed /*offset_into_exception_tables*/,
Dwarf_Unsigned /*exception_table_symbol*/,
Dwarf_Error* /*error*/);
Dwarf_P_Fde /*fde*/,
Dwarf_Small /*op*/,
Dwarf_Unsigned /*val1*/,
Dwarf_Unsigned /*val2*/,
Dwarf_Error* /*error*/);
/* New September 17, 2009 */
Dwarf_P_Debug /*dbg*/,
Dwarf_P_Fde /*fde*/,
Dwarf_Unsigned /*len*/,
Dwarf_Ptr /*ibytes*/,
Dwarf_Error* /*error*/);
Dwarf_P_Fde /*fde*/,
Dwarf_Unsigned /*register_number*/,
Dwarf_Signed /*offset*/,
Dwarf_Error* /*error*/);
/* die creation & addition routines */
Dwarf_P_Debug /*dbg*/,
Dwarf_Tag /*tag*/,
Dwarf_P_Die /*parent*/,
Dwarf_P_Die /*child*/,
Dwarf_P_Die /*left */,
Dwarf_P_Die /*right*/,
Dwarf_Error* /*error*/);
Dwarf_P_Debug /*dbg*/,
Dwarf_P_Die /*die*/,
Dwarf_Error* /*error*/);
/* Markers are not written to DWARF2/3/4, they are user
defined and may be used for any purpose.
*/
Dwarf_P_Debug /*dbg*/,
Dwarf_P_Die /*die*/,
Dwarf_Unsigned /*marker*/,
Dwarf_Error * /*error*/);
Dwarf_P_Debug /*dbg*/,
Dwarf_P_Die /*die*/,
Dwarf_Unsigned * /*marker*/,
Dwarf_Error * /*error*/);
Dwarf_P_Die /*die*/,
Dwarf_P_Die /*parent*/,
Dwarf_P_Die /*child*/,
Dwarf_P_Die /*left*/,
Dwarf_P_Die /*right*/,
Dwarf_Error* /*error*/);
void *
);
/* Call this passing in return value from dwarf_uncompress_integer_block()
* to free the space the decompression allocated. */
void *
);
void * dwarf_compress_integer_block(
Dwarf_P_Debug, /* dbg */
Dwarf_Bool, /* signed==true (or unsigned) */
Dwarf_Small, /* size of integer units: 8, 16, 32, 64 */
void*, /* data */
Dwarf_Unsigned, /* number of elements */
Dwarf_Unsigned*, /* number of bytes in output block */
Dwarf_Error* /* error */
);
/* Decode an array of signed leb integers (so of course the
* array is not composed of fixed length values, but is instead
* a sequence of sleb values).
* Returns a DW_DLV_BADADDR on error.
* Otherwise returns a pointer to an array of 32bit integers.
* The signed argument must be non-zero (the decode
* assumes sleb integers in the input data) at this time.
* Size of integer units must be 32 (32 bits each) at this time.
* Number of bytes in block is a byte count (not array count).
* Returns number of units in output block (ie, number of elements
* of the array that the return value points to) thru the argument.
*/
void * dwarf_uncompress_integer_block(
Dwarf_Debug, /* dbg */
Dwarf_Bool, /* signed==true (or unsigned) */
Dwarf_Small, /* size of integer units: 8, 16, 32, 64 */
void*, /* input data */
Dwarf_Unsigned, /* number of bytes in input */
Dwarf_Unsigned*, /* number of units in output block */
Dwarf_Error* /* error */
);
/* Operations to create location expressions. */
void dwarf_expr_reset(
Dwarf_P_Expr /*expr*/,
Dwarf_Error* /*error*/);
Dwarf_P_Expr /*expr*/,
Dwarf_Small /*opcode*/,
Dwarf_Unsigned /*val1*/,
Dwarf_Unsigned /*val2*/,
Dwarf_Error* /*error*/);
Dwarf_P_Expr /*expr*/,
Dwarf_Unsigned /*addr*/,
Dwarf_Signed /*sym_index*/,
Dwarf_Error* /*error*/);
Dwarf_P_Expr /*expr*/,
Dwarf_Unsigned /*addr*/,
Dwarf_Unsigned /*sym_index*/,
Dwarf_Error* /*error*/);
Dwarf_P_Expr /*expr*/,
Dwarf_Error* /*error*/);
Dwarf_P_Expr /*expr*/,
Dwarf_Unsigned* /*length*/,
Dwarf_Error* /*error*/);
Dwarf_Addr /*begin_address*/,
Dwarf_Unsigned /*length*/,
Dwarf_Signed /*symbol_index*/,
Dwarf_Error* /*error*/);
Dwarf_P_Debug /*dbg*/,
Dwarf_Addr /*begin_address*/,
Dwarf_Unsigned /*length*/,
Dwarf_Unsigned /*symbol_index*/,
Dwarf_Unsigned /*end_symbol_index*/,
Dwarf_Addr /*offset_from_end_symbol*/,
Dwarf_Error * /*error*/);
Dwarf_P_Debug /*dbg*/,
Dwarf_P_Die /*die*/,
char* /*pubname_name*/,
Dwarf_Error* /*error*/);
Dwarf_P_Debug /*dbg*/,
Dwarf_P_Die /*die*/,
char* /*func_name*/,
Dwarf_Error* /*error*/);
Dwarf_P_Debug /*dbg*/,
Dwarf_P_Die /*die*/,
char* /*type_name*/,
Dwarf_Error* /*error*/);
Dwarf_P_Debug /*dbg*/,
Dwarf_P_Die /*die*/,
char* /*var_name*/,
Dwarf_Error* /*error*/);
Dwarf_P_Debug /*dbg*/,
Dwarf_P_Die /*die*/,
char* /*weak_name*/,
Dwarf_Error* /*error*/);
/* .debug_macinfo producer functions
Functions must be called in right order: the section is output
In the order these are presented.
*/
Dwarf_Unsigned /*line*/,
char * /*macname, with (arglist), no space before (*/,
char * /*macvalue*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned /*line*/,
char * /*macname, no arglist, of course*/,
Dwarf_Error* /*error*/);
Dwarf_Unsigned /*fileindex*/,
Dwarf_Unsigned /*linenumber*/,
Dwarf_Error* /*error*/);
Dwarf_Error* /*error*/);
Dwarf_Unsigned /*constant*/,
char * /*string*/,
Dwarf_Error* /*error*/);
/* end macinfo producer functions */
Dwarf_Attribute /*attr of above die*/,
Dwarf_Off * /*returns offset thru this ptr */,
Dwarf_Error * /*error*/);
/* This is a hack so clients can verify offsets.
Added April 2005 so that debugger can detect broken offsets
(which happened in an IRIX executable larger than 2GB
with MIPSpro 7.3.1.3 toolchain.).
*/
int
Dwarf_Unsigned * /*debug_info_size*/,
Dwarf_Unsigned * /*debug_abbrev_size*/,
Dwarf_Unsigned * /*debug_line_size*/,
Dwarf_Unsigned * /*debug_loc_size*/,
Dwarf_Unsigned * /*debug_aranges_size*/,
Dwarf_Unsigned * /*debug_macinfo_size*/,
Dwarf_Unsigned * /*debug_pubnames_size*/,
Dwarf_Unsigned * /*debug_str_size*/,
Dwarf_Unsigned * /*debug_frame_size*/,
Dwarf_Unsigned * /*debug_ranges_size*/,
Dwarf_Unsigned * /*debug_pubtypes_size*/);
/* Multiple releases spelled 'initial' as 'inital' .
The 'inital' spelling should not be used. */
Dwarf_Half /*value*/);
/* Additional interface with correct 'initial' spelling. */
/* It is likely you will want to call the following 5 functions
before accessing any frame information. All are useful
to tailor handling of pseudo-registers needed to turn
frame operation references into simpler forms and to
reflect ABI specific data. Of course altering libdwarf.h
and dwarf.h allow the same capabilities, but such header changes
do not let one change these values at runtime. */
Dwarf_Half /*value*/);
Dwarf_Half /*value*/);
Dwarf_Half /*value*/);
Dwarf_Half /*value*/);
Dwarf_Half /*value*/);
/* As of April 27, 2009, this version with no diepointer is
obsolete though supported. Use dwarf_get_ranges_a() instead. */
Dwarf_Off /*rangesoffset*/,
Dwarf_Ranges ** /*rangesbuf*/,
Dwarf_Signed * /*listlen*/,
Dwarf_Unsigned * /*bytecount*/,
Dwarf_Error * /*error*/);
/* This adds the address_size argument. New April 27, 2009 */
Dwarf_Off /*rangesoffset*/,
Dwarf_Die /* diepointer */,
Dwarf_Ranges ** /*rangesbuf*/,
Dwarf_Signed * /*listlen*/,
Dwarf_Unsigned * /*bytecount*/,
Dwarf_Error * /*error*/);
Dwarf_Ranges * /*rangesbuf*/,
Dwarf_Signed /*rangecount*/);
/* The harmless error list is a circular buffer of
errors we note but which do not stop us from processing
the object. Created so dwarfdump or other tools
can report such inconsequential errors without causing
anything to stop early. */
#define DW_HARMLESS_ERROR_MSG_STRING_SIZE 200
/* User code supplies size of array of pointers errmsg_ptrs_array
in count and the array of pointers (the pointers themselves
need not be initialized).
The pointers returned in the array of pointers
are invalidated by ANY call to libdwarf.
Use them before making another libdwarf call!
The array of string pointers passed in always has
a final null pointer, so if there are N pointers the
and M actual strings, then MIN(M,N-1) pointers are
set to point to error strings. The array of pointers
to strings always terminates with a NULL pointer.
If 'count' is passed in zero then errmsg_ptrs_array
is not touched.
The function returns DW_DLV_NO_ENTRY if no harmless errors
were noted so far. Returns DW_DLV_OK if there are errors.
Never returns DW_DLV_ERROR.
Each call empties the error list (discarding all current entries).
If newerr_count is non-NULL the count of harmless errors
since the last call is returned through the pointer
(some may have been discarded or not returned, it is a circular
list...).
If DW_DLV_NO_ENTRY is returned none of the arguments
here are touched or used.
*/
unsigned /*count*/,
const char ** /*errmsg_ptrs_array*/,
unsigned * /*newerr_count*/);
/* Insertion is only for testing the harmless error code, it is not
necessarily useful otherwise. */
char * /*newerror*/);
/* The size of the circular list of strings may be set
and reset as needed. If it is shortened excess
messages are simply dropped. It returns the previous
size. If zero passed in the size is unchanged
and it simply returns the current size */
unsigned /*maxcount*/);
/* The harmless error strings (if any) are freed when the dbg
is dwarf_finish()ed. */
/* When the val_in is known these dwarf_get_TAG_name (etc)
functions return the string corresponding to the val_in passed in
through the pointer s_out and the value returned is DW_DLV_OK.
The strings are in static storage
and must not be freed.
If DW_DLV_NO_ENTRY is returned the val_in is not known and
*s_out is not set. DW_DLV_ERROR is never returned.*/
#ifdef __cplusplus
}
#endif
#endif /* _LIBDWARF_H */