1 /*-
2  * Copyright (c) 2007 John Birrell (jb@freebsd.org)
3  * Copyright (c) 2009-2011,2014 Kai Wang
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  *
27  * $Id: libdwarf.h 3578 2017-09-14 02:21:28Z emaste $
28  */
29 
30 #ifndef	_LIBDWARF_H_
31 #define	_LIBDWARF_H_
32 
33 #include <libelf.h>
34 
35 typedef int		Dwarf_Bool;
36 typedef uint64_t	Dwarf_Off;
37 typedef uint64_t	Dwarf_Unsigned;
38 typedef uint16_t	Dwarf_Half;
39 typedef uint8_t		Dwarf_Small;
40 typedef int64_t		Dwarf_Signed;
41 typedef uint64_t	Dwarf_Addr;
42 typedef void		*Dwarf_Ptr;
43 
44 typedef struct _Dwarf_Abbrev	*Dwarf_Abbrev;
45 typedef struct _Dwarf_Arange	*Dwarf_Arange;
46 typedef struct _Dwarf_ArangeSet	*Dwarf_ArangeSet;
47 typedef struct _Dwarf_Attribute	*Dwarf_Attribute;
48 typedef struct _Dwarf_Attribute *Dwarf_P_Attribute;
49 typedef struct _Dwarf_AttrDef	*Dwarf_AttrDef;
50 typedef struct _Dwarf_Cie	*Dwarf_Cie;
51 typedef struct _Dwarf_Cie	*Dwarf_P_Cie;
52 typedef struct _Dwarf_Debug	*Dwarf_Debug;
53 typedef struct _Dwarf_Debug	*Dwarf_P_Debug;
54 typedef struct _Dwarf_Die	*Dwarf_Die;
55 typedef struct _Dwarf_Die	*Dwarf_P_Die;
56 typedef struct _Dwarf_Fde	*Dwarf_Fde;
57 typedef struct _Dwarf_Fde	*Dwarf_P_Fde;
58 typedef struct _Dwarf_FrameSec	*Dwarf_FrameSec;
59 typedef struct _Dwarf_Line	*Dwarf_Line;
60 typedef struct _Dwarf_LineFile	*Dwarf_LineFile;
61 typedef struct _Dwarf_LineInfo	*Dwarf_LineInfo;
62 typedef struct _Dwarf_MacroSet	*Dwarf_MacroSet;
63 typedef struct _Dwarf_NamePair	*Dwarf_NamePair;
64 typedef struct _Dwarf_NamePair	*Dwarf_Func;
65 typedef struct _Dwarf_NamePair	*Dwarf_Global;
66 typedef struct _Dwarf_NamePair	*Dwarf_Type;
67 typedef struct _Dwarf_NamePair	*Dwarf_Var;
68 typedef struct _Dwarf_NamePair	*Dwarf_Weak;
69 typedef struct _Dwarf_NameTbl	*Dwarf_NameTbl;
70 typedef struct _Dwarf_NameSec	*Dwarf_NameSec;
71 typedef struct _Dwarf_P_Expr	*Dwarf_P_Expr;
72 typedef struct _Dwarf_Rangelist	*Dwarf_Rangelist;
73 
74 typedef enum {
75 	DW_OBJECT_MSB,
76 	DW_OBJECT_LSB
77 } Dwarf_Endianness;
78 
79 typedef struct {
80 	Dwarf_Addr addr;
81 	Dwarf_Unsigned size;
82 	const char *name;
83 } Dwarf_Obj_Access_Section;
84 
85 typedef struct {
86 	int (*get_section_info)(void *_obj, Dwarf_Half _index,
87 	    Dwarf_Obj_Access_Section *_ret_section, int *_error);
88 	Dwarf_Endianness (*get_byte_order)(void *_obj);
89 	Dwarf_Small (*get_length_size)(void *_obj);
90 	Dwarf_Small (*get_pointer_size)(void *_obj);
91 	Dwarf_Unsigned (*get_section_count)(void *_obj);
92 	int (*load_section)(void *_obj, Dwarf_Half _index,
93 	    Dwarf_Small **_ret_data, int *_error);
94 } Dwarf_Obj_Access_Methods;
95 
96 typedef struct {
97 	void *object;
98 	const Dwarf_Obj_Access_Methods *methods;
99 } Dwarf_Obj_Access_Interface;
100 
101 typedef int (*Dwarf_Callback_Func)(char *_name, int _size,
102     Dwarf_Unsigned _type, Dwarf_Unsigned _flags, Dwarf_Unsigned _link,
103     Dwarf_Unsigned _info, int *_index, int *_error);
104 
105 typedef int (*Dwarf_Callback_Func_b)(char *_name, int _size,
106     Dwarf_Unsigned _type, Dwarf_Unsigned _flags, Dwarf_Unsigned _link,
107     Dwarf_Unsigned _info, Dwarf_Unsigned *_index, int *_error);
108 
109 typedef Dwarf_Unsigned Dwarf_Tag;
110 
111 typedef struct {
112         Dwarf_Small	lr_atom;
113         Dwarf_Unsigned	lr_number;
114 	Dwarf_Unsigned	lr_number2;
115 	Dwarf_Unsigned	lr_offset;
116 } Dwarf_Loc;
117 
118 typedef struct {
119 	Dwarf_Addr      ld_lopc;
120 	Dwarf_Addr      ld_hipc;
121 	Dwarf_Half      ld_cents;
122 	Dwarf_Loc	*ld_s;
123 } Dwarf_Locdesc;
124 
125 typedef struct {
126 	char signature[8];
127 } Dwarf_Sig8;
128 
129 typedef struct {
130 	Dwarf_Unsigned	bl_len;
131 	Dwarf_Ptr	bl_data;
132 } Dwarf_Block;
133 
134 enum Dwarf_Ranges_Entry_Type {
135 	DW_RANGES_ENTRY,
136 	DW_RANGES_ADDRESS_SELECTION,
137 	DW_RANGES_END
138 };
139 
140 typedef struct {
141 	Dwarf_Unsigned	dwr_addr1;
142 	Dwarf_Unsigned	dwr_addr2;
143 	enum Dwarf_Ranges_Entry_Type dwr_type;
144 } Dwarf_Ranges;
145 
146 enum Dwarf_Form_Class {
147 	DW_FORM_CLASS_UNKNOWN,
148 	DW_FORM_CLASS_ADDRESS,
149 	DW_FORM_CLASS_BLOCK,
150 	DW_FORM_CLASS_CONSTANT,
151 	DW_FORM_CLASS_EXPRLOC,
152 	DW_FORM_CLASS_FLAG,
153 	DW_FORM_CLASS_LINEPTR,
154 	DW_FORM_CLASS_LOCLISTPTR,
155 	DW_FORM_CLASS_MACPTR,
156 	DW_FORM_CLASS_RANGELISTPTR,
157 	DW_FORM_CLASS_REFERENCE,
158 	DW_FORM_CLASS_STRING
159 };
160 
161 #ifndef	DW_FRAME_HIGHEST_NORMAL_REGISTER
162 #define	DW_FRAME_HIGHEST_NORMAL_REGISTER 63
163 #endif
164 
165 #define	DW_FRAME_RA_COL		(DW_FRAME_HIGHEST_NORMAL_REGISTER + 1)
166 #define	DW_FRAME_STATIC_LINK	(DW_FRAME_HIGHEST_NORMAL_REGISTER + 2)
167 
168 #ifndef	DW_FRAME_LAST_REG_NUM
169 #define DW_FRAME_LAST_REG_NUM	(DW_FRAME_HIGHEST_NORMAL_REGISTER + 3)
170 #endif
171 
172 #ifndef	DW_FRAME_REG_INITIAL_VALUE
173 #define	DW_FRAME_REG_INITIAL_VALUE DW_FRAME_SAME_VAL
174 #endif
175 
176 #define	DW_FRAME_UNDEFINED_VAL		1034
177 #define DW_FRAME_SAME_VAL		1035
178 #define DW_FRAME_CFA_COL3		1436
179 
180 #define	DW_EXPR_OFFSET 0
181 #define	DW_EXPR_VAL_OFFSET 1
182 #define	DW_EXPR_EXPRESSION 2
183 #define	DW_EXPR_VAL_EXPRESSION 3
184 
185 /*
186  * Frame operation only for DWARF 2.
187  */
188 
189 #define DW_FRAME_CFA_COL 0
190 
191 typedef struct {
192 	Dwarf_Small	fp_base_op;
193 	Dwarf_Small	fp_extended_op;
194 	Dwarf_Half	fp_register;
195 	Dwarf_Signed	fp_offset;
196 	Dwarf_Off	fp_instr_offset;
197 } Dwarf_Frame_Op;
198 
199 #ifndef	DW_REG_TABLE_SIZE
200 #define	DW_REG_TABLE_SIZE	66
201 #endif
202 
203 typedef struct {
204 	struct {
205 		Dwarf_Small	dw_offset_relevant;
206 		Dwarf_Half	dw_regnum;
207 		Dwarf_Addr	dw_offset;
208 	} rules[DW_REG_TABLE_SIZE];
209 } Dwarf_Regtable;
210 
211 /*
212  * Frame operation for DWARF 3 and DWARF 2.
213  */
214 
215 typedef struct {
216 	Dwarf_Small	fp_base_op;
217 	Dwarf_Small	fp_extended_op;
218 	Dwarf_Half	fp_register;
219 	Dwarf_Unsigned	fp_offset_or_block_len;
220 	Dwarf_Small	*fp_expr_block;
221 	Dwarf_Off	fp_instr_offset;
222 } Dwarf_Frame_Op3;
223 
224 typedef struct {
225 	Dwarf_Small	dw_offset_relevant;
226 	Dwarf_Small	dw_value_type;
227 	Dwarf_Half	dw_regnum;
228 	Dwarf_Unsigned	dw_offset_or_block_len;
229 	Dwarf_Ptr	dw_block_ptr;
230 } Dwarf_Regtable_Entry3;
231 
232 typedef struct {
233 	Dwarf_Regtable_Entry3	rt3_cfa_rule;
234 	Dwarf_Half		rt3_reg_table_size;
235 	Dwarf_Regtable_Entry3	*rt3_rules;
236 } Dwarf_Regtable3;
237 
238 typedef struct {
239 	Dwarf_Off	dmd_offset;
240 	Dwarf_Small	dmd_type;
241 	Dwarf_Signed	dmd_lineno;
242 	Dwarf_Signed	dmd_fileindex;
243 	char		*dmd_macro;
244 } Dwarf_Macro_Details;
245 
246 /*
247  * Symbols denoting allocation types, for use with dwarf_dealloc(3).
248  */
249 
250 enum Dwarf_Allocation_Type {
251 	DW_DLA_ABBREV,
252 	DW_DLA_ADDR,
253 	DW_DLA_ARANGE,
254 	DW_DLA_ATTR,
255 	DW_DLA_BLOCK,
256 	DW_DLA_BOUNDS,
257 	DW_DLA_CIE,
258 	DW_DLA_DEBUG,
259 	DW_DLA_DIE,
260 	DW_DLA_ELLIST,
261 	DW_DLA_ERROR,
262 	DW_DLA_FDE,
263 	DW_DLA_FRAME_BLOCK,
264 	DW_DLA_FRAME_OP,
265 	DW_DLA_FUNC,
266 	DW_DLA_GLOBAL,
267 	DW_DLA_LINE,
268 	DW_DLA_LINEBUF,
269 	DW_DLA_LIST,
270 	DW_DLA_LOC,
271 	DW_DLA_LOCDESC,
272 	DW_DLA_LOC_BLOCK,
273 	DW_DLA_RANGES,
274 	DW_DLA_STRING,
275 	DW_DLA_SUBSCR,
276 	DW_DLA_TYPE,
277 	DW_DLA_TYPENAME,
278 	DW_DLA_VAR,
279 	DW_DLA_WEAK
280 };
281 
282 /*
283  * Relocation Type.
284  */
285 enum Dwarf_Rel_Type {
286 	dwarf_drt_none = 0,
287 	dwarf_drt_data_reloc,
288 	dwarf_drt_segment_rel,
289 	dwarf_drt_first_of_length_pair,
290 	dwarf_drt_second_of_length_pair
291 };
292 
293 /*
294  * Relocation Entry.
295  */
296 typedef struct Dwarf_Relocation_Data_s {
297 	unsigned char drd_type;
298 	unsigned char drd_length;
299 	Dwarf_Unsigned drd_offset;
300 	Dwarf_Unsigned drd_symbol_index;
301 } *Dwarf_Relocation_Data;
302 
303 #define	DWARF_DRD_BUFFER_VERSION	2
304 
305 /*
306  * Error numbers which are specific to this implementation.
307  */
308 enum {
309 	DW_DLE_NONE,			/* No error. */
310 	DW_DLE_ERROR,			/* An error! */
311 	DW_DLE_ARGUMENT,		/* Invalid argument. */
312 	DW_DLE_DEBUG_INFO_NULL,		/* Debug info NULL. */
313 	DW_DLE_NO_ENTRY,		/* No entry. */
314 	DW_DLE_MEMORY,			/* Insufficient memory. */
315 	DW_DLE_ELF,			/* ELF error. */
316 	DW_DLE_CU_LENGTH_ERROR,		/* Invalid compilation unit data. */
317 	DW_DLE_VERSION_STAMP_ERROR,	/* Invalid version. */
318 	DW_DLE_DEBUG_ABBREV_NULL,	/* Abbrev not found. */
319 	DW_DLE_DIE_NO_CU_CONTEXT,	/* No current compilation unit. */
320 	DW_DLE_LOC_EXPR_BAD,		/* Invalid location expression. */
321 	DW_DLE_EXPR_LENGTH_BAD,		/* Invalid DWARF expression. */
322 	DW_DLE_DEBUG_LOC_SECTION_SHORT,	/* Loclist section too short. */
323 	DW_DLE_ATTR_FORM_BAD,		/* Invalid attribute form. */
324 	DW_DLE_DEBUG_LINE_LENGTH_BAD,	/* Line info section too short. */
325 	DW_DLE_LINE_FILE_NUM_BAD,	/* Invalid file number. */
326 	DW_DLE_DIR_INDEX_BAD,		/* Invalid dir index. */
327 	DW_DLE_DEBUG_FRAME_LENGTH_BAD,	/* Frame section too short. */
328 	DW_DLE_NO_CIE_FOR_FDE,		/* CIE not found for certain FDE. */
329 	DW_DLE_FRAME_AUGMENTATION_UNKNOWN, /* Unknown CIE augmentation. */
330 	DW_DLE_FRAME_INSTR_EXEC_ERROR,	/* Frame instruction exec error. */
331 	DW_DLE_FRAME_VERSION_BAD,	/* Invalid frame section version. */
332 	DW_DLE_FRAME_TABLE_COL_BAD,	/* Invalid table column. */
333 	DW_DLE_DF_REG_NUM_TOO_HIGH,	/* Insufficient regtable space. */
334 	DW_DLE_PC_NOT_IN_FDE_RANGE,	/* PC requested not in the FDE range. */
335 	DW_DLE_ARANGE_OFFSET_BAD,	/* Invalid arange offset. */
336 	DW_DLE_DEBUG_MACRO_INCONSISTENT,/* Invalid macinfo data. */
337 	DW_DLE_ELF_SECT_ERR,		/* Application callback failed. */
338 	DW_DLE_COMPRESSION,		/* Section decompression error. */
339 	DW_DLE_NUM			/* Max error number. */
340 };
341 
342 /*
343  * Mapping of SGI libdwarf error codes for comptibility.
344  */
345 #define	DW_DLE_DBG_ALLOC			DW_DLE_MEMORY
346 #define	DW_DLE_ALLOC_FAIL			DW_DLE_MEMORY
347 #define	DW_DLE_SECT_ALLOC			DW_DLE_MEMORY
348 #define	DW_DLE_FILE_ENTRY_ALLOC			DW_DLE_MEMORY
349 #define	DW_DLE_LINE_ALLOC			DW_DLE_MEMORY
350 #define	DW_DLE_FPGM_ALLOC			DW_DLE_MEMORY
351 #define	DW_DLE_INCDIR_ALLOC			DW_DLE_MEMORY
352 #define	DW_DLE_STRING_ALLOC			DW_DLE_MEMORY
353 #define	DW_DLE_CHUNK_ALLOC			DW_DLE_MEMORY
354 #define	DW_DLE_CIE_ALLOC			DW_DLE_MEMORY
355 #define	DW_DLE_FDE_ALLOC			DW_DLE_MEMORY
356 #define	DW_DLE_CIE_OFFS_ALLOC			DW_DLE_MEMORY
357 #define	DW_DLE_DIE_ALLOC			DW_DLE_MEMORY
358 #define	DW_DLE_ATTR_ALLOC			DW_DLE_MEMORY
359 #define	DW_DLE_ABBREV_ALLOC			DW_DLE_MEMORY
360 #define	DW_DLE_ADDR_ALLOC			DW_DLE_MEMORY
361 #define	DW_DLE_REL_ALLOC			DW_DLE_MEMORY
362 #define	DW_DLE_MACINFO_MALLOC_FAIL		DW_DLE_MEMORY
363 #define	DW_DLE_DEBUG_MACRO_MALLOC_SPACE		DW_DLE_MEMORY
364 #define	DW_DLE_DF_ALLOC_FAIL			DW_DLE_MEMORY
365 #define	DW_DLE_RELOC_SECTION_MALLOC_FAIL	DW_DLE_MEMORY
366 #define	DW_DLE_DBG_NULL				DW_DLE_ARGUMENT
367 #define	DW_DLE_DIE_NULL				DW_DLE_ARGUMENT
368 #define	DW_DLE_FDE_NULL				DW_DLE_ARGUMENT
369 #define	DW_DLE_CIE_NULL				DW_DLE_ARGUMENT
370 #define	DW_DLE_ATTR_NULL			DW_DLE_ARGUMENT
371 #define	DW_DLE_GLOBAL_NULL			DW_DLE_ARGUMENT
372 #define	DW_DLE_ARANGES_NULL			DW_DLE_ARGUMENT
373 #define	DW_DLE_ARANGE_NULL			DW_DLE_ARGUMENT
374 #define	DW_DLE_EXPR_NULL			DW_DLE_ARGUMENT
375 #define	DW_DLE_FUNC_NULL			DW_DLE_ARGUMENT
376 #define	DW_DLE_TYPE_NULL			DW_DLE_ARGUMENT
377 #define	DW_DLE_VAR_NULL				DW_DLE_ARGUMENT
378 #define	DW_DLE_WEAK_NULL			DW_DLE_ARGUMENT
379 #define	DW_DLE_ELF_BEGIN_ERROR			DW_DLE_ELF
380 #define	DW_DLE_ELF_GETEHDR_ERROR		DW_DLE_ELF
381 #define	DW_DLE_ELF_GETSHDR_ERROR		DW_DLE_ELF
382 #define	DW_DLE_ELF_STRPTR_ERROR			DW_DLE_ELF
383 #define	DW_DLE_ELF_SECT_ERROR			DW_DLE_ELF
384 #define	DW_DLE_ELF_GETIDENT_ERROR		DW_DLE_ELF
385 
386 typedef struct _Dwarf_Error {
387 	int		err_error;	/* DWARF error. */
388 	int		err_elferror;	/* ELF error. */
389 	const char	*err_func;	/* Function name where error occurred. */
390 	int		err_line;	/* Line number where error occurred. */
391 	char		err_msg[1024];	/* Formatted error message. */
392 } Dwarf_Error;
393 
394 /*
395  * Dwarf error handler.
396  */
397 typedef void (*Dwarf_Handler)(Dwarf_Error, Dwarf_Ptr);
398 
399 #define	dwarf_errno(error)	error.err_error
400 #define	dwarf_errmsg(error)	dwarf_errmsg_(&error)
401 
402 /*
403  * Return values which have to be compatible with other
404  * implementations of libdwarf.
405  */
406 #define DW_DLV_NO_ENTRY		-1
407 #define DW_DLV_OK		0
408 #define	DW_DLV_ERROR		1
409 #define DW_DLV_BADADDR		NULL
410 #define DW_DLV_NOCOUNT		((Dwarf_Signed) -1)
411 
412 /*
413  * Access modes.
414  */
415 #define DW_DLC_READ        	0x0001
416 #define DW_DLC_WRITE		0x0002
417 #define	DW_DLC_RDWR		0x0004
418 
419 /*
420  * Flags used by libdwarf producer.
421  */
422 #define DW_DLC_SIZE_64			0x40000000
423 #define DW_DLC_SIZE_32			0x20000000
424 #define DW_DLC_OFFSET_SIZE_64		0x10000000
425 #define DW_DLC_ISA_MIPS			0x80000000
426 #define DW_DLC_ISA_IA64			0x01000000
427 #define DW_DLC_STREAM_RELOCATIONS	0x02000000
428 #define DW_DLC_SYMBOLIC_RELOCATIONS	0x04000000
429 #define DW_DLC_TARGET_BIGENDIAN		0x08000000
430 #define DW_DLC_TARGET_LITTLEENDIAN	0x00100000
431 
432 /*
433  * Instruction set architectures supported by this implementation.
434  */
435 enum Dwarf_ISA {
436 	DW_ISA_ARM,
437 	DW_ISA_IA64,
438 	DW_ISA_MIPS,
439 	DW_ISA_PPC,
440 	DW_ISA_SPARC,
441 	DW_ISA_X86,
442 	DW_ISA_X86_64,
443 	DW_ISA_AARCH64,
444 	DW_ISA_RISCV,
445 	DW_ISA_MAX
446 };
447 
448 /* Function prototype definitions. */
449 #ifdef __cplusplus
450 extern "C" {
451 #endif
452 Dwarf_P_Attribute dwarf_add_AT_comp_dir(Dwarf_P_Die, char *, Dwarf_Error *);
453 Dwarf_P_Attribute dwarf_add_AT_const_value_signedint(Dwarf_P_Die, Dwarf_Signed,
454 		    Dwarf_Error *);
455 Dwarf_P_Attribute dwarf_add_AT_const_value_string(Dwarf_P_Die, char *,
456 		    Dwarf_Error *);
457 Dwarf_P_Attribute dwarf_add_AT_const_value_unsignedint(Dwarf_P_Die,
458 		    Dwarf_Unsigned, Dwarf_Error *);
459 Dwarf_P_Attribute dwarf_add_AT_dataref(Dwarf_P_Debug, Dwarf_P_Die, Dwarf_Half,
460 		    Dwarf_Unsigned, Dwarf_Unsigned, Dwarf_Error *);
461 Dwarf_P_Attribute dwarf_add_AT_flag(Dwarf_P_Debug, Dwarf_P_Die, Dwarf_Half,
462 		    Dwarf_Small, Dwarf_Error *);
463 Dwarf_P_Attribute dwarf_add_AT_location_expr(Dwarf_P_Debug, Dwarf_P_Die,
464 		    Dwarf_Half, Dwarf_P_Expr, Dwarf_Error *);
465 Dwarf_P_Attribute dwarf_add_AT_name(Dwarf_P_Die, char *, Dwarf_Error *);
466 Dwarf_P_Attribute dwarf_add_AT_producer(Dwarf_P_Die, char *, Dwarf_Error *);
467 Dwarf_P_Attribute dwarf_add_AT_ref_address(Dwarf_P_Debug, Dwarf_P_Die,
468 		    Dwarf_Half, Dwarf_Unsigned, Dwarf_Unsigned, Dwarf_Error *);
469 Dwarf_P_Attribute dwarf_add_AT_reference(Dwarf_P_Debug, Dwarf_P_Die, Dwarf_Half,
470 		    Dwarf_P_Die, Dwarf_Error *);
471 Dwarf_P_Attribute dwarf_add_AT_signed_const(Dwarf_P_Debug, Dwarf_P_Die,
472 		    Dwarf_Half, Dwarf_Signed, Dwarf_Error *);
473 Dwarf_P_Attribute dwarf_add_AT_string(Dwarf_P_Debug, Dwarf_P_Die, Dwarf_Half,
474 		    char *, Dwarf_Error *);
475 Dwarf_P_Attribute dwarf_add_AT_targ_address(Dwarf_P_Debug, Dwarf_P_Die,
476 		    Dwarf_Half, Dwarf_Unsigned, Dwarf_Signed, Dwarf_Error *);
477 Dwarf_P_Attribute dwarf_add_AT_targ_address_b(Dwarf_P_Debug, Dwarf_P_Die,
478 		    Dwarf_Half, Dwarf_Unsigned, Dwarf_Unsigned, Dwarf_Error *);
479 Dwarf_P_Attribute dwarf_add_AT_unsigned_const(Dwarf_P_Debug, Dwarf_P_Die,
480 		    Dwarf_Half, Dwarf_Unsigned, Dwarf_Error *);
481 Dwarf_Unsigned	dwarf_add_arange(Dwarf_P_Debug, Dwarf_Addr, Dwarf_Unsigned,
482 		    Dwarf_Signed, Dwarf_Error *);
483 Dwarf_Unsigned	dwarf_add_arange_b(Dwarf_P_Debug, Dwarf_Addr, Dwarf_Unsigned,
484 		    Dwarf_Unsigned, Dwarf_Unsigned, Dwarf_Addr, Dwarf_Error *);
485 Dwarf_Unsigned	dwarf_add_die_to_debug(Dwarf_P_Debug, Dwarf_P_Die,
486 		    Dwarf_Error *);
487 Dwarf_Unsigned	dwarf_add_directory_decl(Dwarf_P_Debug, char *, Dwarf_Error *);
488 Dwarf_Unsigned	dwarf_add_expr_addr(Dwarf_P_Expr, Dwarf_Unsigned,
489 		    Dwarf_Signed, Dwarf_Error *);
490 Dwarf_Unsigned	dwarf_add_expr_addr_b(Dwarf_P_Expr, Dwarf_Unsigned,
491 		    Dwarf_Unsigned, Dwarf_Error *);
492 Dwarf_Unsigned	dwarf_add_expr_gen(Dwarf_P_Expr, Dwarf_Small, Dwarf_Unsigned,
493 		    Dwarf_Unsigned, Dwarf_Error *);
494 Dwarf_P_Fde	dwarf_add_fde_inst(Dwarf_P_Fde, Dwarf_Small, Dwarf_Unsigned,
495 		    Dwarf_Unsigned, Dwarf_Error *);
496 Dwarf_Unsigned	dwarf_add_file_decl(Dwarf_P_Debug, char *, Dwarf_Unsigned,
497 		    Dwarf_Unsigned, Dwarf_Unsigned, Dwarf_Error *);
498 Dwarf_Unsigned	dwarf_add_frame_cie(Dwarf_P_Debug, char *, Dwarf_Small,
499 		    Dwarf_Small, Dwarf_Small, Dwarf_Ptr, Dwarf_Unsigned,
500 		    Dwarf_Error *);
501 Dwarf_Unsigned	dwarf_add_frame_fde(Dwarf_P_Debug, Dwarf_P_Fde, Dwarf_P_Die,
502 		    Dwarf_Unsigned, Dwarf_Addr, Dwarf_Unsigned, Dwarf_Unsigned,
503 		    Dwarf_Error *);
504 Dwarf_Unsigned	dwarf_add_frame_fde_b(Dwarf_P_Debug, Dwarf_P_Fde, Dwarf_P_Die,
505 		    Dwarf_Unsigned, Dwarf_Addr, Dwarf_Unsigned, Dwarf_Unsigned,
506 		    Dwarf_Unsigned, Dwarf_Addr, Dwarf_Error *);
507 Dwarf_Unsigned	dwarf_add_funcname(Dwarf_P_Debug, Dwarf_P_Die, char *,
508 		    Dwarf_Error *);
509 Dwarf_Unsigned	dwarf_add_line_entry(Dwarf_P_Debug, Dwarf_Unsigned,
510 		    Dwarf_Addr, Dwarf_Unsigned, Dwarf_Signed, Dwarf_Bool,
511 		    Dwarf_Bool, Dwarf_Error *);
512 Dwarf_Unsigned	dwarf_add_pubname(Dwarf_P_Debug, Dwarf_P_Die, char *,
513 		    Dwarf_Error *);
514 Dwarf_Unsigned	dwarf_add_typename(Dwarf_P_Debug, Dwarf_P_Die, char *,
515 		    Dwarf_Error *);
516 Dwarf_Unsigned	dwarf_add_varname(Dwarf_P_Debug, Dwarf_P_Die, char *,
517 		    Dwarf_Error *);
518 Dwarf_Unsigned	dwarf_add_weakname(Dwarf_P_Debug, Dwarf_P_Die, char *,
519 		    Dwarf_Error *);
520 int		dwarf_arrayorder(Dwarf_Die, Dwarf_Unsigned *, Dwarf_Error *);
521 int		dwarf_attr(Dwarf_Die, Dwarf_Half, Dwarf_Attribute *,
522 		    Dwarf_Error *);
523 int		dwarf_attrlist(Dwarf_Die, Dwarf_Attribute **,
524 		    Dwarf_Signed *, Dwarf_Error *);
525 int		dwarf_attroffset(Dwarf_Attribute, Dwarf_Off *, Dwarf_Error *);
526 int		dwarf_attrval_flag(Dwarf_Die, Dwarf_Half, Dwarf_Bool *,
527 		    Dwarf_Error *);
528 int		dwarf_attrval_signed(Dwarf_Die, Dwarf_Half, Dwarf_Signed *,
529 		    Dwarf_Error *);
530 int		dwarf_attrval_string(Dwarf_Die, Dwarf_Half, const char **,
531 		    Dwarf_Error *);
532 int		dwarf_attrval_unsigned(Dwarf_Die, Dwarf_Half, Dwarf_Unsigned *,
533 		    Dwarf_Error *);
534 int		dwarf_bitoffset(Dwarf_Die, Dwarf_Unsigned *, Dwarf_Error *);
535 int		dwarf_bitsize(Dwarf_Die, Dwarf_Unsigned *, Dwarf_Error *);
536 int		dwarf_bytesize(Dwarf_Die, Dwarf_Unsigned *, Dwarf_Error *);
537 int		dwarf_child(Dwarf_Die, Dwarf_Die *, Dwarf_Error *);
538 void		dwarf_dealloc(Dwarf_Debug, Dwarf_Ptr, Dwarf_Unsigned);
539 int		dwarf_def_macro(Dwarf_P_Debug, Dwarf_Unsigned, char *, char *,
540 		    Dwarf_Error *);
541 int		dwarf_die_CU_offset(Dwarf_Die, Dwarf_Off *, Dwarf_Error *);
542 int		dwarf_die_CU_offset_range(Dwarf_Die, Dwarf_Off *, Dwarf_Off *,
543 		    Dwarf_Error *);
544 int		dwarf_die_abbrev_code(Dwarf_Die);
545 Dwarf_P_Die	dwarf_die_link(Dwarf_P_Die, Dwarf_P_Die, Dwarf_P_Die,
546 		    Dwarf_P_Die, Dwarf_P_Die, Dwarf_Error *);
547 int		dwarf_diename(Dwarf_Die, char **, Dwarf_Error *);
548 int		dwarf_dieoffset(Dwarf_Die, Dwarf_Off *, Dwarf_Error *);
549 int		dwarf_elf_init(Elf *, int, Dwarf_Handler, Dwarf_Ptr,
550 		    Dwarf_Debug *, Dwarf_Error *);
551 int		dwarf_end_macro_file(Dwarf_P_Debug, Dwarf_Error *);
552 const char	*dwarf_errmsg_(Dwarf_Error *);
553 int		dwarf_expand_frame_instructions(Dwarf_Cie, Dwarf_Ptr,
554 		    Dwarf_Unsigned, Dwarf_Frame_Op **, Dwarf_Signed *,
555 		    Dwarf_Error *);
556 Dwarf_Unsigned	dwarf_expr_current_offset(Dwarf_P_Expr, Dwarf_Error *);
557 Dwarf_Addr	dwarf_expr_into_block(Dwarf_P_Expr, Dwarf_Unsigned *,
558 		    Dwarf_Error *);
559 Dwarf_P_Fde	dwarf_fde_cfa_offset(Dwarf_P_Fde, Dwarf_Unsigned, Dwarf_Signed,
560 		    Dwarf_Error *);
561 void		dwarf_fde_cie_list_dealloc(Dwarf_Debug, Dwarf_Cie *,
562 		    Dwarf_Signed, Dwarf_Fde *, Dwarf_Signed);
563 char		*dwarf_find_macro_value_start(char *);
564 int		dwarf_finish(Dwarf_Debug, Dwarf_Error *);
565 int		dwarf_formaddr(Dwarf_Attribute, Dwarf_Addr *, Dwarf_Error *);
566 int		dwarf_formblock(Dwarf_Attribute, Dwarf_Block **, Dwarf_Error *);
567 int		dwarf_formexprloc(Dwarf_Attribute, Dwarf_Unsigned *,
568 		    Dwarf_Ptr *, Dwarf_Error *);
569 int		dwarf_formflag(Dwarf_Attribute, Dwarf_Bool *, Dwarf_Error *);
570 int		dwarf_formref(Dwarf_Attribute, Dwarf_Off *, Dwarf_Error *);
571 int		dwarf_formsdata(Dwarf_Attribute, Dwarf_Signed *, Dwarf_Error *);
572 int		dwarf_formsig8(Dwarf_Attribute, Dwarf_Sig8 *, Dwarf_Error *);
573 int		dwarf_formstring(Dwarf_Attribute, char **, Dwarf_Error *);
574 int		dwarf_formudata(Dwarf_Attribute, Dwarf_Unsigned *,
575 		    Dwarf_Error *);
576 int		dwarf_func_cu_offset(Dwarf_Func, Dwarf_Off *, Dwarf_Error *);
577 int		dwarf_func_die_offset(Dwarf_Func, Dwarf_Off *,
578 		    Dwarf_Error *);
579 int		dwarf_func_name_offsets(Dwarf_Func, char **,
580 		    Dwarf_Off *, Dwarf_Off *, Dwarf_Error *);
581 int		dwarf_funcname(Dwarf_Func, char **, Dwarf_Error *);
582 void		dwarf_funcs_dealloc(Dwarf_Debug, Dwarf_Func *, Dwarf_Signed);
583 int		dwarf_get_ACCESS_name(unsigned, const char **);
584 int		dwarf_get_ATE_name(unsigned, const char **);
585 int		dwarf_get_AT_name(unsigned, const char **);
586 int		dwarf_get_CC_name(unsigned, const char **);
587 int		dwarf_get_CFA_name(unsigned, const char **);
588 int		dwarf_get_CHILDREN_name(unsigned, const char **);
589 int		dwarf_get_DSC_name(unsigned, const char **);
590 int		dwarf_get_DS_name(unsigned, const char **);
591 int		dwarf_get_EH_name(unsigned, const char **);
592 int		dwarf_get_END_name(unsigned, const char **);
593 int		dwarf_get_FORM_name(unsigned, const char **);
594 int		dwarf_get_ID_name(unsigned, const char **);
595 int		dwarf_get_INL_name(unsigned, const char **);
596 int		dwarf_get_LANG_name(unsigned, const char **);
597 int		dwarf_get_LNE_name(unsigned, const char **);
598 int		dwarf_get_LNS_name(unsigned, const char **);
599 int		dwarf_get_MACINFO_name(unsigned, const char **);
600 int		dwarf_get_OP_name(unsigned, const char **);
601 int		dwarf_get_ORD_name(unsigned, const char **);
602 int		dwarf_get_TAG_name(unsigned, const char **);
603 int		dwarf_get_UT_name(unsigned, const char **);
604 int		dwarf_get_VIRTUALITY_name(unsigned, const char **);
605 int		dwarf_get_VIS_name(unsigned, const char **);
606 int		dwarf_get_abbrev(Dwarf_Debug, Dwarf_Unsigned, Dwarf_Abbrev *,
607 		    Dwarf_Unsigned *, Dwarf_Unsigned *, Dwarf_Error *);
608 int		dwarf_get_abbrev_children_flag(Dwarf_Abbrev, Dwarf_Signed *,
609 		    Dwarf_Error *);
610 int		dwarf_get_abbrev_code(Dwarf_Abbrev, Dwarf_Unsigned *,
611 		    Dwarf_Error *);
612 int		dwarf_get_abbrev_entry(Dwarf_Abbrev, Dwarf_Signed, Dwarf_Half *,
613 		    Dwarf_Signed *, Dwarf_Off *, Dwarf_Error *);
614 int		dwarf_get_abbrev_tag(Dwarf_Abbrev, Dwarf_Half *, Dwarf_Error *);
615 int		dwarf_get_address_size(Dwarf_Debug, Dwarf_Half *,
616 		    Dwarf_Error *);
617 int		dwarf_get_arange(Dwarf_Arange *, Dwarf_Unsigned, Dwarf_Addr,
618 		    Dwarf_Arange *, Dwarf_Error *);
619 int		dwarf_get_arange_cu_header_offset(Dwarf_Arange, Dwarf_Off *,
620 		    Dwarf_Error *);
621 int		dwarf_get_arange_info(Dwarf_Arange, Dwarf_Addr *,
622 		    Dwarf_Unsigned *, Dwarf_Off *, Dwarf_Error *);
623 int		dwarf_get_aranges(Dwarf_Debug, Dwarf_Arange **, Dwarf_Signed *,
624 		    Dwarf_Error *);
625 int		dwarf_get_cie_index(Dwarf_Cie, Dwarf_Signed *, Dwarf_Error *);
626 int		dwarf_get_cie_info(Dwarf_Cie, Dwarf_Unsigned *, Dwarf_Small *,
627 		    char **, Dwarf_Unsigned *, Dwarf_Unsigned *, Dwarf_Half *,
628 		    Dwarf_Ptr *, Dwarf_Unsigned *, Dwarf_Error *);
629 int		dwarf_get_cie_of_fde(Dwarf_Fde, Dwarf_Cie *, Dwarf_Error *);
630 int		dwarf_get_cu_die_offset(Dwarf_Arange, Dwarf_Off *,
631 		    Dwarf_Error *);
632 int		dwarf_get_cu_die_offset_given_cu_header_offset(Dwarf_Debug,
633 		    Dwarf_Off, Dwarf_Off *, Dwarf_Error *);
634 int		dwarf_get_cu_die_offset_given_cu_header_offset_b(Dwarf_Debug,
635 		    Dwarf_Off, Dwarf_Bool, Dwarf_Off *, Dwarf_Error *);
636 Dwarf_Bool	dwarf_get_die_infotypes_flag(Dwarf_Die);
637 int		dwarf_get_elf(Dwarf_Debug, Elf **, Dwarf_Error *);
638 int		dwarf_get_fde_at_pc(Dwarf_Fde *, Dwarf_Addr, Dwarf_Fde *,
639 		    Dwarf_Addr *, Dwarf_Addr *, Dwarf_Error *);
640 int		dwarf_get_fde_info_for_all_regs(Dwarf_Fde, Dwarf_Addr,
641 		    Dwarf_Regtable *, Dwarf_Addr *, Dwarf_Error *);
642 int		dwarf_get_fde_info_for_all_regs3(Dwarf_Fde, Dwarf_Addr,
643 		    Dwarf_Regtable3 *, Dwarf_Addr *, Dwarf_Error *);
644 int		dwarf_get_fde_info_for_cfa_reg3(Dwarf_Fde, Dwarf_Addr,
645 		    Dwarf_Small *, Dwarf_Signed *, Dwarf_Signed *, Dwarf_Signed *,
646 		    Dwarf_Ptr *, Dwarf_Addr *, Dwarf_Error *);
647 int		dwarf_get_fde_info_for_reg(Dwarf_Fde, Dwarf_Half, Dwarf_Addr,
648 		    Dwarf_Signed *, Dwarf_Signed *, Dwarf_Signed *,
649 		    Dwarf_Addr *, Dwarf_Error *);
650 int		dwarf_get_fde_info_for_reg3(Dwarf_Fde, Dwarf_Half, Dwarf_Addr,
651 		    Dwarf_Small *, Dwarf_Signed *, Dwarf_Signed *,
652 		    Dwarf_Signed *, Dwarf_Ptr *, Dwarf_Addr *, Dwarf_Error *);
653 int		dwarf_get_fde_instr_bytes(Dwarf_Fde, Dwarf_Ptr *,
654 		    Dwarf_Unsigned *, Dwarf_Error *);
655 int		dwarf_get_fde_list(Dwarf_Debug, Dwarf_Cie **, Dwarf_Signed *,
656 		    Dwarf_Fde **, Dwarf_Signed *, Dwarf_Error *);
657 int		dwarf_get_fde_list_eh(Dwarf_Debug, Dwarf_Cie **, Dwarf_Signed *,
658 		    Dwarf_Fde **, Dwarf_Signed *, Dwarf_Error *);
659 int		dwarf_get_fde_n(Dwarf_Fde *, Dwarf_Unsigned, Dwarf_Fde *,
660 		    Dwarf_Error *);
661 int		dwarf_get_fde_range(Dwarf_Fde, Dwarf_Addr *, Dwarf_Unsigned *,
662 		    Dwarf_Ptr *, Dwarf_Unsigned *, Dwarf_Off *, Dwarf_Signed *,
663 		    Dwarf_Off *, Dwarf_Error *);
664 enum Dwarf_Form_Class dwarf_get_form_class(Dwarf_Half, Dwarf_Half, Dwarf_Half,
665 		    Dwarf_Half);
666 int		dwarf_get_funcs(Dwarf_Debug, Dwarf_Func **, Dwarf_Signed *,
667 		    Dwarf_Error *);
668 int		dwarf_get_globals(Dwarf_Debug, Dwarf_Global **, Dwarf_Signed *,
669 		    Dwarf_Error *);
670 int		dwarf_get_loclist_entry(Dwarf_Debug, Dwarf_Unsigned,
671 		    Dwarf_Addr *, Dwarf_Addr *, Dwarf_Ptr *, Dwarf_Unsigned *,
672 		    Dwarf_Unsigned *, Dwarf_Error *);
673 int		dwarf_get_macro_details(Dwarf_Debug, Dwarf_Off, Dwarf_Unsigned,
674 		    Dwarf_Signed *, Dwarf_Macro_Details **, Dwarf_Error *);
675 int		dwarf_get_pubtypes(Dwarf_Debug, Dwarf_Type **, Dwarf_Signed *,
676 		    Dwarf_Error *);
677 int		dwarf_get_ranges(Dwarf_Debug, Dwarf_Off, Dwarf_Ranges **,
678 		    Dwarf_Signed *, Dwarf_Unsigned *, Dwarf_Error *);
679 int		dwarf_get_ranges_a(Dwarf_Debug, Dwarf_Off, Dwarf_Die,
680 		    Dwarf_Ranges **, Dwarf_Signed *, Dwarf_Unsigned *,
681 		    Dwarf_Error *);
682 int		dwarf_get_relocation_info(Dwarf_P_Debug, Dwarf_Signed *,
683 		    Dwarf_Signed *, Dwarf_Unsigned *, Dwarf_Relocation_Data *,
684 		    Dwarf_Error *);
685 int		dwarf_get_relocation_info_count(Dwarf_P_Debug, Dwarf_Unsigned *,
686 		    int *, Dwarf_Error *);
687 Dwarf_Ptr	dwarf_get_section_bytes(Dwarf_P_Debug, Dwarf_Signed,
688 		    Dwarf_Signed *, Dwarf_Unsigned *, Dwarf_Error *);
689 int		dwarf_get_section_max_offsets(Dwarf_Debug, Dwarf_Unsigned *,
690 		    Dwarf_Unsigned *, Dwarf_Unsigned *, Dwarf_Unsigned *,
691 		    Dwarf_Unsigned *, Dwarf_Unsigned *, Dwarf_Unsigned *,
692 		    Dwarf_Unsigned *, Dwarf_Unsigned *, Dwarf_Unsigned *,
693 		    Dwarf_Unsigned *);
694 int		dwarf_get_section_max_offsets_b(Dwarf_Debug, Dwarf_Unsigned *,
695 		    Dwarf_Unsigned *, Dwarf_Unsigned *, Dwarf_Unsigned *,
696 		    Dwarf_Unsigned *, Dwarf_Unsigned *, Dwarf_Unsigned *,
697 		    Dwarf_Unsigned *, Dwarf_Unsigned *, Dwarf_Unsigned *,
698 		    Dwarf_Unsigned *, Dwarf_Unsigned *);
699 int		dwarf_get_str(Dwarf_Debug, Dwarf_Off, char **, Dwarf_Signed *,
700 		    Dwarf_Error *);
701 int		dwarf_get_types(Dwarf_Debug, Dwarf_Type **, Dwarf_Signed *,
702 		    Dwarf_Error *);
703 int		dwarf_get_vars(Dwarf_Debug, Dwarf_Var **, Dwarf_Signed *,
704 		    Dwarf_Error *);
705 int		dwarf_get_weaks(Dwarf_Debug, Dwarf_Weak **, Dwarf_Signed *,
706 		    Dwarf_Error *);
707 int		dwarf_global_cu_offset(Dwarf_Global, Dwarf_Off *, Dwarf_Error *);
708 int		dwarf_global_die_offset(Dwarf_Global, Dwarf_Off *,
709 		    Dwarf_Error *);
710 int		dwarf_global_formref(Dwarf_Attribute, Dwarf_Off *,
711 		    Dwarf_Error *);
712 int		dwarf_global_name_offsets(Dwarf_Global, char **,
713 		    Dwarf_Off *, Dwarf_Off *, Dwarf_Error *);
714 void		dwarf_globals_dealloc(Dwarf_Debug, Dwarf_Global *, Dwarf_Signed);
715 int		dwarf_globname(Dwarf_Global, char **, Dwarf_Error *);
716 int		dwarf_hasattr(Dwarf_Die, Dwarf_Half, Dwarf_Bool *,
717 		    Dwarf_Error *);
718 int		dwarf_hasform(Dwarf_Attribute, Dwarf_Half, Dwarf_Bool *,
719 		    Dwarf_Error *);
720 int		dwarf_highpc(Dwarf_Die, Dwarf_Addr *, Dwarf_Error *);
721 int		dwarf_highpc_b(Dwarf_Die, Dwarf_Addr *, Dwarf_Half *,
722 		    enum Dwarf_Form_Class *, Dwarf_Error *);
723 int		dwarf_init(int, int, Dwarf_Handler, Dwarf_Ptr, Dwarf_Debug *,
724 		    Dwarf_Error *);
725 int		dwarf_line_srcfileno(Dwarf_Line, Dwarf_Unsigned *,
726 		    Dwarf_Error *);
727 int		dwarf_lineaddr(Dwarf_Line, Dwarf_Addr *, Dwarf_Error *);
728 int		dwarf_linebeginstatement(Dwarf_Line, Dwarf_Bool *,
729 		    Dwarf_Error *);
730 int		dwarf_lineblock(Dwarf_Line, Dwarf_Bool *, Dwarf_Error *);
731 int		dwarf_lineendsequence(Dwarf_Line, Dwarf_Bool *, Dwarf_Error *);
732 int		dwarf_lineno(Dwarf_Line, Dwarf_Unsigned *, Dwarf_Error *);
733 int		dwarf_lineoff(Dwarf_Line, Dwarf_Signed *, Dwarf_Error *);
734 int		dwarf_linesrc(Dwarf_Line, char **, Dwarf_Error *);
735 Dwarf_Unsigned	dwarf_lne_end_sequence(Dwarf_P_Debug, Dwarf_Addr, Dwarf_Error *);
736 Dwarf_Unsigned	dwarf_lne_set_address(Dwarf_P_Debug, Dwarf_Addr, Dwarf_Unsigned,
737 		    Dwarf_Error *);
738 int		dwarf_loclist(Dwarf_Attribute, Dwarf_Locdesc **, Dwarf_Signed *,
739 		    Dwarf_Error *);
740 int		dwarf_loclist_from_expr(Dwarf_Debug, Dwarf_Ptr, Dwarf_Unsigned,
741 		    Dwarf_Locdesc **, Dwarf_Signed *, Dwarf_Error *);
742 int		dwarf_loclist_from_expr_a(Dwarf_Debug, Dwarf_Ptr,
743 		    Dwarf_Unsigned, Dwarf_Half, Dwarf_Locdesc **,
744 		    Dwarf_Signed *, Dwarf_Error *);
745 int		dwarf_loclist_from_expr_b(Dwarf_Debug, Dwarf_Ptr,
746 		    Dwarf_Unsigned, Dwarf_Half, Dwarf_Half,
747 		    Dwarf_Small, Dwarf_Locdesc **, Dwarf_Signed *,
748 		    Dwarf_Error *);
749 int		dwarf_loclist_n(Dwarf_Attribute, Dwarf_Locdesc ***,
750 		    Dwarf_Signed *, Dwarf_Error *);
751 int		dwarf_lowpc(Dwarf_Die, Dwarf_Addr *, Dwarf_Error *);
752 Dwarf_P_Die	dwarf_new_die(Dwarf_P_Debug, Dwarf_Tag, Dwarf_P_Die,
753 		    Dwarf_P_Die, Dwarf_P_Die, Dwarf_P_Die, Dwarf_Error *);
754 Dwarf_P_Expr	dwarf_new_expr(Dwarf_P_Debug, Dwarf_Error *);
755 Dwarf_P_Fde	dwarf_new_fde(Dwarf_P_Debug, Dwarf_Error *);
756 int		dwarf_next_cu_header(Dwarf_Debug, Dwarf_Unsigned *,
757 		    Dwarf_Half *, Dwarf_Off *, Dwarf_Half *,
758 		    Dwarf_Unsigned *, Dwarf_Error *);
759 int		dwarf_next_cu_header_b(Dwarf_Debug, Dwarf_Unsigned *,
760 		    Dwarf_Half *, Dwarf_Off *, Dwarf_Half *, Dwarf_Half *,
761 		    Dwarf_Half *, Dwarf_Unsigned *, Dwarf_Error *);
762 int		dwarf_next_cu_header_c(Dwarf_Debug, Dwarf_Bool,
763 		    Dwarf_Unsigned *, Dwarf_Half *, Dwarf_Off *, Dwarf_Half *,
764 		    Dwarf_Half *, Dwarf_Half *, Dwarf_Sig8 *, Dwarf_Unsigned *,
765 		    Dwarf_Unsigned *, Dwarf_Error *);
766 int		dwarf_next_types_section(Dwarf_Debug, Dwarf_Error *);
767 int		dwarf_object_finish(Dwarf_Debug, Dwarf_Error *);
768 int		dwarf_object_init(Dwarf_Obj_Access_Interface *, Dwarf_Handler,
769 		    Dwarf_Ptr, Dwarf_Debug *, Dwarf_Error *);
770 int		dwarf_offdie(Dwarf_Debug, Dwarf_Off, Dwarf_Die *,
771 		    Dwarf_Error *);
772 int		dwarf_offdie_b(Dwarf_Debug, Dwarf_Off, Dwarf_Bool, Dwarf_Die *,
773 		    Dwarf_Error *);
774 Dwarf_Unsigned	dwarf_producer_finish(Dwarf_P_Debug, Dwarf_Error *);
775 Dwarf_P_Debug	dwarf_producer_init(Dwarf_Unsigned, Dwarf_Callback_Func,
776 		    Dwarf_Handler, Dwarf_Ptr, Dwarf_Error *);
777 Dwarf_P_Debug	dwarf_producer_init_b(Dwarf_Unsigned, Dwarf_Callback_Func_b,
778 		    Dwarf_Handler, Dwarf_Ptr, Dwarf_Error *);
779 int		dwarf_producer_set_isa(Dwarf_P_Debug, enum Dwarf_ISA,
780 		    Dwarf_Error *);
781 int		dwarf_pubtype_cu_offset(Dwarf_Type, Dwarf_Off *, Dwarf_Error *);
782 int		dwarf_pubtype_die_offset(Dwarf_Type, Dwarf_Off *,
783 		    Dwarf_Error *);
784 int		dwarf_pubtype_name_offsets(Dwarf_Type, char **,
785 		    Dwarf_Off *, Dwarf_Off *, Dwarf_Error *);
786 int		dwarf_pubtypename(Dwarf_Type, char **, Dwarf_Error *);
787 void		dwarf_pubtypes_dealloc(Dwarf_Debug, Dwarf_Type *, Dwarf_Signed);
788 void		dwarf_ranges_dealloc(Dwarf_Debug, Dwarf_Ranges *, Dwarf_Signed);
789 void		dwarf_reset_section_bytes(Dwarf_P_Debug);
790 Dwarf_Half	dwarf_set_frame_cfa_value(Dwarf_Debug, Dwarf_Half);
791 Dwarf_Half	dwarf_set_frame_rule_initial_value(Dwarf_Debug, Dwarf_Half);
792 Dwarf_Half	dwarf_set_frame_rule_table_size(Dwarf_Debug, Dwarf_Half);
793 Dwarf_Half	dwarf_set_frame_same_value(Dwarf_Debug, Dwarf_Half);
794 Dwarf_Half	dwarf_set_frame_undefined_value(Dwarf_Debug, Dwarf_Half);
795 int		dwarf_set_reloc_application(int);
796 Dwarf_Ptr	dwarf_seterrarg(Dwarf_Debug, Dwarf_Ptr);
797 Dwarf_Handler	dwarf_seterrhand(Dwarf_Debug, Dwarf_Handler);
798 int		dwarf_siblingof(Dwarf_Debug, Dwarf_Die, Dwarf_Die *, Dwarf_Error *);
799 int		dwarf_siblingof_b(Dwarf_Debug, Dwarf_Die, Dwarf_Die *, Dwarf_Bool,
800 		    Dwarf_Error *);
801 int		dwarf_srcfiles(Dwarf_Die, char ***, Dwarf_Signed *, Dwarf_Error *);
802 int		dwarf_srclang(Dwarf_Die, Dwarf_Unsigned *, Dwarf_Error *);
803 int		dwarf_srclines(Dwarf_Die, Dwarf_Line **, Dwarf_Signed *,
804 		    Dwarf_Error *);
805 void		dwarf_srclines_dealloc(Dwarf_Debug, Dwarf_Line *,
806 		    Dwarf_Signed);
807 int		dwarf_start_macro_file(Dwarf_P_Debug, Dwarf_Unsigned,
808 		    Dwarf_Unsigned, Dwarf_Error *);
809 int		dwarf_tag(Dwarf_Die, Dwarf_Half *, Dwarf_Error *);
810 Dwarf_Signed	dwarf_transform_to_disk_form(Dwarf_P_Debug, Dwarf_Error *);
811 int		dwarf_type_cu_offset(Dwarf_Type, Dwarf_Off *, Dwarf_Error *);
812 int		dwarf_type_die_offset(Dwarf_Type, Dwarf_Off *, Dwarf_Error *);
813 int		dwarf_type_name_offsets(Dwarf_Type, char **,
814 		    Dwarf_Off *, Dwarf_Off *, Dwarf_Error *);
815 int		dwarf_typename(Dwarf_Type, char **, Dwarf_Error *);
816 void		dwarf_types_dealloc(Dwarf_Debug, Dwarf_Type *, Dwarf_Signed);
817 int		dwarf_undef_macro(Dwarf_P_Debug, Dwarf_Unsigned, char *,
818 		    Dwarf_Error *);
819 int		dwarf_var_cu_offset(Dwarf_Var, Dwarf_Off *, Dwarf_Error *);
820 int		dwarf_var_die_offset(Dwarf_Var, Dwarf_Off *,
821 		    Dwarf_Error *);
822 int		dwarf_var_name_offsets(Dwarf_Var, char **,
823 		    Dwarf_Off *, Dwarf_Off *, Dwarf_Error *);
824 int		dwarf_varname(Dwarf_Var, char **, Dwarf_Error *);
825 void		dwarf_vars_dealloc(Dwarf_Debug, Dwarf_Var *, Dwarf_Signed);
826 int		dwarf_vendor_ext(Dwarf_P_Debug, Dwarf_Unsigned, char *,
827 		    Dwarf_Error *);
828 int		dwarf_weak_cu_offset(Dwarf_Weak, Dwarf_Off *, Dwarf_Error *);
829 int		dwarf_weak_die_offset(Dwarf_Weak, Dwarf_Off *,
830 		    Dwarf_Error *);
831 int		dwarf_weak_name_offsets(Dwarf_Weak, char **,
832 		    Dwarf_Off *, Dwarf_Off *, Dwarf_Error *);
833 int		dwarf_weakname(Dwarf_Weak, char **, Dwarf_Error *);
834 void		dwarf_weaks_dealloc(Dwarf_Debug, Dwarf_Weak *, Dwarf_Signed);
835 int		dwarf_whatattr(Dwarf_Attribute, Dwarf_Half *, Dwarf_Error *);
836 int		dwarf_whatform(Dwarf_Attribute, Dwarf_Half *, Dwarf_Error *);
837 int		dwarf_whatform_direct(Dwarf_Attribute, Dwarf_Half *,
838 		    Dwarf_Error *);
839 #ifdef __cplusplus
840 }
841 #endif
842 
843 #endif /* !_LIBDWARF_H_ */
844