dwarf_opaque.h revision 49d3bc91e27cd871b950d56c01398fa2f2e12ab4
/*
Copyright (C) 2000,2002,2003 Silicon Graphics, 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., 59 Temple Place - Suite 330, Boston MA 02111-1307,
USA.
Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
Mountain View, CA 94043, or:
For further information regarding this notice, see:
*/
#include <stddef.h>
struct Dwarf_Die_s {
/*
Points to the start of the portion corresponding to this Die in
the .debug_info section. */
/* Points to cu context for this die. */
};
struct Dwarf_Attribute_s {
/* Identical to ar_attribute_form except that if
the original form uleb was DW_FORM_indirect,
ar_attribute_form_direct contains DW_FORM_indirect
but ar_attribute_form contains the true form. */
};
/*
This structure provides the context for a compilation unit.
Thus, it contains the Dwarf_Debug, cc_dbg, that this cu
belongs to. It contains the information in the compilation
unit header, cc_length, cc_version_stamp, cc_abbrev_offset,
and cc_address_size, in the .debug_info section for that cu.
In addition, it contains the count, cc_count_cu, of the cu
number of that cu in the list of cu's in the .debug_info.
The count starts at 1, ie cc_count_cu is 1 for the first cu,
2 for the second and so on. This struct also contains a
pointer, cc_abbrev_table, to a list of pairs of abbrev code
and a pointer to the start of that abbrev
in the .debug_abbrev section.
Each die will also contain a pointer to such a struct to
record the context for that die.
**Updated by dwarf_next_cu_header in dwarf_die_deliv.c
*/
struct Dwarf_CU_Context_s {
unsigned char cc_offset_length;
};
struct Dwarf_Debug_s {
unsigned int de_nelfsecs;
/*
Context for the compilation_unit just read by a call to
dwarf_next_cu_header. **Updated by dwarf_next_cu_header in
/*
Points to linked list of CU Contexts for the CU's already read.
These are only CU's read by dwarf_next_cu_header(). */
/*
Points to the last CU Context added to the list by
dwarf_next_cu_header(). */
/*
This is the list of CU contexts read for dwarf_offdie(). These
may read ahead of dwarf_next_cu_header(). */
/* Offset of last byte of last CU read. */
/*
Number of bytes in the length, and offset field in various
.debug_* sections. It's not very meaningful, and is
only used in one 'approximate' calculation. */
/* number of bytes in a pointer of the target in various .debug_
sections. 4 in 32bit, 8 in MIPS 64, ia64. */
/* set at creation of a Dwarf_Debug to say if form_string should be
checked for valid length at every call. 0 means do the check.
non-zero means do not do the check. */
/*
Dwarf_Alloc_Hdr_s structs used to manage chunks that are
malloc'ed for each allocation type for structs. */
#ifdef DWARF_SIMPLE_MALLOC
struct simple_malloc_record_s * de_simple_malloc_base;
#endif
/*
These fields are used to process debug_frame section. **Updated
by dwarf_get_fde_list in dwarf_frame.h */
/*
Points to contiguous block of pointers to Dwarf_Cie_s structs. */
/* Count of number of Dwarf_Cie_s structs. */
/*
Points to contiguous block of pointers to Dwarf_Fde_s structs. */
/* Count of number of Dwarf_Fde_s structs. */
section */
eh_frame section */
void *(*de_copy_word) (void *, const void *, size_t);
unsigned char de_same_endian;
unsigned char de_elf_must_close; /* if non-zero, then
it was dwarf_init (not dwarf_elf_init)
so must elf_end() */
/*
The following are used for storing section indicies.
After a Dwarf_Debug is initialized, a zero for any of
these indicies indicates an absent section.
If the ELF spec is ever changed to permit 32-bit section
indicies, these will need to be changed.
*/
unsigned char de_big_endian_object; /* non-zero if big-endian
object opened. */
};
typedef struct Dwarf_Chain_s *Dwarf_Chain;
struct Dwarf_Chain_s {
void *ch_item;
};
#define CURRENT_VERSION_STAMP 2
/* Size of cu header version stamp field. */
#define CU_VERSION_STAMP_SIZE sizeof(Dwarf_Half)
/* Size of cu header address size field. */
#define CU_ADDRESS_SIZE_SIZE sizeof(Dwarf_Small)
#define ORIGINAL_DWARF_OFFSET_SIZE 4
#define DISTINGUISHED_VALUE 0xffffffff
#define DISTINGUISHED_VALUE_OFFSET_SIZE 8
/*
We don't load the sections until they are needed. This function is
used to load the section.
*/
Dwarf_Small **,
Dwarf_Error *);