rdwarf 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/.travis.yml +4 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +28 -0
  6. data/README.md +39 -0
  7. data/Rakefile +8 -0
  8. data/bin/console +14 -0
  9. data/bin/setup +7 -0
  10. data/ext/rdwarf/depend +5 -0
  11. data/ext/rdwarf/extconf.rb +29 -0
  12. data/ext/rdwarf/libdwarf/CHANGES +102 -0
  13. data/ext/rdwarf/libdwarf/CODINGSTYLE +71 -0
  14. data/ext/rdwarf/libdwarf/COPYING +28 -0
  15. data/ext/rdwarf/libdwarf/ChangeLog +619 -0
  16. data/ext/rdwarf/libdwarf/ChangeLog2006 +835 -0
  17. data/ext/rdwarf/libdwarf/ChangeLog2007 +217 -0
  18. data/ext/rdwarf/libdwarf/ChangeLog2008 +263 -0
  19. data/ext/rdwarf/libdwarf/ChangeLog2009 +348 -0
  20. data/ext/rdwarf/libdwarf/ChangeLog2010 +175 -0
  21. data/ext/rdwarf/libdwarf/ChangeLog2011 +297 -0
  22. data/ext/rdwarf/libdwarf/ChangeLog2012 +131 -0
  23. data/ext/rdwarf/libdwarf/ChangeLog2013 +238 -0
  24. data/ext/rdwarf/libdwarf/ChangeLog2014 +399 -0
  25. data/ext/rdwarf/libdwarf/LGPL.txt +504 -0
  26. data/ext/rdwarf/libdwarf/LIBDWARFCOPYRIGHT +40 -0
  27. data/ext/rdwarf/libdwarf/Makefile.in +220 -0
  28. data/ext/rdwarf/libdwarf/NEWS +535 -0
  29. data/ext/rdwarf/libdwarf/README +235 -0
  30. data/ext/rdwarf/libdwarf/checkexamples.c +1179 -0
  31. data/ext/rdwarf/libdwarf/cmplrs/dwarf_addr_finder.h +55 -0
  32. data/ext/rdwarf/libdwarf/common.c +62 -0
  33. data/ext/rdwarf/libdwarf/common.h +38 -0
  34. data/ext/rdwarf/libdwarf/config.h.in +146 -0
  35. data/ext/rdwarf/libdwarf/configure +5581 -0
  36. data/ext/rdwarf/libdwarf/configure.in +167 -0
  37. data/ext/rdwarf/libdwarf/dw-linetableheader.txt +39 -0
  38. data/ext/rdwarf/libdwarf/dwarf.h +1342 -0
  39. data/ext/rdwarf/libdwarf/dwarf_abbrev.c +291 -0
  40. data/ext/rdwarf/libdwarf/dwarf_abbrev.h +45 -0
  41. data/ext/rdwarf/libdwarf/dwarf_addr_finder.c +676 -0
  42. data/ext/rdwarf/libdwarf/dwarf_alloc.c +685 -0
  43. data/ext/rdwarf/libdwarf/dwarf_alloc.h +38 -0
  44. data/ext/rdwarf/libdwarf/dwarf_arange.c +595 -0
  45. data/ext/rdwarf/libdwarf/dwarf_arange.h +62 -0
  46. data/ext/rdwarf/libdwarf/dwarf_base_types.h +157 -0
  47. data/ext/rdwarf/libdwarf/dwarf_die_deliv.c +1802 -0
  48. data/ext/rdwarf/libdwarf/dwarf_die_deliv.h +46 -0
  49. data/ext/rdwarf/libdwarf/dwarf_elf_access.c +1348 -0
  50. data/ext/rdwarf/libdwarf/dwarf_elf_access.h +46 -0
  51. data/ext/rdwarf/libdwarf/dwarf_error.c +492 -0
  52. data/ext/rdwarf/libdwarf/dwarf_error.h +53 -0
  53. data/ext/rdwarf/libdwarf/dwarf_form.c +1302 -0
  54. data/ext/rdwarf/libdwarf/dwarf_frame.c +2454 -0
  55. data/ext/rdwarf/libdwarf/dwarf_frame.h +418 -0
  56. data/ext/rdwarf/libdwarf/dwarf_frame2.c +1533 -0
  57. data/ext/rdwarf/libdwarf/dwarf_frame3.c +282 -0
  58. data/ext/rdwarf/libdwarf/dwarf_funcs.c +123 -0
  59. data/ext/rdwarf/libdwarf/dwarf_funcs.h +33 -0
  60. data/ext/rdwarf/libdwarf/dwarf_gdbindex.c +520 -0
  61. data/ext/rdwarf/libdwarf/dwarf_gdbindex.h +97 -0
  62. data/ext/rdwarf/libdwarf/dwarf_global.c +612 -0
  63. data/ext/rdwarf/libdwarf/dwarf_global.h +117 -0
  64. data/ext/rdwarf/libdwarf/dwarf_harmless.c +228 -0
  65. data/ext/rdwarf/libdwarf/dwarf_harmless.h +31 -0
  66. data/ext/rdwarf/libdwarf/dwarf_incl.h +61 -0
  67. data/ext/rdwarf/libdwarf/dwarf_init_finish.c +1263 -0
  68. data/ext/rdwarf/libdwarf/dwarf_leb.c +159 -0
  69. data/ext/rdwarf/libdwarf/dwarf_line.c +1822 -0
  70. data/ext/rdwarf/libdwarf/dwarf_line.h +446 -0
  71. data/ext/rdwarf/libdwarf/dwarf_line2.c +98 -0
  72. data/ext/rdwarf/libdwarf/dwarf_line_table_reader_common.c +1583 -0
  73. data/ext/rdwarf/libdwarf/dwarf_loc.c +1525 -0
  74. data/ext/rdwarf/libdwarf/dwarf_loc.h +149 -0
  75. data/ext/rdwarf/libdwarf/dwarf_loc2.c +833 -0
  76. data/ext/rdwarf/libdwarf/dwarf_macro.c +479 -0
  77. data/ext/rdwarf/libdwarf/dwarf_macro.h +35 -0
  78. data/ext/rdwarf/libdwarf/dwarf_opaque.h +778 -0
  79. data/ext/rdwarf/libdwarf/dwarf_original_elf_init.c +219 -0
  80. data/ext/rdwarf/libdwarf/dwarf_print_lines.c +631 -0
  81. data/ext/rdwarf/libdwarf/dwarf_pubtypes.c +132 -0
  82. data/ext/rdwarf/libdwarf/dwarf_query.c +1594 -0
  83. data/ext/rdwarf/libdwarf/dwarf_ranges.c +194 -0
  84. data/ext/rdwarf/libdwarf/dwarf_reloc_arm.h +308 -0
  85. data/ext/rdwarf/libdwarf/dwarf_reloc_mips.h +117 -0
  86. data/ext/rdwarf/libdwarf/dwarf_reloc_ppc.h +242 -0
  87. data/ext/rdwarf/libdwarf/dwarf_reloc_ppc64.h +272 -0
  88. data/ext/rdwarf/libdwarf/dwarf_reloc_x86_64.h +127 -0
  89. data/ext/rdwarf/libdwarf/dwarf_sort_line.c +665 -0
  90. data/ext/rdwarf/libdwarf/dwarf_string.c +82 -0
  91. data/ext/rdwarf/libdwarf/dwarf_stubs.c +38 -0
  92. data/ext/rdwarf/libdwarf/dwarf_tied.c +423 -0
  93. data/ext/rdwarf/libdwarf/dwarf_tsearch.h +125 -0
  94. data/ext/rdwarf/libdwarf/dwarf_tsearchhash.c +675 -0
  95. data/ext/rdwarf/libdwarf/dwarf_types.c +121 -0
  96. data/ext/rdwarf/libdwarf/dwarf_types.h +32 -0
  97. data/ext/rdwarf/libdwarf/dwarf_util.c +913 -0
  98. data/ext/rdwarf/libdwarf/dwarf_util.h +324 -0
  99. data/ext/rdwarf/libdwarf/dwarf_vars.c +125 -0
  100. data/ext/rdwarf/libdwarf/dwarf_vars.h +29 -0
  101. data/ext/rdwarf/libdwarf/dwarf_weaks.c +123 -0
  102. data/ext/rdwarf/libdwarf/dwarf_weaks.h +29 -0
  103. data/ext/rdwarf/libdwarf/dwarf_xu_index.c +579 -0
  104. data/ext/rdwarf/libdwarf/dwarf_xu_index.h +68 -0
  105. data/ext/rdwarf/libdwarf/dwgetopt.c +181 -0
  106. data/ext/rdwarf/libdwarf/dwgetopt.h +51 -0
  107. data/ext/rdwarf/libdwarf/gennames.c +531 -0
  108. data/ext/rdwarf/libdwarf/install.sh +119 -0
  109. data/ext/rdwarf/libdwarf/libdwarf.h.in +3746 -0
  110. data/ext/rdwarf/libdwarf/libdwarf2.1.mm +9805 -0
  111. data/ext/rdwarf/libdwarf/libdwarf2.1.pdf +0 -0
  112. data/ext/rdwarf/libdwarf/libdwarf2p.1.mm +2807 -0
  113. data/ext/rdwarf/libdwarf/libdwarf2p.1.pdf +0 -0
  114. data/ext/rdwarf/libdwarf/libdwarfdefs.h +81 -0
  115. data/ext/rdwarf/libdwarf/malloc_check.c +327 -0
  116. data/ext/rdwarf/libdwarf/malloc_check.h +52 -0
  117. data/ext/rdwarf/libdwarf/mips_extensions.mm +1266 -0
  118. data/ext/rdwarf/libdwarf/mips_extensions.pdf +0 -0
  119. data/ext/rdwarf/libdwarf/pro_alloc.c +179 -0
  120. data/ext/rdwarf/libdwarf/pro_alloc.h +33 -0
  121. data/ext/rdwarf/libdwarf/pro_arange.c +310 -0
  122. data/ext/rdwarf/libdwarf/pro_arange.h +51 -0
  123. data/ext/rdwarf/libdwarf/pro_die.c +431 -0
  124. data/ext/rdwarf/libdwarf/pro_die.h +59 -0
  125. data/ext/rdwarf/libdwarf/pro_encode_nm.c +108 -0
  126. data/ext/rdwarf/libdwarf/pro_encode_nm.h +39 -0
  127. data/ext/rdwarf/libdwarf/pro_error.c +96 -0
  128. data/ext/rdwarf/libdwarf/pro_error.h +43 -0
  129. data/ext/rdwarf/libdwarf/pro_expr.c +575 -0
  130. data/ext/rdwarf/libdwarf/pro_expr.h +36 -0
  131. data/ext/rdwarf/libdwarf/pro_finish.c +45 -0
  132. data/ext/rdwarf/libdwarf/pro_forms.c +1271 -0
  133. data/ext/rdwarf/libdwarf/pro_frame.c +572 -0
  134. data/ext/rdwarf/libdwarf/pro_frame.h +120 -0
  135. data/ext/rdwarf/libdwarf/pro_funcs.c +50 -0
  136. data/ext/rdwarf/libdwarf/pro_incl.h +91 -0
  137. data/ext/rdwarf/libdwarf/pro_init.c +327 -0
  138. data/ext/rdwarf/libdwarf/pro_line.c +373 -0
  139. data/ext/rdwarf/libdwarf/pro_line.h +112 -0
  140. data/ext/rdwarf/libdwarf/pro_macinfo.c +457 -0
  141. data/ext/rdwarf/libdwarf/pro_macinfo.h +31 -0
  142. data/ext/rdwarf/libdwarf/pro_opaque.h +513 -0
  143. data/ext/rdwarf/libdwarf/pro_pubnames.c +60 -0
  144. data/ext/rdwarf/libdwarf/pro_reloc.c +253 -0
  145. data/ext/rdwarf/libdwarf/pro_reloc.h +38 -0
  146. data/ext/rdwarf/libdwarf/pro_reloc_stream.c +256 -0
  147. data/ext/rdwarf/libdwarf/pro_reloc_stream.h +52 -0
  148. data/ext/rdwarf/libdwarf/pro_reloc_symbolic.c +245 -0
  149. data/ext/rdwarf/libdwarf/pro_reloc_symbolic.h +45 -0
  150. data/ext/rdwarf/libdwarf/pro_section.c +2233 -0
  151. data/ext/rdwarf/libdwarf/pro_section.h +100 -0
  152. data/ext/rdwarf/libdwarf/pro_types.c +274 -0
  153. data/ext/rdwarf/libdwarf/pro_types.h +34 -0
  154. data/ext/rdwarf/libdwarf/pro_util.h +38 -0
  155. data/ext/rdwarf/libdwarf/pro_vars.c +52 -0
  156. data/ext/rdwarf/libdwarf/pro_weaks.c +51 -0
  157. data/ext/rdwarf/rdwarf.c +765 -0
  158. data/ext/rdwarf/rdwarf.h +52 -0
  159. data/ext/rdwarf/rdwarf_names_gen.rb +109 -0
  160. data/lib/rdwarf.rb +181 -0
  161. data/lib/rdwarf/version.rb +3 -0
  162. data/rdwarf.gemspec +30 -0
  163. metadata +251 -0
@@ -0,0 +1,35 @@
1
+ /*
2
+
3
+ Copyright (C) 2000, 2004 Silicon Graphics, Inc. All Rights Reserved.
4
+
5
+ This program is free software; you can redistribute it and/or modify it
6
+ under the terms of version 2.1 of the GNU Lesser General Public License
7
+ as published by the Free Software Foundation.
8
+
9
+ This program is distributed in the hope that it would be useful, but
10
+ WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+
13
+ Further, this software is distributed without any warranty that it is
14
+ free of the rightful claim of any third person regarding infringement
15
+ or the like. Any license provided herein, whether implied or
16
+ otherwise, applies only to this software file. Patent licenses, if
17
+ any, provided herein do not apply to combinations of this program with
18
+ other software, or any other product whatsoever.
19
+
20
+ You should have received a copy of the GNU Lesser General Public
21
+ License along with this program; if not, write the Free Software
22
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
23
+ USA.
24
+
25
+ */
26
+
27
+
28
+ /*
29
+
30
+
31
+ dwarf_macro.h
32
+
33
+ $Revision: 1.4 $ $Date: 2004/10/28 22:19:14 $
34
+
35
+ */
@@ -0,0 +1,778 @@
1
+ /*
2
+
3
+ Copyright (C) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
4
+ Portions Copyright (C) 2007-2013 David Anderson. All Rights Reserved.
5
+ Portions Copyright (C) 2008-2010 Arxan Technologies, Inc. All Rights Reserved.
6
+
7
+ This program is free software; you can redistribute it and/or modify it
8
+ under the terms of version 2.1 of the GNU Lesser General Public License
9
+ as published by the Free Software Foundation.
10
+
11
+ This program is distributed in the hope that it would be useful, but
12
+ WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
+
15
+ Further, this software is distributed without any warranty that it is
16
+ free of the rightful claim of any third person regarding infringement
17
+ or the like. Any license provided herein, whether implied or
18
+ otherwise, applies only to this software file. Patent licenses, if
19
+ any, provided herein do not apply to combinations of this program with
20
+ other software, or any other product whatsoever.
21
+
22
+ You should have received a copy of the GNU Lesser General Public
23
+ License along with this program; if not, write the Free Software
24
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
25
+ USA.
26
+
27
+ */
28
+ /* Following the nomenclature of the DWARF standard
29
+ Section Version Numbers (DWARF 5):
30
+ * means not applicable.
31
+ - means not defined in that version.
32
+ The version numbers for .debug_info is the same as .debug_info.dwo
33
+ (etc for the other dwo sections).
34
+ The versions applicable by section are:
35
+ . DWARF2 DWARF3 DWARF4 DWARF5
36
+ .debug_abbrev * * * *
37
+ .debug_addr - - - 5
38
+ .debug_aranges 2 2 2 2
39
+ .debug_frame 1 3 4 4
40
+ .debug_info 2 3 4 5
41
+ .debug_line 2 3 4 5
42
+ .debug_line_str - - - 5
43
+ .debug_loc * * * 5
44
+ .debug_macinfo * * * -
45
+ .debug_macro - - - 5
46
+ .debug_pubnames 2 2 2 -
47
+ .debug_pubtypes - 2 2 -
48
+ .debug_ranges - * * 5
49
+ .debug_str * * * *
50
+ .debug_str_offsets - - - 5
51
+ .debug_sup - - - 5
52
+ .debug_types - - 4 -
53
+
54
+ .debug_abbrev.dwo - - - *
55
+ .debug_info.dwo - - - 5
56
+ .debug_line.dwo - - - 5
57
+ .debug_loc.dwo - - - 5
58
+ .debug_macro.dwo - - - 5
59
+ .debug_str.dwo - - - *
60
+ .debug_str_offsets.dwo - - - 5
61
+
62
+ .debug_cu_index - - - 5
63
+ .debug_tu_index - - - 5
64
+
65
+ */
66
+
67
+ #include <stddef.h>
68
+
69
+ /* The 'debug_info' names below are non-zero (non-NULL) only
70
+ if we are processing a debug_info section. And vice versa
71
+ for a debug_types section. */
72
+
73
+ struct Dwarf_Die_s {
74
+ Dwarf_Byte_Ptr di_debug_ptr;
75
+ Dwarf_Abbrev_List di_abbrev_list;
76
+ Dwarf_CU_Context di_cu_context;
77
+ int di_abbrev_code;
78
+
79
+ /* TRUE if part of debug_info. FALSE if part of .debug_types. */
80
+ Dwarf_Bool di_is_info;
81
+ };
82
+
83
+ struct Dwarf_Attribute_s {
84
+ Dwarf_Half ar_attribute; /* Attribute Value. */
85
+ Dwarf_Half ar_attribute_form; /* Attribute Form. */
86
+ Dwarf_Half ar_attribute_form_direct;
87
+ /* Identical to ar_attribute_form except that if
88
+ the original form uleb was DW_FORM_indirect,
89
+ ar_attribute_form_direct contains DW_FORM_indirect
90
+ but ar_attribute_form contains the true form. */
91
+ Dwarf_CU_Context ar_cu_context;
92
+ /* The following points to either debug_info or debug_types
93
+ depending on if context is cc_is_info or not. */
94
+ Dwarf_Small *ar_debug_ptr;
95
+
96
+ Dwarf_Die ar_die;/* Access to the DIE owning the attribute */
97
+ Dwarf_Attribute ar_next;
98
+ };
99
+
100
+ /*
101
+ This structure provides the context for a compilation unit.
102
+ Thus, it contains the Dwarf_Debug, cc_dbg, that this cu
103
+ belongs to. It contains the information in the compilation
104
+ unit header, cc_length, cc_version_stamp, cc_abbrev_offset,
105
+ and cc_address_size, in the .debug_info section for that cu.
106
+ In addition, it contains the count, cc_count_cu, of the cu
107
+ number of that cu in the list of cu's in the .debug_info.
108
+ The count starts at 1, ie cc_count_cu is 1 for the first cu,
109
+ 2 for the second and so on. This struct also contains a
110
+ pointer, cc_abbrev_table, to a list of pairs of abbrev code
111
+ and a pointer to the start of that abbrev
112
+ in the .debug_abbrev section.
113
+
114
+ Each die will also contain a pointer to such a struct to
115
+ record the context for that die.
116
+
117
+ Notice that a pointer to the CU DIE itself is
118
+ Dwarf_Off off2 = cu_context->cc_debug_info_offset;
119
+ cu_die_info_ptr = dbg->de_debug_info.dss_data +
120
+ off2 + _dwarf_length_of_cu_header(dbg, off2);
121
+ Or similar for de_debug_types.
122
+
123
+ **Updated by dwarf_next_cu_header in dwarf_die_deliv.c
124
+ */
125
+ struct Dwarf_CU_Context_s {
126
+ Dwarf_Debug cc_dbg;
127
+ /* The sum of cc_length, cc_length_size, and cc_extension_size
128
+ is the total length of the CU including its header.
129
+
130
+ cc_length is the length of the compilation unit excluding
131
+ cc_length_size and cc_extension_size. */
132
+ Dwarf_Unsigned cc_length;
133
+
134
+ /* cc_length_size is the size in bytes of an offset.
135
+ Should probably be renamed cc_offset_size.
136
+ 4 for 32bit dwarf, 8 for 64bit dwarf (whether MIPS/IRIX
137
+ 64bit dwarf or standard 64bit dwarf using the extension
138
+ mechanism). */
139
+ Dwarf_Small cc_length_size;
140
+
141
+ /* cc_extension_size is zero unless this is standard
142
+ DWARF3 and later 64bit dwarf using the extension mechanism.
143
+ 64bit DWARF3 and later: cc_extension_size is 4.
144
+ 64bit DWARF2 MIPS/IRIX: cc_extension_size is zero.
145
+ 32bit DWARF: cc_extension_size is zero. */
146
+ Dwarf_Small cc_extension_size;
147
+
148
+ /* cc_version_stamp is the DWARF version number applicable
149
+ to the DWARF in this compilation unit. 2,3,4,... */
150
+ Dwarf_Half cc_version_stamp;
151
+ /* cc_abbrev_offset is the section-global offset
152
+ of the .debug_abbrev section this CU uses.
153
+ Data from CU header. Includes DWP adjustment made
154
+ as soon as we create a cu_context. */
155
+ Dwarf_Unsigned cc_abbrev_offset;
156
+
157
+ /* cc_address_size is the size of an address in this
158
+ compilation unit. */
159
+ Dwarf_Small cc_address_size;
160
+ Dwarf_Small cc_segment_selector_size;
161
+
162
+ /* cc_debug_offset is the global offset in the section
163
+ of the CU header of this CU.
164
+ That is, it is a section global offset.
165
+ May be debug_info or debug_types
166
+ but those are distinct.
167
+ Even in DWP this is set to true global offset
168
+ right away when cu_context created.
169
+ See cc_is_info flag. */
170
+ Dwarf_Unsigned cc_debug_offset;
171
+
172
+ /* cc_signature is in the TU header
173
+ of a type unit of a TU DIE.
174
+ Ignore this field if cc_signature_present is zero.
175
+
176
+ If cc_unit_type == DW_UT_compile or DW_UT_partial
177
+ the signature is a CU signature.
178
+ If cc_unit_type == DW_UT_type
179
+ the signature is a type signature. */
180
+ Dwarf_Sig8 cc_type_signature;
181
+
182
+ /* cc_typeoffsets contains the
183
+ section-local DIE offset of the type
184
+ the signature applies to if the cc_unit_type
185
+ is DW_UT_type. */
186
+ Dwarf_Unsigned cc_type_signature_offset;
187
+
188
+ /* For each CU and each TU
189
+ in a dwp package file there is
190
+ is a hash and
191
+ a set of offsets indexed by DW_SECT_* id.
192
+ Only one such set per CU or TU.
193
+ The data on all that is in cc_dwp_offsets
194
+
195
+ If it is a TU the signature in cc_dwp_offsets
196
+ must match the signature in cc_type_signature.
197
+ */
198
+ struct Dwarf_Debug_Fission_Per_CU_s cc_dwp_offsets;
199
+
200
+
201
+ /* If the attribute DW_AT_[GNU_]addr_base is present in the
202
+ CU die, its value is in cc_addr_base.
203
+ cc_addr_base_present TRUE means cc_addr_base is meaningful, which
204
+ is a check on the correctness of the DWARF.
205
+ This base field created in DWARF5 to reduce the
206
+ number of address relocations a linker must do.
207
+
208
+
209
+ DW_AT_str_offsets_base exists for a DW_FORM_strx,
210
+ for GNU a base of zero is apparently fine.
211
+ This base field created in DWARF5 to reduce the
212
+ number of string offset relocations a linker must do.
213
+
214
+ DW_AT_ranges_base similarly.
215
+ Within the CU, this base means that DW_FORM_sec_offset
216
+ values need not be realocated by the linker.
217
+
218
+ Fields listed in this order for a tiny space saving
219
+ as opposed to greatest clarity.
220
+ */
221
+ Dwarf_Bool cc_signature_present; /* Meaning type signature
222
+ in TU header or, for CU header, signature in CU DIE. */
223
+ Dwarf_Bool cc_addr_base_present; /* Not TRUE in .dwo */
224
+ Dwarf_Bool cc_ranges_base_present; /* Not TRUE in .dwo */
225
+ Dwarf_Bool cc_str_offsets_base_present;
226
+
227
+ /* Non zero if this context is a dwo section. Either
228
+ dwo or dwp file. */
229
+ Dwarf_Bool cc_is_dwo;
230
+
231
+ /* cc_cu_die_offset_present is non-zero if
232
+ cc_cu_die_global_sec_offset is meaningful. */
233
+ Dwarf_Bool cc_cu_die_offset_present;
234
+
235
+ /* FIXME from DW_AT_addr_base in CU DIE */
236
+ Dwarf_Unsigned cc_addr_base; /* Zero in .dwo */
237
+ /* FIXME from DW_AT_ranges_base in CU DIE */
238
+ Dwarf_Unsigned cc_ranges_base; /* Zero in .dwo */
239
+ /* FIXME from DW_AT_str_offsets_base in CU DIE */
240
+ Dwarf_Unsigned cc_str_offsets_base;
241
+
242
+ /* Global section offset to the bytes of the CU die for this CU.
243
+ Set when the CU die is accessed by dwarf_siblingof(). */
244
+ Dwarf_Unsigned cc_cu_die_global_sec_offset;
245
+
246
+ Dwarf_Byte_Ptr cc_last_abbrev_ptr;
247
+ Dwarf_Byte_Ptr cc_last_abbrev_endptr;
248
+ Dwarf_Hash_Table cc_abbrev_hash_table;
249
+ Dwarf_CU_Context cc_next;
250
+
251
+ /*unsigned char cc_offset_length; */
252
+ Dwarf_Bool cc_is_info; /* TRUE means context is
253
+ in debug_info, FALSE means is in debug_types.
254
+ FALSE only possible for DWARF4 .debug_types
255
+ section CUs.
256
+ For DWARF5 all DIEs are in .debug_info[.dwo] */
257
+
258
+ Dwarf_Half cc_unit_type; /* DW_UT_type or DW_UT_compile
259
+ or DW_UT_partial (from the CU header in DWARF5).
260
+ Zero until the value is known.
261
+ For DWARF 2,3,4 this is filled in initially
262
+ from the CU header and refined by inspecting the TAG
263
+ of the CU DIE to detect DW_UT_partial is applicable. */
264
+ };
265
+
266
+ /* Consolidates section-specific data in one place.
267
+ Section is an Elf specific term, intended as a general
268
+ term (for non-Elf objects some code must synthesize the
269
+ values somehow). */
270
+ struct Dwarf_Section_s {
271
+ Dwarf_Small * dss_data;
272
+ Dwarf_Unsigned dss_size;
273
+ /* Some Elf sections have a non-zero dss_entrysize which
274
+ is the size in bytes of a table entry in the section.
275
+ Relocations and symbols are both in tables, so have a
276
+ non-zero entrysize. Object formats which do not care
277
+ about this should leave this field zero. */
278
+ Dwarf_Unsigned dss_entrysize;
279
+ /* dss_index is the section index as things are numbered in
280
+ an object file being read. An Elf section number. */
281
+ Dwarf_Word dss_index;
282
+ /* dss_addr is the 'section address' which is only
283
+ non-zero for a GNU eh section.
284
+ Purpose: to handle DW_EH_PE_pcrel encoding. Leaving
285
+ it zero is fine for non-elf. */
286
+ Dwarf_Addr dss_addr;
287
+ Dwarf_Small dss_data_was_malloc;
288
+ /* is_in_use set during initial object reading to
289
+ detect duplicates. Ignored after setup done. */
290
+ Dwarf_Small dss_is_in_use;
291
+
292
+ /* For non-elf, leaving the following fields zero
293
+ will mean they are ignored. */
294
+ /* dss_link should be zero unless a section has a link
295
+ to another (sh_link). Used to access relocation data for
296
+ a section (and for symtab section, access its strtab). */
297
+ Dwarf_Word dss_link;
298
+ /* The following is used when reading .rela sections
299
+ (such sections appear in some .o files). */
300
+ Dwarf_Half dss_reloc_index; /* Zero means ignore the reloc fields. */
301
+ Dwarf_Small * dss_reloc_data;
302
+ Dwarf_Unsigned dss_reloc_size;
303
+ Dwarf_Unsigned dss_reloc_entrysize;
304
+ Dwarf_Addr dss_reloc_addr;
305
+ /* dss_reloc_symtab is the sh_link of a .rela to its .symtab, leave
306
+ it 0 if non-meaningful. */
307
+ Dwarf_Addr dss_reloc_symtab;
308
+ /* dss_reloc_link should be zero unless a reloc section has a link
309
+ to another (sh_link). Used to access the symtab for relocations
310
+ a section. */
311
+ Dwarf_Word dss_reloc_link;
312
+ /* Pointer to the elf symtab, used for elf .rela. Leave it 0
313
+ if not relevant. */
314
+ struct Dwarf_Section_s *dss_symtab;
315
+ /* dss_name must never be freed, it is a quoted string
316
+ in libdwarf. */
317
+ const char * dss_name;
318
+ };
319
+
320
+ /* Overview: if next_to_use== first, no error slots are used.
321
+ If next_to_use+1 (mod maxcount) == first the slots are all used
322
+ */
323
+ struct Dwarf_Harmless_s {
324
+ unsigned dh_maxcount;
325
+ unsigned dh_next_to_use;
326
+ unsigned dh_first;
327
+ unsigned dh_errs_count;
328
+ char ** dh_errors;
329
+ };
330
+
331
+ /* Data needed seperately for debug_info and debug_types
332
+ as we may be reading both interspersed. */
333
+
334
+ struct Dwarf_Debug_InfoTypes_s {
335
+ /* Context for the compilation_unit just read by a call to
336
+ dwarf_next_cu_header. **Updated by dwarf_next_cu_header in
337
+ dwarf_die_deliv.c */
338
+ Dwarf_CU_Context de_cu_context;
339
+ /* Points to linked list of CU Contexts for the CU's already read.
340
+ These are only CU's read by dwarf_next_cu_header(). */
341
+ Dwarf_CU_Context de_cu_context_list;
342
+ /* Points to the last CU Context added to the list by
343
+ dwarf_next_cu_header(). */
344
+ Dwarf_CU_Context de_cu_context_list_end;
345
+ /* This is the list of CU contexts read for dwarf_offdie(). These
346
+ may read ahead of dwarf_next_cu_header(). */
347
+ Dwarf_CU_Context de_offdie_cu_context;
348
+ Dwarf_CU_Context de_offdie_cu_context_end;
349
+
350
+ /* Offset of last byte of last CU read.
351
+ Actually one-past that last byte. So
352
+ use care and compare as offset >= de_last_offset
353
+ to know if offset is too big. */
354
+ Dwarf_Unsigned de_last_offset;
355
+ /* de_last_di_info_ptr and de_last_die are used with
356
+ dwarf_siblingof, dwarf_child, and dwarf_validate_die_sibling.
357
+ dwarf_validate_die_sibling will not give meaningful results
358
+ if called inappropriately. */
359
+ Dwarf_Byte_Ptr de_last_di_ptr;
360
+ Dwarf_Die de_last_die;
361
+ };
362
+ typedef struct Dwarf_Debug_InfoTypes_s *Dwarf_Debug_InfoTypes;
363
+
364
+ /* As the tasks performed on a debug related section is the same,
365
+ in order to make the process of adding a new section (very unlikely) a
366
+ little bit easy and to reduce the possibility of errors, a simple table
367
+ build dynamically, will contain the relevant information.
368
+ */
369
+
370
+ struct Dwarf_dbg_sect_s {
371
+ /* Debug section name must not be freed, is quoted string. */
372
+ const char *ds_name;
373
+ /* Debug section information, points to de_debug_*member
374
+ (or the like) of the dbg struct. */
375
+ struct Dwarf_Section_s *ds_secdata;
376
+
377
+ int ds_duperr; /* Error code for duplicated section */
378
+ int ds_emptyerr; /* Error code for empty section */
379
+ int ds_have_dwarf; /* Section contains DWARF */
380
+ };
381
+
382
+ /* As the number of debug sections does not change very often, in the case a
383
+ new section is added in 'enter_section_in_array()'
384
+ the 'MAX_DEBUG_SECTIONS' must
385
+ be updated accordingly.
386
+ This does not yet allow for section-groups in object files,
387
+ for which many .debug_info (and other) sections may exist.
388
+ */
389
+ #define DWARF_MAX_DEBUG_SECTIONS 30
390
+
391
+
392
+
393
+ /* These offsets and sizes (Dwarf_Fission*) are
394
+ for the DebugFission DWP sections
395
+ .debug_cu_index and .debug_tu_index.
396
+ Because the sections in the .dwp contain
397
+ unrelocated .dwo sections. The offsets
398
+ taken from the .dwo sections
399
+ need the dfs_offset applied to
400
+ find the applicable data correctly.
401
+
402
+ When a .dwp is not involved (ie, when
403
+ there is no .debug_cu_index or .debug_tu_index
404
+ section) then the dfo_version field
405
+ in Dwarf_Fission_Offsets_s will be zero.
406
+ */
407
+ struct Dwarf_Fission_Section_Offset_s {
408
+ Dwarf_Unsigned dfs_offset;
409
+ Dwarf_Unsigned dfs_size;
410
+ };
411
+
412
+ struct Dwarf_Fission_Per_CU_s {
413
+ /* dfp_index is the number of the compilation unit
414
+ in the .debug_info.dwo or
415
+ .debug_types.dwo(DWARF4 only) sections.
416
+ Index starts at 0.
417
+ May not match the location in
418
+ dfo_per_cu array of Dwarf_Fission_Per_CU_s. */
419
+ unsigned dfp_index;
420
+
421
+ /* Called a signature in most places. */
422
+ Dwarf_Sig8 dfp_hash;
423
+
424
+ /* 0 unused, 1-8 are indexed by DW_SECT* */
425
+ struct Dwarf_Fission_Section_Offset_s dfp_offsets[DW_FISSION_SECT_COUNT];
426
+ };
427
+
428
+
429
+ /* If dfo_version is 0 the struct is empty/unused.
430
+ and then all the other fields are 0.
431
+ If dfo_version is zero this is not a
432
+ DWP (.dwp) object file. */
433
+ struct Dwarf_Fission_Offsets_s {
434
+ unsigned dfo_version; /* 2 is the only supported value.
435
+ defaults to zero meaning 'none'. */
436
+
437
+ /* pointer to "cu" or "tu", never free
438
+ the string.
439
+ type refers to the index type
440
+ 'cu'referring to lookups of DW_AT_dwo_id
441
+ .debug_cu_index
442
+ which is an 8 byte hash.
443
+ We use Dwarf_Sig8.
444
+ 'tu' referring to lookups of DW_FORM_ref_sig8 (type unit hash)
445
+ .debug_tu_index
446
+ We use Dwarf_Sig8 here too.
447
+ tu does NOT refer to .debug_types in a DWARF5 object.
448
+ */
449
+ const char * dfo_type;
450
+ Dwarf_Bool dfo_is_info; /* TRUE if the section is
451
+ DWARF4 .debug_types for a "tu" . Else False. */
452
+ Dwarf_Bool dfo_is_type_unit; /* TRUE if this is
453
+ a type unit. DW_TAG_type_unit. */
454
+
455
+ Dwarf_Unsigned dfo_columns;
456
+ Dwarf_Unsigned dfo_entries;
457
+ Dwarf_Unsigned dfo_slots;
458
+
459
+ /* Pointer to array of dfo_entries structs. */
460
+ struct Dwarf_Fission_Per_CU_s *dfo_per_cu;
461
+
462
+ /* Hash table enables finding the index of
463
+ into dfo_per_cu given a signature.
464
+ Data for tsearch functions.
465
+ Initially, just using sequential search.
466
+ is tsearch needed here?
467
+ void * dfo_hash_to_index; */
468
+ };
469
+
470
+ /* All the Dwarf_Debug tied-file info in one place. */
471
+ struct Dwarf_Tied_Data_s {
472
+ /* Used to access executable from .dwo or .dwp object.
473
+ Pointer to the tied_to Dwarf_Debug*/
474
+ Dwarf_Debug td_tied_object;
475
+
476
+ /* TRUE if this object is tied to.
477
+ It's extra work to look for a DW_AT_dwo_id.
478
+ This helps us do it only when it may be productive. */
479
+ Dwarf_Bool td_is_tied_object;
480
+
481
+ /* If non-zero is a dwarf_tsearch 'tree'.
482
+ Only non-zero if td_is_tied_object is set and
483
+ we had a reason to build the search tree..
484
+
485
+ The Key for each record is a Dwarf_Sig8
486
+ (8 bytes).
487
+ The data for each is a pointer to a Dwarf_CU_context
488
+ record in this dbg (cu_context in
489
+ one of this dbg's de_cu_context_list). */
490
+ void *td_tied_search;
491
+
492
+ };
493
+
494
+ struct Dwarf_Debug_s {
495
+ /* All file access methods and support data
496
+ are hidden in this structure.
497
+ We get a pointer, callers control the lifetime of the
498
+ structure and contents. */
499
+ struct Dwarf_Obj_Access_Interface_s *de_obj_file;
500
+
501
+ Dwarf_Handler de_errhand;
502
+ Dwarf_Ptr de_errarg;
503
+
504
+ struct Dwarf_Debug_InfoTypes_s de_info_reading;
505
+ struct Dwarf_Debug_InfoTypes_s de_types_reading;
506
+
507
+ /* Number of bytes in the length, and offset field in various
508
+ .debug_* sections. It's not very meaningful, and is
509
+ only used in one 'approximate' calculation.
510
+ de_offset_size would be a more appropos name. */
511
+ Dwarf_Small de_length_size;
512
+
513
+ /* number of bytes in a pointer of the target in various .debug_
514
+ sections. 4 in 32bit, 8 in MIPS 64, ia64. */
515
+ Dwarf_Small de_pointer_size;
516
+
517
+ /* set at creation of a Dwarf_Debug to say if form_string should be
518
+ checked for valid length at every call. 0 means do the check.
519
+ non-zero means do not do the check. */
520
+ Dwarf_Small de_assume_string_in_bounds;
521
+
522
+ /* Keep track of allocations so a dwarf_finish call can clean up.
523
+ Null till a tree is created */
524
+ void * de_alloc_tree;
525
+
526
+ /* These fields are used to process debug_frame section. **Updated
527
+ by dwarf_get_fde_list in dwarf_frame.h */
528
+ /* Points to contiguous block of pointers to Dwarf_Cie_s structs. */
529
+ Dwarf_Cie *de_cie_data;
530
+ /* Count of number of Dwarf_Cie_s structs. */
531
+ Dwarf_Signed de_cie_count;
532
+ /* Keep eh (GNU) separate!. */
533
+ Dwarf_Cie *de_cie_data_eh;
534
+ Dwarf_Signed de_cie_count_eh;
535
+ /* Points to contiguous block of pointers to Dwarf_Fde_s structs. */
536
+ Dwarf_Fde *de_fde_data;
537
+ /* Count of number of Dwarf_Fde_s structs. */
538
+ Dwarf_Unsigned de_fde_count;
539
+ /* Keep eh (GNU) separate!. */
540
+ Dwarf_Fde *de_fde_data_eh;
541
+ Dwarf_Unsigned de_fde_count_eh;
542
+
543
+ struct Dwarf_Section_s de_debug_info;
544
+ struct Dwarf_Section_s de_debug_types;
545
+ struct Dwarf_Section_s de_debug_abbrev;
546
+ struct Dwarf_Section_s de_debug_line;
547
+ struct Dwarf_Section_s de_debug_line_str; /* New in DWARF5 */
548
+ struct Dwarf_Section_s de_debug_loc;
549
+ struct Dwarf_Section_s de_debug_aranges;
550
+ struct Dwarf_Section_s de_debug_macinfo;
551
+ struct Dwarf_Section_s de_debug_macro; /* New in DWARF5 */
552
+ struct Dwarf_Section_s de_debug_names; /* New in DWARF5 */
553
+ struct Dwarf_Section_s de_debug_pubnames;
554
+ struct Dwarf_Section_s de_debug_str;
555
+ struct Dwarf_Section_s de_debug_sup; /* New in DWARF5 */
556
+ struct Dwarf_Section_s de_debug_frame;
557
+
558
+ /* gnu: the g++ eh_frame section */
559
+ struct Dwarf_Section_s de_debug_frame_eh_gnu;
560
+
561
+ struct Dwarf_Section_s de_debug_pubtypes; /* DWARF3 .debug_pubtypes */
562
+
563
+ struct Dwarf_Section_s de_debug_funcnames;
564
+
565
+ /* SGI IRIX extension essentially
566
+ identical to DWARF3 .debug_pubtypes. */
567
+ struct Dwarf_Section_s de_debug_typenames;
568
+ struct Dwarf_Section_s de_debug_varnames; /* SGI IRIX only. */
569
+ struct Dwarf_Section_s de_debug_weaknames; /* SGI IRIX only. */
570
+
571
+ struct Dwarf_Section_s de_debug_ranges;
572
+ /* Following two part of DebugFission. */
573
+ struct Dwarf_Section_s de_debug_str_offsets;
574
+ struct Dwarf_Section_s de_debug_addr;
575
+
576
+
577
+ /* Following for the .gdb_index section. */
578
+ struct Dwarf_Section_s de_debug_gdbindex;
579
+
580
+ /* Types in DWARF5 are in .debug_info
581
+ and in DWARF4 are in .debug_types.
582
+ These indexes first standardized in DWARF5,
583
+ DWARF4 can have them as an extension.
584
+ The next to refer to the DWP index sections and the
585
+ tu and cu indexes sections are distinct in DWARF4 & 5. */
586
+ struct Dwarf_Section_s de_debug_cu_index;
587
+ struct Dwarf_Section_s de_debug_tu_index;
588
+
589
+ /* For non-elf, simply leave the following two structs zeroed and
590
+ they will be ignored. */
591
+ struct Dwarf_Section_s de_elf_symtab;
592
+ struct Dwarf_Section_s de_elf_strtab;
593
+
594
+ /* For a .dwp object file .
595
+ For DWARF4, type units are in .debug_types
596
+ (DWP is a GNU extension in DW4)..
597
+ For DWARF5, type units are in .debug_info.
598
+ */
599
+ Dwarf_Xu_Index_Header de_cu_hashindex_data;
600
+ Dwarf_Xu_Index_Header de_tu_hashindex_data;
601
+
602
+ void *(*de_copy_word) (void *, const void *, size_t);
603
+ unsigned char de_same_endian;
604
+ unsigned char de_elf_must_close; /* If non-zero, then
605
+ it was dwarf_init (not dwarf_elf_init)
606
+ so must elf_end() */
607
+
608
+ /* Default is DW_FRAME_INITIAL_VALUE from header. */
609
+ Dwarf_Half de_frame_rule_initial_value;
610
+
611
+ /* Default is DW_FRAME_LAST_REG_NUM. */
612
+ Dwarf_Half de_frame_reg_rules_entry_count;
613
+
614
+ Dwarf_Half de_frame_cfa_col_number;
615
+ Dwarf_Half de_frame_same_value_number;
616
+ Dwarf_Half de_frame_undefined_value_number;
617
+
618
+ unsigned char de_big_endian_object; /* Non-zero if big-endian
619
+ object opened. */
620
+
621
+ struct Dwarf_dbg_sect_s de_debug_sections[DWARF_MAX_DEBUG_SECTIONS];
622
+ unsigned de_debug_sections_total_entries; /* Number actually used. */
623
+
624
+ struct Dwarf_Harmless_s de_harmless_errors;
625
+
626
+ struct Dwarf_Printf_Callback_Info_s de_printf_callback;
627
+
628
+ struct Dwarf_Tied_Data_s de_tied_data;
629
+
630
+ };
631
+
632
+ int dwarf_printf(Dwarf_Debug dbg, const char * format, ...)
633
+ #ifdef __GNUC__ /* The following gets us printf-like arg checking. */
634
+ __attribute__ ((format (__printf__, 2, 3)))
635
+ #endif
636
+ ;
637
+
638
+ typedef struct Dwarf_Chain_s *Dwarf_Chain;
639
+ struct Dwarf_Chain_s {
640
+ void *ch_item;
641
+ Dwarf_Chain ch_next;
642
+ };
643
+
644
+ /* Size of cu header version stamp field. */
645
+ #define CU_VERSION_STAMP_SIZE sizeof(Dwarf_Half)
646
+
647
+ /* Size of cu header address size field. */
648
+ #define CU_ADDRESS_SIZE_SIZE sizeof(Dwarf_Small)
649
+
650
+ void *_dwarf_memcpy_swap_bytes(void *s1, const void *s2, size_t len);
651
+
652
+ #define ORIGINAL_DWARF_OFFSET_SIZE 4
653
+ #define DISTINGUISHED_VALUE 0xffffffff
654
+ #define DISTINGUISHED_VALUE_OFFSET_SIZE 8
655
+
656
+ /* We don't load the sections until they are needed. This function is
657
+ used to load the section. */
658
+ int _dwarf_load_section(Dwarf_Debug,
659
+ struct Dwarf_Section_s *,
660
+ Dwarf_Error *);
661
+
662
+
663
+ int _dwarf_get_string_base_attr_value(Dwarf_Debug dbg,
664
+ Dwarf_CU_Context context,
665
+ Dwarf_Unsigned *sbase_out,
666
+ Dwarf_Error *error);
667
+
668
+ int _dwarf_exract_string_offset_via_str_offsets(Dwarf_Debug dbg,
669
+ Dwarf_Small *info_data_ptr,
670
+ Dwarf_Half attrnum,
671
+ Dwarf_Half attrform,
672
+ Dwarf_CU_Context cu_context,
673
+ Dwarf_Unsigned *str_sect_offset_out,
674
+ Dwarf_Error *error);
675
+
676
+
677
+ int _dwarf_extract_address_from_debug_addr(Dwarf_Debug dbg,
678
+ Dwarf_CU_Context context,
679
+ Dwarf_Unsigned index,
680
+ Dwarf_Addr *addr_out,
681
+ Dwarf_Error *error);
682
+
683
+ int _dwarf_extract_string_offset_via_str_offsets(Dwarf_Debug dbg,
684
+ Dwarf_Small *info_data_ptr,
685
+ Dwarf_Half attrnum,
686
+ Dwarf_Half attrform,
687
+ Dwarf_CU_Context cu_context,
688
+ Dwarf_Unsigned *str_sect_offset_out,
689
+ Dwarf_Error *error);
690
+
691
+ int _dwarf_get_base_and_size_given_signature(Dwarf_CU_Context *context,
692
+ Dwarf_Sig8 *signature_in,
693
+ /* xu_sect_index means DW_SECT_info etc. */
694
+ Dwarf_Unsigned xu_sect_index,
695
+ Dwarf_Unsigned *base_out,
696
+ Dwarf_Unsigned *size_out,
697
+ Dwarf_Error *err);
698
+
699
+ Dwarf_Bool _dwarf_file_has_debug_fission_cu_index(Dwarf_Debug dbg);
700
+ Dwarf_Bool _dwarf_file_has_debug_fission_tu_index(Dwarf_Debug dbg);
701
+ Dwarf_Bool _dwarf_file_has_debug_fission_index(Dwarf_Debug dbg);
702
+
703
+ /* This should only be called on a CU. Never a TU. */
704
+ int _dwarf_get_debugfission_for_offset(Dwarf_Debug dbg,
705
+ Dwarf_Off offset_wanted,
706
+ Dwarf_Debug_Fission_Per_CU * percu_out,
707
+ Dwarf_Error *error);
708
+
709
+ /* whichone: must be a valid DW_SECT* macro value. */
710
+ Dwarf_Unsigned _dwarf_get_dwp_extra_offset(
711
+ struct Dwarf_Debug_Fission_Per_CU_s* dwp,
712
+ unsigned whichone, Dwarf_Unsigned * size);
713
+
714
+ /* This will look into the tied Dwarf_Debug
715
+ to which should have a skeleton CU DIE
716
+ and an addr_base and also have the .debug_addr
717
+ section. */
718
+
719
+ int _dwarf_get_addr_from_tied(Dwarf_Debug dbg,
720
+ Dwarf_CU_Context context,
721
+ Dwarf_Unsigned addrindex,
722
+ Dwarf_Addr *addr_out,
723
+ Dwarf_Error *error);
724
+
725
+
726
+ int _dwarf_get_fission_addition_die(Dwarf_Die die, int dw_sect_index,
727
+ Dwarf_Unsigned* offset, Dwarf_Unsigned*size,
728
+ Dwarf_Error *error);
729
+
730
+ int _dwarf_get_addr_index_itself(int theform,
731
+ Dwarf_Small *info_ptr,
732
+ Dwarf_Unsigned *val_out,
733
+ Dwarf_Error * error);
734
+
735
+ int
736
+ _dwarf_search_for_signature(Dwarf_Debug dbg,
737
+ Dwarf_Sig8 sig,
738
+ Dwarf_CU_Context *context_out,
739
+ Dwarf_Error *error);
740
+
741
+
742
+ void _dwarf_tied_destroy_free_node(void *node);
743
+
744
+ int
745
+ _dwarf_next_cu_header_internal(Dwarf_Debug dbg,
746
+ Dwarf_Bool is_info,
747
+ Dwarf_Unsigned * cu_header_length,
748
+ Dwarf_Half * version_stamp,
749
+ Dwarf_Unsigned * abbrev_offset,
750
+ Dwarf_Half * address_size,
751
+ Dwarf_Half * offset_size,
752
+ Dwarf_Half * extension_size,
753
+ Dwarf_Sig8 * signature,
754
+ Dwarf_Bool * has_signature,
755
+ Dwarf_Unsigned *typeoffset,
756
+ Dwarf_Unsigned * next_cu_offset,
757
+ Dwarf_Half * header_cu_type,
758
+ Dwarf_Error * error);
759
+
760
+ /* Relates to .debug_addr */
761
+ int _dwarf_look_in_local_and_tied(Dwarf_Half attr_form,
762
+ Dwarf_CU_Context context,
763
+ Dwarf_Small *info_ptr,
764
+ Dwarf_Addr *return_addr,
765
+ Dwarf_Error *error);
766
+
767
+ int _dwarf_get_ranges_base_attr_from_tied(Dwarf_Debug dbg,
768
+ Dwarf_CU_Context context,
769
+ Dwarf_Unsigned * ranges_base_out,
770
+ Dwarf_Error * error);
771
+
772
+ int _dwarf_get_string_from_tied(Dwarf_Debug dbg, Dwarf_Unsigned offset,
773
+ char **return_str, Dwarf_Error*error);
774
+
775
+ Dwarf_Byte_Ptr _dwarf_calculate_section_end_ptr(Dwarf_CU_Context context);
776
+
777
+ void _dwarf_dumpsig(const char *msg, Dwarf_Sig8 *sig,int lineno);
778
+