| 1 |
/* |
| 2 |
|
| 3 |
Copyright (C) 2000,2005 Silicon Graphics, Inc. All Rights Reserved. |
| 4 |
Portions Copyright (C) 2008-2023 David Anderson. All Rights Reserved. |
| 5 |
|
| 6 |
This program is free software; you can redistribute it |
| 7 |
and/or modify it under the terms of version 2.1 of the |
| 8 |
GNU Lesser General Public License as published by the Free |
| 9 |
Software Foundation. |
| 10 |
|
| 11 |
This program is distributed in the hope that it would be |
| 12 |
useful, but WITHOUT ANY WARRANTY; without even the implied |
| 13 |
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 |
PURPOSE. |
| 15 |
|
| 16 |
Further, this software is distributed without any warranty |
| 17 |
that it is free of the rightful claim of any third person |
| 18 |
regarding infringement or the like. Any license provided |
| 19 |
herein, whether implied or otherwise, applies only to this |
| 20 |
software file. Patent licenses, if any, provided herein |
| 21 |
do not apply to combinations of this program with other |
| 22 |
software, or any other product whatsoever. |
| 23 |
|
| 24 |
You should have received a copy of the GNU Lesser General |
| 25 |
Public License along with this program; if not, write the |
| 26 |
Free Software Foundation, Inc., 51 Franklin Street - Fifth |
| 27 |
Floor, Boston MA 02110-1301, USA. |
| 28 |
|
| 29 |
*/ |
| 30 |
|
| 31 |
#ifndef DWARF_BASE_TYPES_H |
| 32 |
#define DWARF_BASE_TYPES_H |
| 33 |
|
| 34 |
#ifndef TRUE |
| 35 |
#define TRUE 1 |
| 36 |
#endif |
| 37 |
#ifndef FALSE |
| 38 |
#define FALSE 0 |
| 39 |
#endif |
| 40 |
|
| 41 |
/* .debug_addr new in DWARF5 */ |
| 42 |
#define DW_ADDR_VERSION5 5 |
| 43 |
|
| 44 |
/* To identify a cie. That is, for .debug_frame */ |
| 45 |
#define DW_CIE_ID ~(0x0) |
| 46 |
#define DW_CIE_VERSION 1 /* DWARF2 */ |
| 47 |
#define DW_CIE_VERSION3 3 /* DWARF3 */ |
| 48 |
#define DW_CIE_VERSION4 4 /* DWARF4 */ |
| 49 |
#define DW_CIE_VERSION5 5 /* DWARF5 */ |
| 50 |
|
| 51 |
/* For .debug_info DWARF2,3,4,5. |
| 52 |
.debug_types in DWARF4 only, and gets DW_CU_VERSION4. */ |
| 53 |
#define DW_CU_VERSION2 2 |
| 54 |
#define DW_CU_VERSION3 3 |
| 55 |
#define DW_CU_VERSION4 4 |
| 56 |
#define DW_CU_VERSION5 5 |
| 57 |
|
| 58 |
/* For .debug_macro: DWARF 4 (extension) or DWARF5 */ |
| 59 |
#define DW_MACRO_VERSION4 4 |
| 60 |
#define DW_MACRO_VERSION5 5 |
| 61 |
|
| 62 |
/* DWARF2,3, 4 and 5.*/ |
| 63 |
#define DW_ARANGES_VERSION2 2 |
| 64 |
|
| 65 |
#define DW_LINE_VERSION2 2 |
| 66 |
#define DW_LINE_VERSION3 3 |
| 67 |
#define DW_LINE_VERSION4 4 |
| 68 |
#define DW_LINE_VERSION5 5 |
| 69 |
|
| 70 |
/* .debug_line_str (and .dwo) new in DWARF5. */ |
| 71 |
#define DW_LINE_STR_VERSION5 5 |
| 72 |
|
| 73 |
/* Experimental two-level line tables */ |
| 74 |
#define EXPERIMENTAL_LINE_TABLES_VERSION 0xf006 |
| 75 |
|
| 76 |
/* .debug_loc (and .dwo) First header version number is DWARF5. */ |
| 77 |
#define DW_LOC_VERSION5 5 |
| 78 |
|
| 79 |
/* .debug_names new in DWARF5. */ |
| 80 |
#define DW_NAMES_VERSION5 5 |
| 81 |
|
| 82 |
/* .debug_pubnames in DWARF2,3,4. */ |
| 83 |
#define DW_PUBNAMES_VERSION2 2 |
| 84 |
/* .debug_pubnames in DWARF3,4. */ |
| 85 |
#define DW_PUBTYPES_VERSION2 2 |
| 86 |
|
| 87 |
/* .debug_ranges gets a version number in header in DWARF5. */ |
| 88 |
#define DW_RANGES_VERSION5 5 |
| 89 |
|
| 90 |
/* .debug_str_offsets (and .dwo) new in DWARF5. */ |
| 91 |
#define DW_STR_OFFSETS_VERSION5 5 |
| 92 |
#define DW_STR_OFFSETS_VERSION4 4 /* GNU extension in DW4 */ |
| 93 |
|
| 94 |
/* .debug_sup new in DWARF5. */ |
| 95 |
#define DW_SUP_VERSION5 5 |
| 96 |
|
| 97 |
/* .debug_cu_index new in DWARF5. */ |
| 98 |
#define DW_CU_INDEX_VERSION5 5 |
| 99 |
/* .debug_tu_index new in DWARF5. */ |
| 100 |
#define DW_TU_INDEX_VERSION5 5 |
| 101 |
|
| 102 |
/* These are allocation type codes for structs that |
| 103 |
are internal to the Libdwarf Consumer library. */ |
| 104 |
#define DW_DLA_ABBREV_LIST 0x1e |
| 105 |
#define DW_DLA_CHAIN 0x1f |
| 106 |
#define DW_DLA_CU_CONTEXT 0x20 |
| 107 |
#define DW_DLA_FRAME 0x21 |
| 108 |
#define DW_DLA_GLOBAL_CONTEXT 0x22 |
| 109 |
#define DW_DLA_FILE_ENTRY 0x23 |
| 110 |
#define DW_DLA_LINE_CONTEXT 0x24 |
| 111 |
#define DW_DLA_LOC_CHAIN 0x25 |
| 112 |
#define DW_DLA_HASH_TABLE 0x26 |
| 113 |
#define DW_DLA_FUNC_CONTEXT 0x27 |
| 114 |
#define DW_DLA_TYPENAME_CONTEXT 0x28 |
| 115 |
#define DW_DLA_VAR_CONTEXT 0x29 |
| 116 |
#define DW_DLA_WEAK_CONTEXT 0x2a |
| 117 |
#define DW_DLA_PUBTYPES_CONTEXT 0x2b /* DWARF3 */ |
| 118 |
#define DW_DLA_HASH_TABLE_ENTRY 0x2c |
| 119 |
#define DW_DLA_FISSION_PERCU 0x2d |
| 120 |
#define DW_DLA_CHAIN_2 0x3d |
| 121 |
/* Thru 0x36 reserved for internal future use. */ |
| 122 |
|
| 123 |
/* Maximum number of allocation types for allocation routines. |
| 124 |
Only used with malloc_check.c and that is basically obsolete. */ |
| 125 |
#define MAX_DW_DLA 0x3a |
| 126 |
|
| 127 |
typedef signed char Dwarf_Sbyte; |
| 128 |
typedef unsigned char Dwarf_Ubyte; |
| 129 |
typedef signed short Dwarf_Shalf; |
| 130 |
typedef Dwarf_Small *Dwarf_Byte_Ptr; |
| 131 |
|
| 132 |
#define DWARF_HALF_SIZE 2 |
| 133 |
#define DWARF_32BIT_SIZE 4 |
| 134 |
#define DWARF_64BIT_SIZE 8 |
| 135 |
|
| 136 |
typedef struct Dwarf_Abbrev_List_s *Dwarf_Abbrev_List; |
| 137 |
typedef struct Dwarf_File_Entry_s *Dwarf_File_Entry; |
| 138 |
typedef struct Dwarf_CU_Context_s *Dwarf_CU_Context; |
| 139 |
typedef struct Dwarf_Hash_Table_s *Dwarf_Hash_Table; |
| 140 |
typedef struct Dwarf_Alloc_Hdr_s *Dwarf_Alloc_Hdr; |
| 141 |
#endif /* DWARF_BASE_TYPES_H */ |