dwarf.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _DWARF_H
#define _DWARF_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/* dwarf.h - manifest constants used in the .debug section of ELF files */
/* the "tag" - the first short of any legal record */
#define TAG_padding 0x0000
#define TAG_array_type 0x0001
#define TAG_class_type 0x0002
#define TAG_entry_point 0x0003
#define TAG_enumeration_type 0x0004
#define TAG_formal_parameter 0x0005
#define TAG_global_subroutine 0x0006
#define TAG_global_variable 0x0007
#define TAG_imported_declaration 0x0008
#define TAG_inline_subroutine 0x0009
#define TAG_label 0x000a
#define TAG_lexical_block 0x000b
#define TAG_local_variable 0x000c
#define TAG_member 0x000d
#define TAG_member_function 0x000e
#define TAG_pointer_type 0x000f
#define TAG_reference_type 0x0010
#define TAG_source_file 0x0011
#define TAG_string_type 0x0012
#define TAG_structure_type 0x0013
#define TAG_subroutine 0x0014
#define TAG_subroutine_type 0x0015
#define TAG_typedef 0x0016
#define TAG_union_type 0x0017
#define TAG_unspecified_parameters 0x0018
#define TAG_variant 0x0019
/* attribute forms are encoded as part */
/* of the attribute name and must fit */
/* into 4 bits */
#define FORM_MASK 0xf
/* attribute names, halfwords with low 4 bits indicating the form */
/* atoms which compose a location description; must fit in a byte */
/* fundamental types; must fit in two bytes */
#define FT_signed_char 0x0002
#define FT_unsigned_char 0x0003
#define FT_signed_short 0x0005
#define FT_unsigned_short 0x0006
#define FT_signed_integer 0x0008
#define FT_unsigned_integer 0x0009
#define FT_signed_long 0x000b
#define FT_unsigned_long 0x000c
#define FT_float 0x000e
#define FT_dbl_prec_float 0x000f
#define FT_ext_prec_float 0x0010
#define FT_complex 0x0011
#define FT_dbl_prec_complex 0x0012
#define FT_set 0x0013
#define FT_void 0x0014
/* type modifiers; must fit in a byte */
#define MOD_pointer_to 0x01
#define MOD_reference_to 0x02
/* the "format" byte for array descriptions; formed from three */
/* one-bit fields */
#define FMT_FT 0 /* fundamental type */
#define FMT_CONST 0 /* 4-byte constant */
/* ordering of arrays */
#define ORD_row_major 0
#define ORD_col_major 1
/* visibility values */
#define VIS_local 0 /* for static functions in C */
/*
* DWARF Exception Header Encoding
*
* The DWARF Exception Header Encoding is used to describe the type of data
* used in the .eh_frame_hdr section. The upper 4 bits indicate how the value
* is to be applied. The lower 4 bits indicate the format of the data.
*/
/*
* Dwarf Exception Header Value format
*/
/* the Little Endian */
/* Base 128 (LEB128) */
/* the Little Endian */
/* Base 128 (LEB128) */
/*
* Dwarf Exception Header application
*/
/* modification. */
/* of itself */
#define DW_EH_PE_textrel 0x20
/* of the eh_frame_hdr segment */
/* ( segment type PT_AMD64_UNWIND ) */
#define DW_EH_PE_funcrel 0x40
/* relocation */
typedef enum _LANG {
LANG_UNK = 0,
LANG_ANSI_C_V1 = 1
} LANG;
/*
*/
/*
* LSB32EXTRACT()
*
* Extract a LSB encoded int which may or may not be
* aligned on a 4 byte boundary. This macro will work
* on either a MSB or LSB based system.
*/
#define LSB32EXTRACT(lsbptr) ((unsigned int)(\
((unsigned const char *)(lsbptr))[0] + \
#ifdef __cplusplus
}
#endif
#endif /* _DWARF_H */