|
1 /* |
|
2 |
|
3 Copyright (C) 2000,2001,2002,2005,2006 Silicon Graphics, Inc. All Rights Reserved. |
|
4 Portions Copyright 2007 Sun Microsystems, Inc. All rights reserved. |
|
5 |
|
6 This program is free software; you can redistribute it and/or modify it |
|
7 under the terms of version 2.1 of the GNU Lesser General Public License |
|
8 as published by the Free Software Foundation. |
|
9 |
|
10 This program is distributed in the hope that it would be useful, but |
|
11 WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
13 |
|
14 Further, this software is distributed without any warranty that it is |
|
15 free of the rightful claim of any third person regarding infringement |
|
16 or the like. Any license provided herein, whether implied or |
|
17 otherwise, applies only to this software file. Patent licenses, if |
|
18 any, provided herein do not apply to combinations of this program with |
|
19 other software, or any other product whatsoever. |
|
20 |
|
21 You should have received a copy of the GNU Lesser General Public |
|
22 License along with this program; if not, write the Free Software |
|
23 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301, |
|
24 USA. |
|
25 |
|
26 Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, |
|
27 Mountain View, CA 94043, or: |
|
28 |
|
29 http://www.sgi.com |
|
30 |
|
31 For further information regarding this notice, see: |
|
32 |
|
33 http://oss.sgi.com/projects/GenInfo/NoticeExplan |
|
34 |
|
35 */ |
|
36 |
|
37 |
|
38 #ifndef _LIBDWARF_H |
|
39 #define _LIBDWARF_H |
|
40 #ifdef __cplusplus |
|
41 extern "C" { |
|
42 #endif |
|
43 /* |
|
44 libdwarf.h |
|
45 $Revision: 1.88 $ $Date: 2006/04/18 04:46:07 $ |
|
46 |
|
47 For libdwarf producers and consumers |
|
48 |
|
49 The interface is defined as having 8-byte signed and unsigned |
|
50 values so it can handle 64-or-32bit target on 64-or-32bit host. |
|
51 Addr is the native size: it represents pointers on |
|
52 the host machine (not the target!). |
|
53 |
|
54 This contains declarations for types and all producer |
|
55 and consumer functions. |
|
56 |
|
57 Function declarations are written on a single line each here |
|
58 so one can use grep to each declaration in its entirety. |
|
59 The declarations are a little harder to read this way, but... |
|
60 |
|
61 */ |
|
62 |
|
63 #ifdef __SGI_FAST_LIBELF |
|
64 struct elf_sgi; |
|
65 typedef struct elf_sgi* dwarf_elf_handle; |
|
66 #else |
|
67 struct Elf; |
|
68 typedef struct Elf* dwarf_elf_handle; |
|
69 #endif |
|
70 |
|
71 #if (_MIPS_SZLONG == 64) |
|
72 /* Special case for MIPS, so -64 (LP64) build gets simple -long-. |
|
73 Non-MIPS LP64 or ILP64 environments should probably ensure |
|
74 _MIPS_SZLONG set to 64 everywhere this header is #included. |
|
75 */ |
|
76 typedef int Dwarf_Bool; /* boolean type */ |
|
77 typedef unsigned long Dwarf_Off; /* 4 or 8 byte file offset */ |
|
78 typedef unsigned long Dwarf_Unsigned; /* 4 or 8 byte unsigned value */ |
|
79 typedef unsigned short Dwarf_Half; /* 2 byte unsigned value */ |
|
80 typedef unsigned char Dwarf_Small; /* 1 byte unsigned value */ |
|
81 typedef signed long Dwarf_Signed; /* 4 or 8 byte signed value */ |
|
82 typedef unsigned long Dwarf_Addr; /* target memory address */ |
|
83 #else /* 32-bit */ |
|
84 /* This is for ILP32, allowing i/o of 64bit dwarf info. |
|
85 Also should be fine for LP64 and ILP64 cases. |
|
86 */ |
|
87 typedef int Dwarf_Bool; /* boolean type */ |
|
88 typedef unsigned long long Dwarf_Off; /* 8 byte file offset */ |
|
89 typedef unsigned long long Dwarf_Unsigned; /* 8 byte unsigned value*/ |
|
90 typedef unsigned short Dwarf_Half; /* 2 byte unsigned value */ |
|
91 typedef unsigned char Dwarf_Small; /* 1 byte unsigned value */ |
|
92 typedef signed long long Dwarf_Signed; /* 8 byte signed value */ |
|
93 typedef unsigned long long Dwarf_Addr; /* target memory address */ |
|
94 #endif |
|
95 typedef void* Dwarf_Ptr; /* host machine pointer */ |
|
96 |
|
97 /* Contains info on an uninterpreted block of data |
|
98 */ |
|
99 typedef struct { |
|
100 Dwarf_Unsigned bl_len; /* length of block */ |
|
101 Dwarf_Ptr bl_data; /* uninterpreted data */ |
|
102 Dwarf_Small bl_from_loclist; /*non-0 if loclist, else debug_info*/ |
|
103 Dwarf_Unsigned bl_section_offset; /* Section (not CU) offset |
|
104 which 'data' comes from. */ |
|
105 } Dwarf_Block; |
|
106 |
|
107 |
|
108 /* location record |
|
109 */ |
|
110 typedef struct { |
|
111 Dwarf_Small lr_atom; /* location operation */ |
|
112 Dwarf_Unsigned lr_number; /* operand */ |
|
113 Dwarf_Unsigned lr_number2; /* for OP_BREGx */ |
|
114 Dwarf_Unsigned lr_offset; /* offset in locexpr for OP_BRA etc */ |
|
115 } Dwarf_Loc; |
|
116 |
|
117 |
|
118 /* location description |
|
119 */ |
|
120 typedef struct { |
|
121 Dwarf_Addr ld_lopc; /* beginning of active range */ |
|
122 Dwarf_Addr ld_hipc; /* end of active range */ |
|
123 Dwarf_Half ld_cents; /* count of location records */ |
|
124 Dwarf_Loc* ld_s; /* pointer to list of same */ |
|
125 Dwarf_Small ld_from_loclist; |
|
126 /* non-0 if loclist, else debug_info*/ |
|
127 |
|
128 Dwarf_Unsigned ld_section_offset; /* Section (not CU) offset |
|
129 where loc-expr begins*/ |
|
130 } Dwarf_Locdesc; |
|
131 |
|
132 /* Frame description instructions expanded. |
|
133 */ |
|
134 typedef struct { |
|
135 Dwarf_Small fp_base_op; |
|
136 Dwarf_Small fp_extended_op; |
|
137 Dwarf_Half fp_register; |
|
138 |
|
139 /* Value may be signed, depends on op. |
|
140 Any applicable data_alignment_factor has |
|
141 not been applied, this is the raw offset. */ |
|
142 Dwarf_Unsigned fp_offset; |
|
143 Dwarf_Off fp_instr_offset; |
|
144 } Dwarf_Frame_Op; /* DWARF2 */ |
|
145 |
|
146 typedef struct { |
|
147 Dwarf_Small fp_base_op; |
|
148 Dwarf_Small fp_extended_op; |
|
149 Dwarf_Half fp_register; |
|
150 |
|
151 /* Value may be signed, depends on op. |
|
152 Any applicable data_alignment_factor has |
|
153 not been applied, this is the raw offset. */ |
|
154 Dwarf_Unsigned fp_offset_or_block_len; |
|
155 Dwarf_Small *fp_expr_block; |
|
156 |
|
157 Dwarf_Off fp_instr_offset; |
|
158 } Dwarf_Frame_Op3; /* DWARF3 and DWARF2 compatible */ |
|
159 |
|
160 /* ***IMPORTANT NOTE, TARGET DEPENDENCY **** |
|
161 DW_REG_TABLE_SIZE must be at least as large as |
|
162 the number of registers |
|
163 (DW_FRAME_LAST_REG_NUM) as defined in dwarf.h |
|
164 Preferably identical to DW_FRAME_LAST_REG_NUM. |
|
165 Ensure [0-DW_REG_TABLE_SIZE] does not overlap |
|
166 DW_FRAME_UNDEFINED_VAL or DW_FRAME_SAME_VAL. |
|
167 Also ensure DW_FRAME_REG_INITIAL_VALUE is set to what |
|
168 is appropriate to your cpu. |
|
169 For various CPUs DW_FRAME_UNDEFINED_VAL is correct |
|
170 as the value for DW_FRAME_REG_INITIAL_VALUE. |
|
171 |
|
172 For consumer apps, this can be set dynamically: see |
|
173 dwarf_set_frame_rule_table_size(); |
|
174 */ |
|
175 #ifndef DW_REG_TABLE_SIZE |
|
176 #define DW_REG_TABLE_SIZE 66 |
|
177 #endif |
|
178 |
|
179 /* For MIPS, DW_FRAME_SAME_VAL is the correct default value |
|
180 for a frame register value. For other CPUS another value |
|
181 may be better, such as DW_FRAME_UNDEFINED_VAL. |
|
182 See dwarf_set_frame_rule_table_size |
|
183 */ |
|
184 #ifndef DW_FRAME_REG_INITIAL_VALUE |
|
185 #define DW_FRAME_REG_INITIAL_VALUE DW_FRAME_SAME_VAL |
|
186 #endif |
|
187 |
|
188 /* Taken as meaning 'undefined value', this is not |
|
189 a column or register number. |
|
190 Only present at libdwarf runtime. Never on disk. |
|
191 DW_FRAME_* Values present on disk are in dwarf.h |
|
192 Ensure this is > DW_REG_TABLE_SIZE. |
|
193 */ |
|
194 #define DW_FRAME_UNDEFINED_VAL 1034 |
|
195 |
|
196 /* Taken as meaning 'same value' as caller had, not a column |
|
197 or register number |
|
198 Only present at libdwarf runtime. Never on disk. |
|
199 DW_FRAME_* Values present on disk are in dwarf.h |
|
200 Ensure this is > DW_REG_TABLE_SIZE. |
|
201 */ |
|
202 #define DW_FRAME_SAME_VAL 1035 |
|
203 |
|
204 /* For DWARF3 interfaces, make the CFA a column with no |
|
205 real table number. This is what should have been done |
|
206 for the DWARF2 interfaces. This actually works for |
|
207 both DWARF2 and DWARF3, but see the libdwarf documentation |
|
208 on Dwarf_Regtable3 and dwarf_get_fde_info_for_reg3() |
|
209 and dwarf_get_fde_info_for_all_regs3() |
|
210 Do NOT use this with the older dwarf_get_fde_info_for_reg() |
|
211 or dwarf_get_fde_info_for_all_regs() consumer interfaces. |
|
212 */ |
|
213 #define DW_FRAME_CFA_COL3 1036 |
|
214 |
|
215 /* The following are all needed to evaluate DWARF3 register rules. |
|
216 */ |
|
217 #define DW_EXPR_OFFSET 0 /* DWARF2 only sees this. */ |
|
218 #define DW_EXPR_VAL_OFFSET 1 |
|
219 #define DW_EXPR_EXPRESSION 2 |
|
220 #define DW_EXPR_VAL_EXPRESSION 3 |
|
221 |
|
222 typedef struct Dwarf_Regtable_Entry_s { |
|
223 /* For each index i (naming a hardware register with dwarf number |
|
224 i) the following is true and defines the value of that register: |
|
225 |
|
226 If dw_regnum is Register DW_FRAME_UNDEFINED_VAL |
|
227 it is not DWARF register number but |
|
228 a place holder indicating the register has no defined value. |
|
229 If dw_regnum is Register DW_FRAME_SAME_VAL |
|
230 it is not DWARF register number but |
|
231 a place holder indicating the register has the same |
|
232 value in the previous frame. |
|
233 DW_FRAME_UNDEFINED_VAL, DW_FRAME_SAME_VAL are |
|
234 only present at libdwarf runtime. Never on disk. |
|
235 DW_FRAME_* Values present on disk are in dwarf.h |
|
236 |
|
237 Otherwise: the register number is a DWARF register number |
|
238 (see ABI documents for how this translates to hardware/ |
|
239 software register numbers in the machine hardware) |
|
240 and the following applies: |
|
241 |
|
242 if dw_value_type == DW_EXPR_OFFSET (the only possible case for dwarf2): |
|
243 If dw_offset_relevant is non-zero, then |
|
244 the value is stored at at the address CFA+N where N is a signed offset. |
|
245 Rule: Offset(N) |
|
246 If dw_offset_relevant is zero, then the value of the register |
|
247 is the value of (DWARF) register number dw_regnum. |
|
248 Rule: register(F) |
|
249 Other values of dw_value_type are an error. |
|
250 */ |
|
251 Dwarf_Small dw_offset_relevant; |
|
252 |
|
253 /* For DWARF2, always 0 */ |
|
254 Dwarf_Small dw_value_type; |
|
255 |
|
256 Dwarf_Half dw_regnum; |
|
257 |
|
258 /* The data type here should the larger of Dwarf_Addr |
|
259 and Dwarf_Unsigned and Dwarf_Signed. */ |
|
260 Dwarf_Addr dw_offset; |
|
261 } Dwarf_Regtable_Entry; |
|
262 |
|
263 typedef struct Dwarf_Regtable_s { |
|
264 struct Dwarf_Regtable_Entry_s rules[DW_REG_TABLE_SIZE]; |
|
265 } Dwarf_Regtable; |
|
266 |
|
267 /* opaque type. Functional interface shown later. */ |
|
268 struct Dwarf_Reg_value3_s; |
|
269 typedef struct Dwarf_Reg_value3_s Dwarf_Reg_Value3; |
|
270 |
|
271 typedef struct Dwarf_Regtable_Entry3_s { |
|
272 /* For each index i (naming a hardware register with dwarf number |
|
273 i) the following is true and defines the value of that register: |
|
274 |
|
275 If dw_regnum is Register DW_FRAME_UNDEFINED_VAL |
|
276 it is not DWARF register number but |
|
277 a place holder indicating the register has no defined value. |
|
278 If dw_regnum is Register DW_FRAME_SAME_VAL |
|
279 it is not DWARF register number but |
|
280 a place holder indicating the register has the same |
|
281 value in the previous frame. |
|
282 DW_FRAME_UNDEFINED_VAL, DW_FRAME_SAME_VAL are |
|
283 only present at libdwarf runtime. Never on disk. |
|
284 DW_FRAME_* Values present on disk are in dwarf.h |
|
285 |
|
286 Otherwise: the register number is a DWARF register number |
|
287 (see ABI documnets for how this translates to hardware/ |
|
288 software register numbers in the machine hardware) |
|
289 and the following applies: |
|
290 |
|
291 if dw_value_type == DW_EXPR_OFFSET (the only possible case for |
|
292 dwarf2): |
|
293 If dw_offset_relevant is non-zero, then |
|
294 the value is stored at at the address |
|
295 CFA+N where N is a signed offset. |
|
296 Rule: Offset(N) |
|
297 If dw_offset_relevant is zero, then the value of the register |
|
298 is the value of (DWARF) register number dw_regnum. |
|
299 Rule: register(R) |
|
300 if dw_value_type == DW_EXPR_VAL_OFFSET |
|
301 the value of this register is CFA +N where N is a signed offset. |
|
302 Rule: val_offset(N) |
|
303 |
|
304 if dw_value_type == DW_EXPR_EXPRESSION |
|
305 The value of the register is the value at the address |
|
306 computed by evaluating the DWARF expression E. |
|
307 Rule: expression(E) |
|
308 The expression E byte stream is pointed to by dw_block_ptr. |
|
309 The expression length in bytes is given by |
|
310 dw_offset_or_block_len. |
|
311 if dw_value_type == DW_EXPR_VAL_EXPRESSION |
|
312 The value of the register is the value |
|
313 computed by evaluating the DWARF expression E. |
|
314 Rule: val_expression(E) |
|
315 The expression E byte stream is pointed to by dw_block_ptr. |
|
316 The expression length in bytes is given by |
|
317 dw_offset_or_block_len. |
|
318 Other values of dw_value_type are an error. |
|
319 */ |
|
320 Dwarf_Small dw_offset_relevant; |
|
321 Dwarf_Small dw_value_type; |
|
322 Dwarf_Half dw_regnum; |
|
323 Dwarf_Unsigned dw_offset_or_block_len; |
|
324 Dwarf_Ptr dw_block_ptr; |
|
325 |
|
326 }Dwarf_Regtable_Entry3; |
|
327 |
|
328 /* For the DWARF3 version, moved the DW_FRAME_CFA_COL |
|
329 out of the array and into its own struct. |
|
330 Having it part of the array is not very easy to work |
|
331 with from a portability point of view: changing |
|
332 the number for every architecture is a pain (if one fails |
|
333 to set it correctly a register rule gets clobbered when |
|
334 setting CFA). |
|
335 With MIPS it just happened to be easy to use DW_FRAME_CFA_COL. |
|
336 |
|
337 rt3_rules and rt3_reg_table_size must be filled in |
|
338 before calling libdwarf. |
|
339 Filled in with a pointer to an array (pointer and |
|
340 array set up by the calling application) of rt3_reg_table_size |
|
341 Dwarf_Regtable_Entry3_s structs. |
|
342 libdwarf does not allocate or deallocate space for the |
|
343 rules, you must do so. libdwarf will initialize the |
|
344 contents rules array, you do not need to do so (though |
|
345 if you choose to initialize the array somehow that is ok: |
|
346 libdwarf will overwrite your initializations with its own). |
|
347 |
|
348 */ |
|
349 typedef struct Dwarf_Regtable3_s { |
|
350 struct Dwarf_Regtable_Entry3_s rt3_cfa_rule; |
|
351 |
|
352 Dwarf_Half rt3_reg_table_size; |
|
353 struct Dwarf_Regtable_Entry3_s * rt3_rules; |
|
354 } Dwarf_Regtable3; |
|
355 |
|
356 |
|
357 /* Use for DW_EPXR_STANDARD., DW_EXPR_VAL_OFFSET. |
|
358 Returns DW_DLV_OK if the value is available. |
|
359 If DW_DLV_OK returns the regnum and offset thru the pointers |
|
360 (which the consumer must use appropriately). |
|
361 */ |
|
362 int dwarf_frame_get_reg_register(struct Dwarf_Regtable_Entry3_s *reg_in, |
|
363 Dwarf_Small *offset_relevant, |
|
364 Dwarf_Half *regnum_out, |
|
365 Dwarf_Signed *offset_out); |
|
366 |
|
367 /* Use for DW_EXPR_EXPRESSION, DW_EXPR_VAL_EXPRESSION. |
|
368 Returns DW_DLV_OK if the value is available. |
|
369 The caller must pass in the address of a valid |
|
370 Dwarf_Block (the caller need not initialize it). |
|
371 */ |
|
372 int dwarf_frame_get_reg_expression(struct Dwarf_Regtable_Entry3_s *reg_in, |
|
373 Dwarf_Block *block_out); |
|
374 |
|
375 |
|
376 /* for DW_DLC_SYMBOLIC_RELOCATIONS output to caller |
|
377 v2, adding drd_length: some relocations are 4 and |
|
378 some 8 bytes (pointers are 8, section offsets 4) in |
|
379 some dwarf environments. (MIPS relocations are all one |
|
380 size in any given ABI.) Changing drd_type to an unsigned char |
|
381 to keep struct size down. |
|
382 */ |
|
383 enum Dwarf_Rel_Type { |
|
384 dwarf_drt_none, /* should not get to caller */ |
|
385 dwarf_drt_data_reloc, /* simple normal relocation */ |
|
386 dwarf_drt_segment_rel, /* special reloc, exceptions*/ |
|
387 dwarf_drt_first_of_length_pair,/* this and drt_second |
|
388 for .word end - begin |
|
389 case */ |
|
390 dwarf_drt_second_of_length_pair |
|
391 }; |
|
392 |
|
393 typedef struct Dwarf_P_Marker_s * Dwarf_P_Marker; |
|
394 struct Dwarf_P_Marker_s { |
|
395 Dwarf_Unsigned ma_marker; |
|
396 Dwarf_Unsigned ma_offset; |
|
397 }; |
|
398 |
|
399 typedef struct Dwarf_Relocation_Data_s * Dwarf_Relocation_Data; |
|
400 struct Dwarf_Relocation_Data_s { |
|
401 unsigned char drd_type; /* cast to/from Dwarf_Rel_Type |
|
402 to keep size small in struct */ |
|
403 unsigned char drd_length; /* length in bytes |
|
404 of data being relocated. 4 for 32bit. |
|
405 8 for 64bit data */ |
|
406 Dwarf_Unsigned drd_offset; /* where the data to reloc is */ |
|
407 Dwarf_Unsigned drd_symbol_index; |
|
408 }; |
|
409 |
|
410 typedef struct Dwarf_P_String_Attr_s * Dwarf_P_String_Attr; |
|
411 struct Dwarf_P_String_Attr_s { |
|
412 Dwarf_Unsigned sa_offset; /* Offset of string attribute data */ |
|
413 Dwarf_Unsigned sa_nbytes; |
|
414 }; |
|
415 |
|
416 |
|
417 /* Opaque types for Consumer Library. */ |
|
418 typedef struct Dwarf_Debug_s* Dwarf_Debug; |
|
419 typedef struct Dwarf_Die_s* Dwarf_Die; |
|
420 typedef struct Dwarf_Line_s* Dwarf_Line; |
|
421 typedef struct Dwarf_Global_s* Dwarf_Global; |
|
422 typedef struct Dwarf_Func_s* Dwarf_Func; |
|
423 typedef struct Dwarf_Type_s* Dwarf_Type; |
|
424 typedef struct Dwarf_Var_s* Dwarf_Var; |
|
425 typedef struct Dwarf_Weak_s* Dwarf_Weak; |
|
426 typedef struct Dwarf_Error_s* Dwarf_Error; |
|
427 typedef struct Dwarf_Attribute_s* Dwarf_Attribute; |
|
428 typedef struct Dwarf_Abbrev_s* Dwarf_Abbrev; |
|
429 typedef struct Dwarf_Fde_s* Dwarf_Fde; |
|
430 typedef struct Dwarf_Cie_s* Dwarf_Cie; |
|
431 typedef struct Dwarf_Arange_s* Dwarf_Arange; |
|
432 |
|
433 /* Opaque types for Producer Library. */ |
|
434 typedef struct Dwarf_P_Debug_s* Dwarf_P_Debug; |
|
435 typedef struct Dwarf_P_Die_s* Dwarf_P_Die; |
|
436 typedef struct Dwarf_P_Attribute_s* Dwarf_P_Attribute; |
|
437 typedef struct Dwarf_P_Fde_s* Dwarf_P_Fde; |
|
438 typedef struct Dwarf_P_Expr_s* Dwarf_P_Expr; |
|
439 typedef Dwarf_Unsigned Dwarf_Tag; |
|
440 |
|
441 |
|
442 /* error handler function |
|
443 */ |
|
444 typedef void (*Dwarf_Handler)(Dwarf_Error /*error*/, Dwarf_Ptr /*errarg*/); |
|
445 |
|
446 |
|
447 /* |
|
448 Dwarf_dealloc() alloc_type arguments. |
|
449 Argument points to: |
|
450 */ |
|
451 #define DW_DLA_STRING 0x01 /* char* */ |
|
452 #define DW_DLA_LOC 0x02 /* Dwarf_Loc */ |
|
453 #define DW_DLA_LOCDESC 0x03 /* Dwarf_Locdesc */ |
|
454 #define DW_DLA_ELLIST 0x04 /* Dwarf_Ellist (not used)*/ |
|
455 #define DW_DLA_BOUNDS 0x05 /* Dwarf_Bounds (not used) */ |
|
456 #define DW_DLA_BLOCK 0x06 /* Dwarf_Block */ |
|
457 #define DW_DLA_DEBUG 0x07 /* Dwarf_Debug */ |
|
458 #define DW_DLA_DIE 0x08 /* Dwarf_Die */ |
|
459 #define DW_DLA_LINE 0x09 /* Dwarf_Line */ |
|
460 #define DW_DLA_ATTR 0x0a /* Dwarf_Attribute */ |
|
461 #define DW_DLA_TYPE 0x0b /* Dwarf_Type (not used) */ |
|
462 #define DW_DLA_SUBSCR 0x0c /* Dwarf_Subscr (not used) */ |
|
463 #define DW_DLA_GLOBAL 0x0d /* Dwarf_Global */ |
|
464 #define DW_DLA_ERROR 0x0e /* Dwarf_Error */ |
|
465 #define DW_DLA_LIST 0x0f /* a list */ |
|
466 #define DW_DLA_LINEBUF 0x10 /* Dwarf_Line* (not used) */ |
|
467 #define DW_DLA_ARANGE 0x11 /* Dwarf_Arange */ |
|
468 #define DW_DLA_ABBREV 0x12 /* Dwarf_Abbrev */ |
|
469 #define DW_DLA_FRAME_OP 0x13 /* Dwarf_Frame_Op */ |
|
470 #define DW_DLA_CIE 0x14 /* Dwarf_Cie */ |
|
471 #define DW_DLA_FDE 0x15 /* Dwarf_Fde */ |
|
472 #define DW_DLA_LOC_BLOCK 0x16 /* Dwarf_Loc Block (not used) */ |
|
473 #define DW_DLA_FRAME_BLOCK 0x17 /* Dwarf_Frame Block (not used) */ |
|
474 #define DW_DLA_FUNC 0x18 /* Dwarf_Func */ |
|
475 #define DW_DLA_TYPENAME 0x19 /* Dwarf_Type */ |
|
476 #define DW_DLA_VAR 0x1a /* Dwarf_Var */ |
|
477 #define DW_DLA_WEAK 0x1b /* Dwarf_Weak */ |
|
478 #define DW_DLA_ADDR 0x1c /* Dwarf_Addr sized entries */ |
|
479 |
|
480 /* The augmenter string for CIE */ |
|
481 #define DW_CIE_AUGMENTER_STRING_V0 "z" |
|
482 |
|
483 /* dwarf_init() access arguments |
|
484 */ |
|
485 #define DW_DLC_READ 0 /* read only access */ |
|
486 #define DW_DLC_WRITE 1 /* write only access */ |
|
487 #define DW_DLC_RDWR 2 /* read/write access NOT SUPPORTED*/ |
|
488 |
|
489 /* dwarf_init() access flag modifiers |
|
490 */ |
|
491 #define DW_DLC_SIZE_64 0x40000000 /* 32-bit target */ |
|
492 #define DW_DLC_SIZE_32 0x20000000 /* 64-bit target */ |
|
493 |
|
494 /* dwarf_init() access flag modifiers |
|
495 */ |
|
496 #define DW_DLC_ISA_MIPS 0x00000000 /* MIPS target */ |
|
497 #define DW_DLC_ISA_IA64 0x01000000 /* IA64 target */ |
|
498 #define DW_DLC_STREAM_RELOCATIONS 0x02000000 /* old style binary relocs */ |
|
499 #define DW_DLC_SYMBOLIC_RELOCATIONS 0x04000000 /* usable with assem output */ |
|
500 #define DW_DLC_TARGET_BIGENDIAN 0x08000000 /* big endian target */ |
|
501 #define DW_DLC_TARGET_LITTLEENDIAN 0x00100000 /* little endian target */ |
|
502 |
|
503 #if 0 |
|
504 /* |
|
505 The libdwarf producer interfaces jumble these two semantics together in |
|
506 confusing ways. We *should* have flags like these... |
|
507 But changing the code means a lot of diffs. So for now, |
|
508 we leave things as they are |
|
509 */ |
|
510 #define DW_DLC_SUN_OFFSET32 0x00010000 /* use 32-bit sec offsets */ |
|
511 #define DW_DLC_SUN_OFFSET64 0x00020000 /* use 64-bit sec offsets */ |
|
512 #define DW_DLC_SUN_POINTER32 0x00040000 /* use 4 for address_size */ |
|
513 #define DW_DLC_SUN_POINTER64 0x00080000 /* use 8 for address_size */ |
|
514 #endif |
|
515 |
|
516 /* dwarf_pcline() slide arguments |
|
517 */ |
|
518 #define DW_DLS_BACKWARD -1 /* slide backward to find line */ |
|
519 #define DW_DLS_NOSLIDE 0 /* match exactly without sliding */ |
|
520 #define DW_DLS_FORWARD 1 /* slide forward to find line */ |
|
521 |
|
522 /* libdwarf error numbers |
|
523 */ |
|
524 #define DW_DLE_NE 0 /* no error */ |
|
525 #define DW_DLE_VMM 1 /* dwarf format/library version mismatch */ |
|
526 #define DW_DLE_MAP 2 /* memory map failure */ |
|
527 #define DW_DLE_LEE 3 /* libelf error */ |
|
528 #define DW_DLE_NDS 4 /* no debug section */ |
|
529 #define DW_DLE_NLS 5 /* no line section */ |
|
530 #define DW_DLE_ID 6 /* invalid descriptor for query */ |
|
531 #define DW_DLE_IOF 7 /* I/O failure */ |
|
532 #define DW_DLE_MAF 8 /* memory allocation failure */ |
|
533 #define DW_DLE_IA 9 /* invalid argument */ |
|
534 #define DW_DLE_MDE 10 /* mangled debugging entry */ |
|
535 #define DW_DLE_MLE 11 /* mangled line number entry */ |
|
536 #define DW_DLE_FNO 12 /* file not open */ |
|
537 #define DW_DLE_FNR 13 /* file not a regular file */ |
|
538 #define DW_DLE_FWA 14 /* file open with wrong access */ |
|
539 #define DW_DLE_NOB 15 /* not an object file */ |
|
540 #define DW_DLE_MOF 16 /* mangled object file header */ |
|
541 #define DW_DLE_EOLL 17 /* end of location list entries */ |
|
542 #define DW_DLE_NOLL 18 /* no location list section */ |
|
543 #define DW_DLE_BADOFF 19 /* Invalid offset */ |
|
544 #define DW_DLE_EOS 20 /* end of section */ |
|
545 #define DW_DLE_ATRUNC 21 /* abbreviations section appears truncated*/ |
|
546 #define DW_DLE_BADBITC 22 /* Address size passed to dwarf bad*/ |
|
547 /* It is not an allowed size (64 or 32) */ |
|
548 /* Error codes defined by the current Libdwarf Implementation. */ |
|
549 #define DW_DLE_DBG_ALLOC 23 |
|
550 #define DW_DLE_FSTAT_ERROR 24 |
|
551 #define DW_DLE_FSTAT_MODE_ERROR 25 |
|
552 #define DW_DLE_INIT_ACCESS_WRONG 26 |
|
553 #define DW_DLE_ELF_BEGIN_ERROR 27 |
|
554 #define DW_DLE_ELF_GETEHDR_ERROR 28 |
|
555 #define DW_DLE_ELF_GETSHDR_ERROR 29 |
|
556 #define DW_DLE_ELF_STRPTR_ERROR 30 |
|
557 #define DW_DLE_DEBUG_INFO_DUPLICATE 31 |
|
558 #define DW_DLE_DEBUG_INFO_NULL 32 |
|
559 #define DW_DLE_DEBUG_ABBREV_DUPLICATE 33 |
|
560 #define DW_DLE_DEBUG_ABBREV_NULL 34 |
|
561 #define DW_DLE_DEBUG_ARANGES_DUPLICATE 35 |
|
562 #define DW_DLE_DEBUG_ARANGES_NULL 36 |
|
563 #define DW_DLE_DEBUG_LINE_DUPLICATE 37 |
|
564 #define DW_DLE_DEBUG_LINE_NULL 38 |
|
565 #define DW_DLE_DEBUG_LOC_DUPLICATE 39 |
|
566 #define DW_DLE_DEBUG_LOC_NULL 40 |
|
567 #define DW_DLE_DEBUG_MACINFO_DUPLICATE 41 |
|
568 #define DW_DLE_DEBUG_MACINFO_NULL 42 |
|
569 #define DW_DLE_DEBUG_PUBNAMES_DUPLICATE 43 |
|
570 #define DW_DLE_DEBUG_PUBNAMES_NULL 44 |
|
571 #define DW_DLE_DEBUG_STR_DUPLICATE 45 |
|
572 #define DW_DLE_DEBUG_STR_NULL 46 |
|
573 #define DW_DLE_CU_LENGTH_ERROR 47 |
|
574 #define DW_DLE_VERSION_STAMP_ERROR 48 |
|
575 #define DW_DLE_ABBREV_OFFSET_ERROR 49 |
|
576 #define DW_DLE_ADDRESS_SIZE_ERROR 50 |
|
577 #define DW_DLE_DEBUG_INFO_PTR_NULL 51 |
|
578 #define DW_DLE_DIE_NULL 52 |
|
579 #define DW_DLE_STRING_OFFSET_BAD 53 |
|
580 #define DW_DLE_DEBUG_LINE_LENGTH_BAD 54 |
|
581 #define DW_DLE_LINE_PROLOG_LENGTH_BAD 55 |
|
582 #define DW_DLE_LINE_NUM_OPERANDS_BAD 56 |
|
583 #define DW_DLE_LINE_SET_ADDR_ERROR 57 |
|
584 #define DW_DLE_LINE_EXT_OPCODE_BAD 58 |
|
585 #define DW_DLE_DWARF_LINE_NULL 59 |
|
586 #define DW_DLE_INCL_DIR_NUM_BAD 60 |
|
587 #define DW_DLE_LINE_FILE_NUM_BAD 61 |
|
588 #define DW_DLE_ALLOC_FAIL 62 |
|
589 #define DW_DLE_NO_CALLBACK_FUNC 63 |
|
590 #define DW_DLE_SECT_ALLOC 64 |
|
591 #define DW_DLE_FILE_ENTRY_ALLOC 65 |
|
592 #define DW_DLE_LINE_ALLOC 66 |
|
593 #define DW_DLE_FPGM_ALLOC 67 |
|
594 #define DW_DLE_INCDIR_ALLOC 68 |
|
595 #define DW_DLE_STRING_ALLOC 69 |
|
596 #define DW_DLE_CHUNK_ALLOC 70 |
|
597 #define DW_DLE_BYTEOFF_ERR 71 |
|
598 #define DW_DLE_CIE_ALLOC 72 |
|
599 #define DW_DLE_FDE_ALLOC 73 |
|
600 #define DW_DLE_REGNO_OVFL 74 |
|
601 #define DW_DLE_CIE_OFFS_ALLOC 75 |
|
602 #define DW_DLE_WRONG_ADDRESS 76 |
|
603 #define DW_DLE_EXTRA_NEIGHBORS 77 |
|
604 #define DW_DLE_WRONG_TAG 78 |
|
605 #define DW_DLE_DIE_ALLOC 79 |
|
606 #define DW_DLE_PARENT_EXISTS 80 |
|
607 #define DW_DLE_DBG_NULL 81 |
|
608 #define DW_DLE_DEBUGLINE_ERROR 82 |
|
609 #define DW_DLE_DEBUGFRAME_ERROR 83 |
|
610 #define DW_DLE_DEBUGINFO_ERROR 84 |
|
611 #define DW_DLE_ATTR_ALLOC 85 |
|
612 #define DW_DLE_ABBREV_ALLOC 86 |
|
613 #define DW_DLE_OFFSET_UFLW 87 |
|
614 #define DW_DLE_ELF_SECT_ERR 88 |
|
615 #define DW_DLE_DEBUG_FRAME_LENGTH_BAD 89 |
|
616 #define DW_DLE_FRAME_VERSION_BAD 90 |
|
617 #define DW_DLE_CIE_RET_ADDR_REG_ERROR 91 |
|
618 #define DW_DLE_FDE_NULL 92 |
|
619 #define DW_DLE_FDE_DBG_NULL 93 |
|
620 #define DW_DLE_CIE_NULL 94 |
|
621 #define DW_DLE_CIE_DBG_NULL 95 |
|
622 #define DW_DLE_FRAME_TABLE_COL_BAD 96 |
|
623 #define DW_DLE_PC_NOT_IN_FDE_RANGE 97 |
|
624 #define DW_DLE_CIE_INSTR_EXEC_ERROR 98 |
|
625 #define DW_DLE_FRAME_INSTR_EXEC_ERROR 99 |
|
626 #define DW_DLE_FDE_PTR_NULL 100 |
|
627 #define DW_DLE_RET_OP_LIST_NULL 101 |
|
628 #define DW_DLE_LINE_CONTEXT_NULL 102 |
|
629 #define DW_DLE_DBG_NO_CU_CONTEXT 103 |
|
630 #define DW_DLE_DIE_NO_CU_CONTEXT 104 |
|
631 #define DW_DLE_FIRST_DIE_NOT_CU 105 |
|
632 #define DW_DLE_NEXT_DIE_PTR_NULL 106 |
|
633 #define DW_DLE_DEBUG_FRAME_DUPLICATE 107 |
|
634 #define DW_DLE_DEBUG_FRAME_NULL 108 |
|
635 #define DW_DLE_ABBREV_DECODE_ERROR 109 |
|
636 #define DW_DLE_DWARF_ABBREV_NULL 110 |
|
637 #define DW_DLE_ATTR_NULL 111 |
|
638 #define DW_DLE_DIE_BAD 112 |
|
639 #define DW_DLE_DIE_ABBREV_BAD 113 |
|
640 #define DW_DLE_ATTR_FORM_BAD 114 |
|
641 #define DW_DLE_ATTR_NO_CU_CONTEXT 115 |
|
642 #define DW_DLE_ATTR_FORM_SIZE_BAD 116 |
|
643 #define DW_DLE_ATTR_DBG_NULL 117 |
|
644 #define DW_DLE_BAD_REF_FORM 118 |
|
645 #define DW_DLE_ATTR_FORM_OFFSET_BAD 119 |
|
646 #define DW_DLE_LINE_OFFSET_BAD 120 |
|
647 #define DW_DLE_DEBUG_STR_OFFSET_BAD 121 |
|
648 #define DW_DLE_STRING_PTR_NULL 122 |
|
649 #define DW_DLE_PUBNAMES_VERSION_ERROR 123 |
|
650 #define DW_DLE_PUBNAMES_LENGTH_BAD 124 |
|
651 #define DW_DLE_GLOBAL_NULL 125 |
|
652 #define DW_DLE_GLOBAL_CONTEXT_NULL 126 |
|
653 #define DW_DLE_DIR_INDEX_BAD 127 |
|
654 #define DW_DLE_LOC_EXPR_BAD 128 |
|
655 #define DW_DLE_DIE_LOC_EXPR_BAD 129 |
|
656 #define DW_DLE_ADDR_ALLOC 130 |
|
657 #define DW_DLE_OFFSET_BAD 131 |
|
658 #define DW_DLE_MAKE_CU_CONTEXT_FAIL 132 |
|
659 #define DW_DLE_REL_ALLOC 133 |
|
660 #define DW_DLE_ARANGE_OFFSET_BAD 134 |
|
661 #define DW_DLE_SEGMENT_SIZE_BAD 135 |
|
662 #define DW_DLE_ARANGE_LENGTH_BAD 136 |
|
663 #define DW_DLE_ARANGE_DECODE_ERROR 137 |
|
664 #define DW_DLE_ARANGES_NULL 138 |
|
665 #define DW_DLE_ARANGE_NULL 139 |
|
666 #define DW_DLE_NO_FILE_NAME 140 |
|
667 #define DW_DLE_NO_COMP_DIR 141 |
|
668 #define DW_DLE_CU_ADDRESS_SIZE_BAD 142 |
|
669 #define DW_DLE_INPUT_ATTR_BAD 143 |
|
670 #define DW_DLE_EXPR_NULL 144 |
|
671 #define DW_DLE_BAD_EXPR_OPCODE 145 |
|
672 #define DW_DLE_EXPR_LENGTH_BAD 146 |
|
673 #define DW_DLE_MULTIPLE_RELOC_IN_EXPR 147 |
|
674 #define DW_DLE_ELF_GETIDENT_ERROR 148 |
|
675 #define DW_DLE_NO_AT_MIPS_FDE 149 |
|
676 #define DW_DLE_NO_CIE_FOR_FDE 150 |
|
677 #define DW_DLE_DIE_ABBREV_LIST_NULL 151 |
|
678 #define DW_DLE_DEBUG_FUNCNAMES_DUPLICATE 152 |
|
679 #define DW_DLE_DEBUG_FUNCNAMES_NULL 153 |
|
680 #define DW_DLE_DEBUG_FUNCNAMES_VERSION_ERROR 154 |
|
681 #define DW_DLE_DEBUG_FUNCNAMES_LENGTH_BAD 155 |
|
682 #define DW_DLE_FUNC_NULL 156 |
|
683 #define DW_DLE_FUNC_CONTEXT_NULL 157 |
|
684 #define DW_DLE_DEBUG_TYPENAMES_DUPLICATE 158 |
|
685 #define DW_DLE_DEBUG_TYPENAMES_NULL 159 |
|
686 #define DW_DLE_DEBUG_TYPENAMES_VERSION_ERROR 160 |
|
687 #define DW_DLE_DEBUG_TYPENAMES_LENGTH_BAD 161 |
|
688 #define DW_DLE_TYPE_NULL 162 |
|
689 #define DW_DLE_TYPE_CONTEXT_NULL 163 |
|
690 #define DW_DLE_DEBUG_VARNAMES_DUPLICATE 164 |
|
691 #define DW_DLE_DEBUG_VARNAMES_NULL 165 |
|
692 #define DW_DLE_DEBUG_VARNAMES_VERSION_ERROR 166 |
|
693 #define DW_DLE_DEBUG_VARNAMES_LENGTH_BAD 167 |
|
694 #define DW_DLE_VAR_NULL 168 |
|
695 #define DW_DLE_VAR_CONTEXT_NULL 169 |
|
696 #define DW_DLE_DEBUG_WEAKNAMES_DUPLICATE 170 |
|
697 #define DW_DLE_DEBUG_WEAKNAMES_NULL 171 |
|
698 #define DW_DLE_DEBUG_WEAKNAMES_VERSION_ERROR 172 |
|
699 #define DW_DLE_DEBUG_WEAKNAMES_LENGTH_BAD 173 |
|
700 #define DW_DLE_WEAK_NULL 174 |
|
701 #define DW_DLE_WEAK_CONTEXT_NULL 175 |
|
702 #define DW_DLE_LOCDESC_COUNT_WRONG 176 |
|
703 #define DW_DLE_MACINFO_STRING_NULL 177 |
|
704 #define DW_DLE_MACINFO_STRING_EMPTY 178 |
|
705 #define DW_DLE_MACINFO_INTERNAL_ERROR_SPACE 179 |
|
706 #define DW_DLE_MACINFO_MALLOC_FAIL 180 |
|
707 #define DW_DLE_DEBUGMACINFO_ERROR 181 |
|
708 #define DW_DLE_DEBUG_MACRO_LENGTH_BAD 182 |
|
709 #define DW_DLE_DEBUG_MACRO_MAX_BAD 183 |
|
710 #define DW_DLE_DEBUG_MACRO_INTERNAL_ERR 184 |
|
711 #define DW_DLE_DEBUG_MACRO_MALLOC_SPACE 185 |
|
712 #define DW_DLE_DEBUG_MACRO_INCONSISTENT 186 |
|
713 #define DW_DLE_DF_NO_CIE_AUGMENTATION 187 |
|
714 #define DW_DLE_DF_REG_NUM_TOO_HIGH 188 |
|
715 #define DW_DLE_DF_MAKE_INSTR_NO_INIT 189 |
|
716 #define DW_DLE_DF_NEW_LOC_LESS_OLD_LOC 190 |
|
717 #define DW_DLE_DF_POP_EMPTY_STACK 191 |
|
718 #define DW_DLE_DF_ALLOC_FAIL 192 |
|
719 #define DW_DLE_DF_FRAME_DECODING_ERROR 193 |
|
720 #define DW_DLE_DEBUG_LOC_SECTION_SHORT 194 |
|
721 #define DW_DLE_FRAME_AUGMENTATION_UNKNOWN 195 |
|
722 #define DW_DLA_PUBTYPE_CONTEXT 196 |
|
723 #define DW_DLE_DEBUG_PUBTYPES_LENGTH_BAD 197 |
|
724 #define DW_DLE_DEBUG_PUBTYPES_VERSION_ERROR 198 |
|
725 #define DW_DLE_DEBUG_PUBTYPES_DUPLICATE 199 |
|
726 #define DW_DLE_FRAME_CIE_DECODE_ERROR 200 |
|
727 #define DW_DLE_FRAME_REGISTER_UNREPRESENTABLE 201 |
|
728 #define DW_DLE_FRAME_REGISTER_COUNT_MISMATCH 202 |
|
729 #define DW_DLE_LINK_LOOP 203 |
|
730 |
|
731 |
|
732 |
|
733 /* DW_DLE_LAST MUST EQUAL LAST ERROR NUMBER */ |
|
734 #define DW_DLE_LAST 203 |
|
735 #define DW_DLE_LO_USER 0x10000 |
|
736 |
|
737 /* taken as meaning 'undefined value', this is not |
|
738 a column or register number. |
|
739 Only present at libdwarf runtime. Never on disk. |
|
740 DW_FRAME_* Values present on disk are in dwarf.h |
|
741 */ |
|
742 #define DW_FRAME_UNDEFINED_VAL 1034 |
|
743 |
|
744 /* taken as meaning 'same value' as caller had, not a column |
|
745 or register number |
|
746 Only present at libdwarf runtime. Never on disk. |
|
747 DW_FRAME_* Values present on disk are in dwarf.h |
|
748 */ |
|
749 #define DW_FRAME_SAME_VAL 1035 |
|
750 |
|
751 |
|
752 |
|
753 /* error return values |
|
754 */ |
|
755 #define DW_DLV_BADADDR (~(Dwarf_Addr)0) |
|
756 /* for functions returning target address */ |
|
757 |
|
758 #define DW_DLV_NOCOUNT ((Dwarf_Signed)-1) |
|
759 /* for functions returning count */ |
|
760 |
|
761 #define DW_DLV_BADOFFSET (~(Dwarf_Off)0) |
|
762 /* for functions returning offset */ |
|
763 |
|
764 /* standard return values for functions */ |
|
765 #define DW_DLV_NO_ENTRY -1 |
|
766 #define DW_DLV_OK 0 |
|
767 #define DW_DLV_ERROR 1 |
|
768 |
|
769 /* Special values for offset_into_exception_table field of dwarf fde's. */ |
|
770 /* The following value indicates that there is no Exception table offset |
|
771 associated with a dwarf frame. */ |
|
772 #define DW_DLX_NO_EH_OFFSET (-1LL) |
|
773 /* The following value indicates that the producer was unable to analyse the |
|
774 source file to generate Exception tables for this function. */ |
|
775 #define DW_DLX_EH_OFFSET_UNAVAILABLE (-2LL) |
|
776 |
|
777 |
|
778 /*===========================================================================*/ |
|
779 /* Dwarf consumer interface initialization and termination operations */ |
|
780 |
|
781 /* non-elf initialization */ |
|
782 int dwarf_init(int /*fd*/, |
|
783 Dwarf_Unsigned /*access*/, |
|
784 Dwarf_Handler /*errhand*/, |
|
785 Dwarf_Ptr /*errarg*/, |
|
786 Dwarf_Debug * /*dbg*/, |
|
787 Dwarf_Error* /*error*/); |
|
788 |
|
789 /* elf intialization */ |
|
790 int dwarf_elf_init(dwarf_elf_handle /*elf*/, |
|
791 Dwarf_Unsigned /*access*/, |
|
792 Dwarf_Handler /*errhand*/, |
|
793 Dwarf_Ptr /*errarg*/, |
|
794 Dwarf_Debug * /*dbg*/, |
|
795 Dwarf_Error* /*error*/); |
|
796 |
|
797 /* Undocumented function for memory allocator. */ |
|
798 void dwarf_print_memory_stats(Dwarf_Debug /*dbg*/); |
|
799 |
|
800 |
|
801 int dwarf_get_elf(Dwarf_Debug /*dbg*/, |
|
802 dwarf_elf_handle* /*return_elfptr*/, |
|
803 Dwarf_Error* /*error*/); |
|
804 |
|
805 int dwarf_finish(Dwarf_Debug /*dbg*/, Dwarf_Error* /*error*/); |
|
806 |
|
807 /* die traversal operations */ |
|
808 int dwarf_next_cu_header(Dwarf_Debug /*dbg*/, |
|
809 Dwarf_Unsigned* /*cu_header_length*/, |
|
810 Dwarf_Half* /*version_stamp*/, |
|
811 Dwarf_Off* /*abbrev_offset*/, |
|
812 Dwarf_Half* /*address_size*/, |
|
813 Dwarf_Unsigned* /*next_cu_header_offset*/, |
|
814 Dwarf_Error* /*error*/); |
|
815 |
|
816 int dwarf_siblingof(Dwarf_Debug /*dbg*/, |
|
817 Dwarf_Die /*die*/, |
|
818 Dwarf_Die* /*return_siblingdie*/, |
|
819 Dwarf_Error* /*error*/); |
|
820 |
|
821 int dwarf_child(Dwarf_Die /*die*/, |
|
822 Dwarf_Die* /*return_childdie*/, |
|
823 Dwarf_Error* /*error*/); |
|
824 |
|
825 /* finding die given offset */ |
|
826 int dwarf_offdie(Dwarf_Debug /*dbg*/, |
|
827 Dwarf_Off /*offset*/, |
|
828 Dwarf_Die* /*return_die*/, |
|
829 Dwarf_Error* /*error*/); |
|
830 |
|
831 /* higher level functions (Unimplemented) */ |
|
832 int dwarf_pcfile(Dwarf_Debug /*dbg*/, |
|
833 Dwarf_Addr /*pc*/, |
|
834 Dwarf_Die* /*return_die*/, |
|
835 Dwarf_Error* /*error*/); |
|
836 |
|
837 /* Unimplemented */ |
|
838 int dwarf_pcsubr(Dwarf_Debug /*dbg*/, |
|
839 Dwarf_Addr /*pc*/, |
|
840 Dwarf_Die* /*return_die*/, |
|
841 Dwarf_Error* /*error*/); |
|
842 |
|
843 /* Unimplemented */ |
|
844 int dwarf_pcscope(Dwarf_Debug /*dbg*/, |
|
845 Dwarf_Addr /*pc*/, |
|
846 Dwarf_Die* /*return_die*/, |
|
847 Dwarf_Error* /*error*/); |
|
848 |
|
849 /* operations on DIEs */ |
|
850 int dwarf_tag(Dwarf_Die /*die*/, |
|
851 Dwarf_Half* /*return_tag*/, |
|
852 Dwarf_Error* /*error*/); |
|
853 |
|
854 /* utility? */ |
|
855 int dwarf_dieoffset(Dwarf_Die /*die*/, |
|
856 Dwarf_Off* /*return_offset*/, |
|
857 Dwarf_Error* /*error*/); |
|
858 |
|
859 int dwarf_die_CU_offset(Dwarf_Die /*die*/, |
|
860 Dwarf_Off* /*return_offset*/, |
|
861 Dwarf_Error* /*error*/); |
|
862 |
|
863 int dwarf_attr (Dwarf_Die /*die*/, |
|
864 Dwarf_Half /*attr*/, |
|
865 Dwarf_Attribute * /*returned_attr*/, |
|
866 Dwarf_Error* /*error*/); |
|
867 |
|
868 int dwarf_diename(Dwarf_Die /*die*/, |
|
869 char ** /*diename*/, |
|
870 Dwarf_Error* /*error*/); |
|
871 |
|
872 /* convenience functions, alternative to using dwarf_attrlist() */ |
|
873 int dwarf_hasattr(Dwarf_Die /*die*/, |
|
874 Dwarf_Half /*attr*/, |
|
875 Dwarf_Bool * /*returned_bool*/, |
|
876 Dwarf_Error* /*error*/); |
|
877 |
|
878 /* dwarf_loclist_n preferred over dwarf_loclist */ |
|
879 int dwarf_loclist_n(Dwarf_Attribute /*attr*/, |
|
880 Dwarf_Locdesc*** /*llbuf*/, |
|
881 Dwarf_Signed * /*locCount*/, |
|
882 Dwarf_Error* /*error*/); |
|
883 |
|
884 int dwarf_loclist(Dwarf_Attribute /*attr*/, /* inflexible! */ |
|
885 Dwarf_Locdesc** /*llbuf*/, |
|
886 Dwarf_Signed * /*locCount*/, |
|
887 Dwarf_Error* /*error*/); |
|
888 |
|
889 /* Extracts a dwarf expression from an expression byte stream. |
|
890 Useful to get expressions from DW_CFA_def_cfa_expression |
|
891 DW_CFA_expression DW_CFA_val_expression expression bytes. |
|
892 */ |
|
893 int |
|
894 dwarf_loclist_from_expr(Dwarf_Debug dbg, |
|
895 Dwarf_Ptr expression_in, |
|
896 Dwarf_Unsigned expression_length, |
|
897 Dwarf_Locdesc ** llbuf, |
|
898 Dwarf_Signed * listlen, Dwarf_Error * error); |
|
899 |
|
900 /* Unimplemented */ |
|
901 int dwarf_stringlen(Dwarf_Die /*die*/, |
|
902 Dwarf_Locdesc ** /*returned_locdesc*/, |
|
903 Dwarf_Error* /*error*/); |
|
904 |
|
905 /* Unimplemented */ |
|
906 int dwarf_subscrcnt(Dwarf_Die /*die*/, |
|
907 Dwarf_Signed * /*returned_count*/, |
|
908 Dwarf_Error* /*error*/); |
|
909 |
|
910 /* Unimplemented */ |
|
911 int dwarf_nthsubscr(Dwarf_Die /*die*/, |
|
912 Dwarf_Unsigned /*ssndx*/, |
|
913 Dwarf_Die * /*returned_die*/, |
|
914 Dwarf_Error* /*error*/); |
|
915 |
|
916 int dwarf_lowpc(Dwarf_Die /*die*/, |
|
917 Dwarf_Addr * /*returned_addr*/, |
|
918 Dwarf_Error* /*error*/); |
|
919 |
|
920 int dwarf_highpc(Dwarf_Die /*die*/, |
|
921 Dwarf_Addr * /*returned_addr*/, |
|
922 Dwarf_Error* /*error*/); |
|
923 |
|
924 int dwarf_bytesize(Dwarf_Die /*die*/, |
|
925 Dwarf_Unsigned * /*returned_size*/, |
|
926 Dwarf_Error* /*error*/); |
|
927 |
|
928 /* Unimplemented */ |
|
929 int dwarf_isbitfield(Dwarf_Die /*die*/, |
|
930 Dwarf_Bool * /*returned_bool*/, |
|
931 Dwarf_Error* /*error*/); |
|
932 |
|
933 int dwarf_bitsize(Dwarf_Die /*die*/, |
|
934 Dwarf_Unsigned * /*returned_size*/, |
|
935 Dwarf_Error* /*error*/); |
|
936 |
|
937 int dwarf_bitoffset(Dwarf_Die /*die*/, |
|
938 Dwarf_Unsigned * /*returned_offset*/, |
|
939 Dwarf_Error* /*error*/); |
|
940 |
|
941 int dwarf_srclang(Dwarf_Die /*die*/, |
|
942 Dwarf_Unsigned * /*returned_lang*/, |
|
943 Dwarf_Error* /*error*/); |
|
944 |
|
945 int dwarf_arrayorder(Dwarf_Die /*die*/, |
|
946 Dwarf_Unsigned * /*returned_order*/, |
|
947 Dwarf_Error* /*error*/); |
|
948 |
|
949 /* end of convenience function list */ |
|
950 |
|
951 /* this is the main interface to attributes of a DIE */ |
|
952 int dwarf_attrlist(Dwarf_Die /*die*/, |
|
953 Dwarf_Attribute** /*attrbuf*/, |
|
954 Dwarf_Signed * /*attrcount*/, |
|
955 Dwarf_Error* /*error*/); |
|
956 |
|
957 /* query operations for attributes */ |
|
958 int dwarf_hasform(Dwarf_Attribute /*attr*/, |
|
959 Dwarf_Half /*form*/, |
|
960 Dwarf_Bool * /*returned_bool*/, |
|
961 Dwarf_Error* /*error*/); |
|
962 |
|
963 int dwarf_whatform(Dwarf_Attribute /*attr*/, |
|
964 Dwarf_Half * /*returned_form*/, |
|
965 Dwarf_Error* /*error*/); |
|
966 |
|
967 int dwarf_whatform_direct(Dwarf_Attribute /*attr*/, |
|
968 Dwarf_Half * /*returned_form*/, |
|
969 Dwarf_Error* /*error*/); |
|
970 |
|
971 int dwarf_whatattr(Dwarf_Attribute /*attr*/, |
|
972 Dwarf_Half * /*returned_attr_num*/, |
|
973 Dwarf_Error* /*error*/); |
|
974 |
|
975 /* |
|
976 The following are concerned with the Primary Interface: getting |
|
977 the actual data values. One function per 'kind' of FORM. |
|
978 */ |
|
979 /*dwarf_formref returns, thru return_offset, a CU-relative offset |
|
980 ** and does not allow DW_FORM_ref_addr*/ |
|
981 int dwarf_formref(Dwarf_Attribute /*attr*/, |
|
982 Dwarf_Off* /*return_offset*/, |
|
983 Dwarf_Error* /*error*/); |
|
984 /*dwarf_global_formref returns, thru return_offset, |
|
985 a debug_info-relative offset and does allow all reference forms*/ |
|
986 int dwarf_global_formref(Dwarf_Attribute /*attr*/, |
|
987 Dwarf_Off* /*return_offset*/, |
|
988 Dwarf_Error* /*error*/); |
|
989 |
|
990 int dwarf_formaddr(Dwarf_Attribute /*attr*/, |
|
991 Dwarf_Addr * /*returned_addr*/, |
|
992 Dwarf_Error* /*error*/); |
|
993 |
|
994 int dwarf_formflag(Dwarf_Attribute /*attr*/, |
|
995 Dwarf_Bool * /*returned_bool*/, |
|
996 Dwarf_Error* /*error*/); |
|
997 |
|
998 int dwarf_formudata(Dwarf_Attribute /*attr*/, |
|
999 Dwarf_Unsigned * /*returned_val*/, |
|
1000 Dwarf_Error* /*error*/); |
|
1001 |
|
1002 int dwarf_formsdata(Dwarf_Attribute /*attr*/, |
|
1003 Dwarf_Signed * /*returned_val*/, |
|
1004 Dwarf_Error* /*error*/); |
|
1005 |
|
1006 int dwarf_formblock(Dwarf_Attribute /*attr*/, |
|
1007 Dwarf_Block ** /*returned_block*/, |
|
1008 Dwarf_Error* /*error*/); |
|
1009 |
|
1010 int dwarf_formstring(Dwarf_Attribute /*attr*/, |
|
1011 char ** /*returned_string*/, |
|
1012 Dwarf_Error* /*error*/); |
|
1013 |
|
1014 /* end attribute query operations. */ |
|
1015 |
|
1016 /* line number operations */ |
|
1017 /* dwarf_srclines is the normal interface */ |
|
1018 int dwarf_srclines(Dwarf_Die /*die*/, |
|
1019 Dwarf_Line** /*linebuf*/, |
|
1020 Dwarf_Signed * /*linecount*/, |
|
1021 Dwarf_Error* /*error*/); |
|
1022 |
|
1023 /* dwarf_srclines_dealloc, created July 2005, is the new |
|
1024 method for deallocating what dwarf_srclines returns. |
|
1025 More complete free than using dwarf_dealloc directly. */ |
|
1026 void dwarf_srclines_dealloc(Dwarf_Debug /*dbg*/, |
|
1027 Dwarf_Line* /*linebuf*/, |
|
1028 Dwarf_Signed /*count */); |
|
1029 |
|
1030 |
|
1031 int dwarf_srcfiles(Dwarf_Die /*die*/, |
|
1032 char*** /*srcfiles*/, |
|
1033 Dwarf_Signed * /*filecount*/, |
|
1034 Dwarf_Error* /*error*/); |
|
1035 |
|
1036 /* Unimplemented. */ |
|
1037 int dwarf_dieline(Dwarf_Die /*die*/, |
|
1038 Dwarf_Line * /*returned_line*/, |
|
1039 Dwarf_Error * /*error*/); |
|
1040 |
|
1041 int dwarf_linebeginstatement(Dwarf_Line /*line*/, |
|
1042 Dwarf_Bool * /*returned_bool*/, |
|
1043 Dwarf_Error* /*error*/); |
|
1044 |
|
1045 int dwarf_lineendsequence(Dwarf_Line /*line*/, |
|
1046 Dwarf_Bool * /*returned_bool*/, |
|
1047 Dwarf_Error* /*error*/); |
|
1048 |
|
1049 int dwarf_lineno(Dwarf_Line /*line*/, |
|
1050 Dwarf_Unsigned * /*returned_lineno*/, |
|
1051 Dwarf_Error* /*error*/); |
|
1052 |
|
1053 int dwarf_line_srcfileno(Dwarf_Line /*line*/, |
|
1054 Dwarf_Unsigned * /*ret_fileno*/, |
|
1055 Dwarf_Error * /*error*/); |
|
1056 |
|
1057 int dwarf_lineaddr(Dwarf_Line /*line*/, |
|
1058 Dwarf_Addr * /*returned_addr*/, |
|
1059 Dwarf_Error* /*error*/); |
|
1060 |
|
1061 int dwarf_lineoff(Dwarf_Line /*line*/, |
|
1062 Dwarf_Signed * /*returned_lineoffset*/, |
|
1063 Dwarf_Error* /*error*/); |
|
1064 |
|
1065 int dwarf_linesrc(Dwarf_Line /*line*/, |
|
1066 char ** /*returned_name*/, |
|
1067 Dwarf_Error* /*error*/); |
|
1068 |
|
1069 int dwarf_lineblock(Dwarf_Line /*line*/, |
|
1070 Dwarf_Bool * /*returned_bool*/, |
|
1071 Dwarf_Error* /*error*/); |
|
1072 |
|
1073 /* tertiary interface to line info */ |
|
1074 /* Unimplemented */ |
|
1075 int dwarf_pclines(Dwarf_Debug /*dbg*/, |
|
1076 Dwarf_Addr /*pc*/, |
|
1077 Dwarf_Line** /*linebuf*/, |
|
1078 Dwarf_Signed * /*linecount*/, |
|
1079 Dwarf_Signed /*slide*/, |
|
1080 Dwarf_Error* /*error*/); |
|
1081 /* end line number operations */ |
|
1082 |
|
1083 /* global name space operations (.debug_pubnames access) */ |
|
1084 int dwarf_get_globals(Dwarf_Debug /*dbg*/, |
|
1085 Dwarf_Global** /*globals*/, |
|
1086 Dwarf_Signed * /*number_of_globals*/, |
|
1087 Dwarf_Error* /*error*/); |
|
1088 void dwarf_globals_dealloc(Dwarf_Debug /*dbg*/, |
|
1089 Dwarf_Global* /*globals*/, |
|
1090 Dwarf_Signed /*number_of_globals*/); |
|
1091 |
|
1092 int dwarf_globname(Dwarf_Global /*glob*/, |
|
1093 char ** /*returned_name*/, |
|
1094 Dwarf_Error* /*error*/); |
|
1095 |
|
1096 int dwarf_global_die_offset(Dwarf_Global /*global*/, |
|
1097 Dwarf_Off* /*return_offset*/, |
|
1098 Dwarf_Error * /*error*/); |
|
1099 |
|
1100 int dwarf_get_cu_die_offset_given_cu_header_offset( |
|
1101 Dwarf_Debug /*dbg*/, |
|
1102 Dwarf_Off /*in_cu_header_offset*/, |
|
1103 Dwarf_Off * /*out_cu_die_offset*/, |
|
1104 Dwarf_Error * /*err*/); |
|
1105 #ifdef __sgi /* pragma is sgi MIPS only */ |
|
1106 #pragma optional dwarf_get_cu_die_offset_given_cu_header_offset |
|
1107 #endif |
|
1108 |
|
1109 int dwarf_global_cu_offset(Dwarf_Global /*global*/, |
|
1110 Dwarf_Off* /*return_offset*/, |
|
1111 Dwarf_Error* /*error*/); |
|
1112 |
|
1113 int dwarf_global_name_offsets(Dwarf_Global /*global*/, |
|
1114 char ** /*returned_name*/, |
|
1115 Dwarf_Off* /*die_offset*/, |
|
1116 Dwarf_Off* /*cu_offset*/, |
|
1117 Dwarf_Error* /*error*/); |
|
1118 |
|
1119 /* Static function name operations. */ |
|
1120 int dwarf_get_funcs(Dwarf_Debug /*dbg*/, |
|
1121 Dwarf_Func** /*funcs*/, |
|
1122 Dwarf_Signed * /*number_of_funcs*/, |
|
1123 Dwarf_Error* /*error*/); |
|
1124 void dwarf_funcs_dealloc(Dwarf_Debug /*dbg*/, |
|
1125 Dwarf_Func* /*funcs*/, |
|
1126 Dwarf_Signed /*number_of_funcs*/); |
|
1127 |
|
1128 int dwarf_funcname(Dwarf_Func /*func*/, |
|
1129 char ** /*returned_name*/, |
|
1130 Dwarf_Error* /*error*/); |
|
1131 |
|
1132 int dwarf_func_die_offset(Dwarf_Func /*func*/, |
|
1133 Dwarf_Off* /*return_offset*/, |
|
1134 Dwarf_Error* /*error*/); |
|
1135 |
|
1136 int dwarf_func_cu_offset(Dwarf_Func /*func*/, |
|
1137 Dwarf_Off* /*return_offset*/, |
|
1138 Dwarf_Error* /*error*/); |
|
1139 |
|
1140 int dwarf_func_name_offsets(Dwarf_Func /*func*/, |
|
1141 char ** /*returned_name*/, |
|
1142 Dwarf_Off* /*die_offset*/, |
|
1143 Dwarf_Off* /*cu_offset*/, |
|
1144 Dwarf_Error* /*error*/); |
|
1145 |
|
1146 /* User-defined type name operations, SGI IRIX .debug_typenames section. |
|
1147 Same content as DWARF3 .debug_pubtypes, but defined years before |
|
1148 .debug_pubtypes was defined. SGI IRIX only. */ |
|
1149 int dwarf_get_types(Dwarf_Debug /*dbg*/, |
|
1150 Dwarf_Type** /*types*/, |
|
1151 Dwarf_Signed * /*number_of_types*/, |
|
1152 Dwarf_Error* /*error*/); |
|
1153 void dwarf_types_dealloc(Dwarf_Debug /*dbg*/, |
|
1154 Dwarf_Type* /*types*/, |
|
1155 Dwarf_Signed /*number_of_types*/); |
|
1156 |
|
1157 |
|
1158 int dwarf_typename(Dwarf_Type /*type*/, |
|
1159 char ** /*returned_name*/, |
|
1160 Dwarf_Error* /*error*/); |
|
1161 |
|
1162 int dwarf_type_die_offset(Dwarf_Type /*type*/, |
|
1163 Dwarf_Off* /*return_offset*/, |
|
1164 Dwarf_Error* /*error*/); |
|
1165 |
|
1166 int dwarf_type_cu_offset(Dwarf_Type /*type*/, |
|
1167 Dwarf_Off* /*return_offset*/, |
|
1168 Dwarf_Error* /*error*/); |
|
1169 |
|
1170 int dwarf_type_name_offsets(Dwarf_Type /*type*/, |
|
1171 char ** /*returned_name*/, |
|
1172 Dwarf_Off* /*die_offset*/, |
|
1173 Dwarf_Off* /*cu_offset*/, |
|
1174 Dwarf_Error* /*error*/); |
|
1175 |
|
1176 /* User-defined type name operations, DWARF3 .debug_pubtypes section. |
|
1177 */ |
|
1178 int dwarf_get_pubtypes(Dwarf_Debug /*dbg*/, |
|
1179 Dwarf_Type** /*types*/, |
|
1180 Dwarf_Signed * /*number_of_types*/, |
|
1181 Dwarf_Error* /*error*/); |
|
1182 void dwarf_pubtypes_dealloc(Dwarf_Debug /*dbg*/, |
|
1183 Dwarf_Type* /*pubtypes*/, |
|
1184 Dwarf_Signed /*number_of_pubtypes*/); |
|
1185 |
|
1186 |
|
1187 int dwarf_pubtypename(Dwarf_Type /*type*/, |
|
1188 char ** /*returned_name*/, |
|
1189 Dwarf_Error* /*error*/); |
|
1190 |
|
1191 int dwarf_pubtype_die_offset(Dwarf_Type /*type*/, |
|
1192 Dwarf_Off* /*return_offset*/, |
|
1193 Dwarf_Error* /*error*/); |
|
1194 |
|
1195 int dwarf_pubtype_cu_offset(Dwarf_Type /*type*/, |
|
1196 Dwarf_Off* /*return_offset*/, |
|
1197 Dwarf_Error* /*error*/); |
|
1198 |
|
1199 int dwarf_pubtype_name_offsets(Dwarf_Type /*type*/, |
|
1200 char ** /*returned_name*/, |
|
1201 Dwarf_Off* /*die_offset*/, |
|
1202 Dwarf_Off* /*cu_offset*/, |
|
1203 Dwarf_Error* /*error*/); |
|
1204 |
|
1205 /* File-scope static variable name operations. */ |
|
1206 int dwarf_get_vars(Dwarf_Debug /*dbg*/, |
|
1207 Dwarf_Var** /*vars*/, |
|
1208 Dwarf_Signed * /*number_of_vars*/, |
|
1209 Dwarf_Error* /*error*/); |
|
1210 void dwarf_vars_dealloc(Dwarf_Debug /*dbg*/, |
|
1211 Dwarf_Var* /*vars*/, |
|
1212 Dwarf_Signed /*number_of_vars*/); |
|
1213 |
|
1214 |
|
1215 int dwarf_varname(Dwarf_Var /*var*/, |
|
1216 char ** /*returned_name*/, |
|
1217 Dwarf_Error* /*error*/); |
|
1218 |
|
1219 int dwarf_var_die_offset(Dwarf_Var /*var*/, |
|
1220 Dwarf_Off* /*return_offset*/, |
|
1221 Dwarf_Error* /*error*/); |
|
1222 |
|
1223 int dwarf_var_cu_offset(Dwarf_Var /*var*/, |
|
1224 Dwarf_Off* /*return_offset*/, |
|
1225 Dwarf_Error* /*error*/); |
|
1226 |
|
1227 int dwarf_var_name_offsets(Dwarf_Var /*var*/, |
|
1228 char ** /*returned_name*/, |
|
1229 Dwarf_Off* /*die_offset*/, |
|
1230 Dwarf_Off* /*cu_offset*/, |
|
1231 Dwarf_Error* /*error*/); |
|
1232 |
|
1233 /* weak name operations. */ |
|
1234 int dwarf_get_weaks(Dwarf_Debug /*dbg*/, |
|
1235 Dwarf_Weak** /*weaks*/, |
|
1236 Dwarf_Signed * /*number_of_weaks*/, |
|
1237 Dwarf_Error* /*error*/); |
|
1238 void dwarf_weaks_dealloc(Dwarf_Debug /*dbg*/, |
|
1239 Dwarf_Weak* /*weaks*/, |
|
1240 Dwarf_Signed /*number_of_weaks*/); |
|
1241 |
|
1242 |
|
1243 int dwarf_weakname(Dwarf_Weak /*weak*/, |
|
1244 char ** /*returned_name*/, |
|
1245 Dwarf_Error* /*error*/); |
|
1246 |
|
1247 int dwarf_weak_die_offset(Dwarf_Weak /*weak*/, |
|
1248 Dwarf_Off* /*return_offset*/, |
|
1249 Dwarf_Error* /*error*/); |
|
1250 |
|
1251 int dwarf_weak_cu_offset(Dwarf_Weak /*weak*/, |
|
1252 Dwarf_Off* /*return_offset*/, |
|
1253 Dwarf_Error* /*error*/); |
|
1254 |
|
1255 int dwarf_weak_name_offsets(Dwarf_Weak /*weak*/, |
|
1256 char ** /*returned_name*/, |
|
1257 Dwarf_Off* /*die_offset*/, |
|
1258 Dwarf_Off* /*cu_offset*/, |
|
1259 Dwarf_Error* /*error*/); |
|
1260 |
|
1261 /* location list section operation. (.debug_loc access) */ |
|
1262 int dwarf_get_loclist_entry(Dwarf_Debug /*dbg*/, |
|
1263 Dwarf_Unsigned /*offset*/, |
|
1264 Dwarf_Addr* /*hipc*/, |
|
1265 Dwarf_Addr* /*lopc*/, |
|
1266 Dwarf_Ptr* /*data*/, |
|
1267 Dwarf_Unsigned* /*entry_len*/, |
|
1268 Dwarf_Unsigned* /*next_entry*/, |
|
1269 Dwarf_Error* /*error*/); |
|
1270 |
|
1271 /* abbreviation section operations */ |
|
1272 int dwarf_get_abbrev(Dwarf_Debug /*dbg*/, |
|
1273 Dwarf_Unsigned /*offset*/, |
|
1274 Dwarf_Abbrev * /*returned_abbrev*/, |
|
1275 Dwarf_Unsigned* /*length*/, |
|
1276 Dwarf_Unsigned* /*attr_count*/, |
|
1277 Dwarf_Error* /*error*/); |
|
1278 |
|
1279 int dwarf_get_abbrev_tag(Dwarf_Abbrev /*abbrev*/, |
|
1280 Dwarf_Half* /*return_tag_number*/, |
|
1281 Dwarf_Error* /*error*/); |
|
1282 int dwarf_get_abbrev_code(Dwarf_Abbrev /*abbrev*/, |
|
1283 Dwarf_Unsigned* /*return_code_number*/, |
|
1284 Dwarf_Error* /*error*/); |
|
1285 |
|
1286 int dwarf_get_abbrev_children_flag(Dwarf_Abbrev /*abbrev*/, |
|
1287 Dwarf_Signed* /*return_flag*/, |
|
1288 Dwarf_Error* /*error*/); |
|
1289 |
|
1290 int dwarf_get_abbrev_entry(Dwarf_Abbrev /*abbrev*/, |
|
1291 Dwarf_Signed /*index*/, |
|
1292 Dwarf_Half * /*returned_attr_num*/, |
|
1293 Dwarf_Signed* /*form*/, |
|
1294 Dwarf_Off* /*offset*/, |
|
1295 Dwarf_Error* /*error*/); |
|
1296 |
|
1297 /* consumer string section operation */ |
|
1298 int dwarf_get_str(Dwarf_Debug /*dbg*/, |
|
1299 Dwarf_Off /*offset*/, |
|
1300 char** /*string*/, |
|
1301 Dwarf_Signed * /*strlen_of_string*/, |
|
1302 Dwarf_Error* /*error*/); |
|
1303 |
|
1304 /* Consumer op on gnu .eh_frame info */ |
|
1305 int dwarf_get_fde_list_eh( |
|
1306 Dwarf_Debug /*dbg*/, |
|
1307 Dwarf_Cie ** /*cie_data*/, |
|
1308 Dwarf_Signed * /*cie_element_count*/, |
|
1309 Dwarf_Fde ** /*fde_data*/, |
|
1310 Dwarf_Signed * /*fde_element_count*/, |
|
1311 Dwarf_Error * /*error*/); |
|
1312 |
|
1313 |
|
1314 /* consumer operations on frame info: .debug_frame */ |
|
1315 int dwarf_get_fde_list(Dwarf_Debug /*dbg*/, |
|
1316 Dwarf_Cie** /*cie_data*/, |
|
1317 Dwarf_Signed* /*cie_element_count*/, |
|
1318 Dwarf_Fde** /*fde_data*/, |
|
1319 Dwarf_Signed* /*fde_element_count*/, |
|
1320 Dwarf_Error* /*error*/); |
|
1321 |
|
1322 /* Release storage gotten by dwarf_get_fde_list_eh() or |
|
1323 dwarf_get_fde_list() */ |
|
1324 void dwarf_fde_cie_list_dealloc(Dwarf_Debug dbg, |
|
1325 Dwarf_Cie *cie_data, |
|
1326 Dwarf_Signed cie_element_count, |
|
1327 Dwarf_Fde *fde_data, |
|
1328 Dwarf_Signed fde_element_count); |
|
1329 |
|
1330 |
|
1331 |
|
1332 int dwarf_get_fde_range(Dwarf_Fde /*fde*/, |
|
1333 Dwarf_Addr* /*low_pc*/, |
|
1334 Dwarf_Unsigned* /*func_length*/, |
|
1335 Dwarf_Ptr* /*fde_bytes*/, |
|
1336 Dwarf_Unsigned* /*fde_byte_length*/, |
|
1337 Dwarf_Off* /*cie_offset*/, |
|
1338 Dwarf_Signed* /*cie_index*/, |
|
1339 Dwarf_Off* /*fde_offset*/, |
|
1340 Dwarf_Error* /*error*/); |
|
1341 |
|
1342 /* Useful for IRIX only: see dwarf_get_cie_augmentation_data() |
|
1343 dwarf_get_fde_augmentation_data() for GNU .eh_frame. */ |
|
1344 int dwarf_get_fde_exception_info(Dwarf_Fde /*fde*/, |
|
1345 Dwarf_Signed* /* offset_into_exception_tables */, |
|
1346 Dwarf_Error* /*error*/); |
|
1347 |
|
1348 |
|
1349 int dwarf_get_cie_of_fde(Dwarf_Fde /*fde*/, |
|
1350 Dwarf_Cie * /*cie_returned*/, |
|
1351 Dwarf_Error* /*error*/); |
|
1352 |
|
1353 int dwarf_get_cie_info(Dwarf_Cie /*cie*/, |
|
1354 Dwarf_Unsigned * /*bytes_in_cie*/, |
|
1355 Dwarf_Small* /*version*/, |
|
1356 char ** /*augmenter*/, |
|
1357 Dwarf_Unsigned* /*code_alignment_factor*/, |
|
1358 Dwarf_Signed* /*data_alignment_factor*/, |
|
1359 Dwarf_Half* /*return_address_register_rule*/, |
|
1360 Dwarf_Ptr* /*initial_instructions*/, |
|
1361 Dwarf_Unsigned* /*initial_instructions_length*/, |
|
1362 Dwarf_Error* /*error*/); |
|
1363 |
|
1364 int dwarf_get_fde_instr_bytes(Dwarf_Fde /*fde*/, |
|
1365 Dwarf_Ptr * /*outinstrs*/, Dwarf_Unsigned * /*outlen*/, |
|
1366 Dwarf_Error * /*error*/); |
|
1367 |
|
1368 int dwarf_get_fde_info_for_all_regs(Dwarf_Fde /*fde*/, |
|
1369 Dwarf_Addr /*pc_requested*/, |
|
1370 Dwarf_Regtable* /*reg_table*/, |
|
1371 Dwarf_Addr* /*row_pc*/, |
|
1372 Dwarf_Error* /*error*/); |
|
1373 |
|
1374 int dwarf_get_fde_info_for_all_regs3(Dwarf_Fde /*fde*/, |
|
1375 Dwarf_Addr /*pc_requested*/, |
|
1376 Dwarf_Regtable3* /*reg_table*/, |
|
1377 Dwarf_Addr* /*row_pc*/, |
|
1378 Dwarf_Error* /*error*/); |
|
1379 |
|
1380 /* In this older interface DW_FRAME_CFA_COL is a meaningful |
|
1381 column (which does not work well with DWARF3 or |
|
1382 non-MIPS architectures). */ |
|
1383 int dwarf_get_fde_info_for_reg(Dwarf_Fde /*fde*/, |
|
1384 Dwarf_Half /*table_column*/, |
|
1385 Dwarf_Addr /*pc_requested*/, |
|
1386 Dwarf_Signed* /*offset_relevant*/, |
|
1387 Dwarf_Signed* /*register*/, |
|
1388 Dwarf_Signed* /*offset*/, |
|
1389 Dwarf_Addr* /*row_pc*/, |
|
1390 Dwarf_Error* /*error*/); |
|
1391 |
|
1392 /* See discussion of dw_value_type, libdwarf.h. |
|
1393 Use of DW_FRAME_CFA_COL is not meaningful in this interface. |
|
1394 Nor is DDW_FRAME_CFA_COL3. |
|
1395 See dwarf_get_fde_info_for_cfa_reg3(). |
|
1396 */ |
|
1397 int dwarf_get_fde_info_for_reg3(Dwarf_Fde /*fde*/, |
|
1398 Dwarf_Half /*table_column*/, |
|
1399 Dwarf_Addr /*pc_requested*/, |
|
1400 Dwarf_Small * /*value_type*/, |
|
1401 Dwarf_Signed * /*offset_relevant*/, |
|
1402 Dwarf_Signed* /*register*/, |
|
1403 Dwarf_Signed* /*offset_or_block_len*/, |
|
1404 Dwarf_Ptr * /*block_ptr */, |
|
1405 Dwarf_Addr* /*row_pc_out*/, |
|
1406 Dwarf_Error* /*error*/); |
|
1407 |
|
1408 /* Use this to get the cfa. */ |
|
1409 int dwarf_get_fde_info_for_cfa_reg3(Dwarf_Fde /*fde*/, |
|
1410 Dwarf_Addr /*pc_requested*/, |
|
1411 Dwarf_Small * /*value_type*/, |
|
1412 Dwarf_Signed * /*offset_relevant*/, |
|
1413 Dwarf_Signed* /*register*/, |
|
1414 Dwarf_Signed* /*offset_or_block_len*/, |
|
1415 Dwarf_Ptr * /*block_ptr */, |
|
1416 Dwarf_Addr* /*row_pc_out*/, |
|
1417 Dwarf_Error* /*error*/); |
|
1418 |
|
1419 int dwarf_get_fde_for_die(Dwarf_Debug /*dbg*/, |
|
1420 Dwarf_Die /*subr_die */, |
|
1421 Dwarf_Fde * /*returned_fde*/, |
|
1422 Dwarf_Error* /*error*/); |
|
1423 |
|
1424 int dwarf_get_fde_n(Dwarf_Fde* /*fde_data*/, |
|
1425 Dwarf_Unsigned /*fde_index*/, |
|
1426 Dwarf_Fde * /*returned_fde*/, |
|
1427 Dwarf_Error* /*error*/); |
|
1428 |
|
1429 int dwarf_get_fde_at_pc(Dwarf_Fde* /*fde_data*/, |
|
1430 Dwarf_Addr /*pc_of_interest*/, |
|
1431 Dwarf_Fde * /*returned_fde*/, |
|
1432 Dwarf_Addr* /*lopc*/, |
|
1433 Dwarf_Addr* /*hipc*/, |
|
1434 Dwarf_Error* /*error*/); |
|
1435 |
|
1436 /* GNU .eh_frame augmentation information, raw form, see |
|
1437 Linux Standard Base Core Specification version 3.0 . */ |
|
1438 int dwarf_get_cie_augmentation_data(Dwarf_Cie /* cie*/, |
|
1439 Dwarf_Small ** /* augdata */, |
|
1440 Dwarf_Unsigned * /* augdata_len */, |
|
1441 Dwarf_Error* /*error*/); |
|
1442 /* GNU .eh_frame augmentation information, raw form, see |
|
1443 Linux Standard Base Core Specification version 3.0 . */ |
|
1444 int dwarf_get_fde_augmentation_data(Dwarf_Fde /* fde*/, |
|
1445 Dwarf_Small ** /* augdata */, |
|
1446 Dwarf_Unsigned * /* augdata_len */, |
|
1447 Dwarf_Error* /*error*/); |
|
1448 |
|
1449 int dwarf_expand_frame_instructions(Dwarf_Debug /*dbg*/, |
|
1450 Dwarf_Ptr /*instruction*/, |
|
1451 Dwarf_Unsigned /*i_length*/, |
|
1452 Dwarf_Frame_Op** /*returned_op_list*/, |
|
1453 Dwarf_Signed* /*op_count*/, |
|
1454 Dwarf_Error* /*error*/); |
|
1455 |
|
1456 /* Operations on .debug_aranges. */ |
|
1457 int dwarf_get_aranges(Dwarf_Debug /*dbg*/, |
|
1458 Dwarf_Arange** /*aranges*/, |
|
1459 Dwarf_Signed * /*arange_count*/, |
|
1460 Dwarf_Error* /*error*/); |
|
1461 |
|
1462 |
|
1463 |
|
1464 int dwarf_get_arange( |
|
1465 Dwarf_Arange* /*aranges*/, |
|
1466 Dwarf_Unsigned /*arange_count*/, |
|
1467 Dwarf_Addr /*address*/, |
|
1468 Dwarf_Arange * /*returned_arange*/, |
|
1469 Dwarf_Error* /*error*/); |
|
1470 |
|
1471 int dwarf_get_cu_die_offset( |
|
1472 Dwarf_Arange /*arange*/, |
|
1473 Dwarf_Off* /*return_offset*/, |
|
1474 Dwarf_Error* /*error*/); |
|
1475 |
|
1476 int dwarf_get_arange_cu_header_offset( |
|
1477 Dwarf_Arange /*arange*/, |
|
1478 Dwarf_Off* /*return_cu_header_offset*/, |
|
1479 Dwarf_Error* /*error*/); |
|
1480 #ifdef __sgi /* pragma is sgi MIPS only */ |
|
1481 #pragma optional dwarf_get_arange_cu_header_offset |
|
1482 #endif |
|
1483 |
|
1484 int dwarf_get_arange_info( |
|
1485 Dwarf_Arange /*arange*/, |
|
1486 Dwarf_Addr* /*start*/, |
|
1487 Dwarf_Unsigned* /*length*/, |
|
1488 Dwarf_Off* /*cu_die_offset*/, |
|
1489 Dwarf_Error* /*error*/); |
|
1490 |
|
1491 |
|
1492 /* consumer .debug_macinfo information interface. |
|
1493 */ |
|
1494 struct Dwarf_Macro_Details_s { |
|
1495 Dwarf_Off dmd_offset; /* offset, in the section, |
|
1496 of this macro info */ |
|
1497 Dwarf_Small dmd_type; /* the type, DW_MACINFO_define etc*/ |
|
1498 Dwarf_Signed dmd_lineno; /* the source line number where |
|
1499 applicable and vend_def # if |
|
1500 vendor_extension op |
|
1501 */ |
|
1502 |
|
1503 Dwarf_Signed dmd_fileindex;/* the source file index: |
|
1504 applies to define undef start_file |
|
1505 */ |
|
1506 char * dmd_macro; /* macro name (with value for defineop) |
|
1507 string from vendor ext |
|
1508 */ |
|
1509 }; |
|
1510 |
|
1511 /* dwarf_print_lines is for use by dwarfdump: it prints |
|
1512 line info to stdout. |
|
1513 The _dwarf name is obsolete. Use dwarf_ instead. |
|
1514 */ |
|
1515 int _dwarf_print_lines(Dwarf_Die cu_die,Dwarf_Error * /*error*/); |
|
1516 int dwarf_print_lines(Dwarf_Die cu_die,Dwarf_Error * /*error*/); |
|
1517 |
|
1518 /* dwarf_ld_sort_lines helps SGI IRIX ld |
|
1519 rearrange lines in .debug_line in a .o created with a text |
|
1520 section per function. |
|
1521 -OPT:procedure_reorder=ON |
|
1522 where ld-cord (cord(1)ing by ld, |
|
1523 not by cord(1)) may have changed the function order. |
|
1524 The _dwarf name is obsolete. Use dwarf_ instead. |
|
1525 */ |
|
1526 int _dwarf_ld_sort_lines( |
|
1527 void * orig_buffer, |
|
1528 unsigned long buffer_len, |
|
1529 int is_64_bit, |
|
1530 int *any_change, |
|
1531 int * err_code); |
|
1532 int dwarf_ld_sort_lines( |
|
1533 void * orig_buffer, |
|
1534 unsigned long buffer_len, |
|
1535 int is_64_bit, |
|
1536 int *any_change, |
|
1537 int * err_code); |
|
1538 |
|
1539 /* Used by dwarfdump -v to print fde offsets from debugging |
|
1540 info. |
|
1541 The _dwarf name is obsolete. Use dwarf_ instead. |
|
1542 */ |
|
1543 int _dwarf_fde_section_offset(Dwarf_Debug dbg,Dwarf_Fde in_fde, |
|
1544 Dwarf_Off *fde_off, Dwarf_Off *cie_off, |
|
1545 Dwarf_Error *err); |
|
1546 int dwarf_fde_section_offset(Dwarf_Debug dbg,Dwarf_Fde in_fde, |
|
1547 Dwarf_Off *fde_off, Dwarf_Off *cie_off, |
|
1548 Dwarf_Error *err); |
|
1549 |
|
1550 /* Used by dwarfdump -v to print cie offsets from debugging |
|
1551 info. |
|
1552 The _dwarf name is obsolete. Use dwarf_ instead. |
|
1553 */ |
|
1554 int dwarf_cie_section_offset(Dwarf_Debug dbg,Dwarf_Cie in_cie, |
|
1555 Dwarf_Off *cie_off, |
|
1556 Dwarf_Error *err); |
|
1557 int _dwarf_cie_section_offset(Dwarf_Debug dbg,Dwarf_Cie in_cie, |
|
1558 Dwarf_Off *cie_off, |
|
1559 Dwarf_Error *err); |
|
1560 |
|
1561 |
|
1562 |
|
1563 |
|
1564 typedef struct Dwarf_Macro_Details_s Dwarf_Macro_Details; |
|
1565 |
|
1566 int dwarf_get_macro(Dwarf_Debug /*dbg*/, |
|
1567 char * /*requested_macro_name*/, |
|
1568 Dwarf_Addr /*pc_of_request*/, |
|
1569 char ** /*returned_macro_value*/, |
|
1570 Dwarf_Error * /*error*/); |
|
1571 |
|
1572 int dwarf_get_all_defined_macros(Dwarf_Debug /*dbg*/, |
|
1573 Dwarf_Addr /*pc_of_request*/, |
|
1574 Dwarf_Signed * /*returned_count*/, |
|
1575 char *** /*returned_pointers_to_macros*/, |
|
1576 Dwarf_Error * /*error*/); |
|
1577 |
|
1578 char *dwarf_find_macro_value_start(char * /*macro_string*/); |
|
1579 |
|
1580 int dwarf_get_macro_details(Dwarf_Debug /*dbg*/, |
|
1581 Dwarf_Off /*macro_offset*/, |
|
1582 Dwarf_Unsigned /*maximum_count*/, |
|
1583 Dwarf_Signed * /*entry_count*/, |
|
1584 Dwarf_Macro_Details ** /*details*/, |
|
1585 Dwarf_Error * /*err*/); |
|
1586 |
|
1587 |
|
1588 int dwarf_get_address_size(Dwarf_Debug /*dbg*/, |
|
1589 Dwarf_Half * /*addr_size*/, |
|
1590 Dwarf_Error * /*error*/); |
|
1591 |
|
1592 /* utility operations */ |
|
1593 Dwarf_Unsigned dwarf_errno(Dwarf_Error /*error*/); |
|
1594 |
|
1595 char* dwarf_errmsg(Dwarf_Error /*error*/); |
|
1596 |
|
1597 /* stringcheck zero is default and means do all |
|
1598 ** string length validity checks. |
|
1599 ** Call with parameter value 1 to turn off many such checks (and |
|
1600 ** increase performance). |
|
1601 ** Call with zero for safest running. |
|
1602 ** Actual value saved and returned is only 8 bits! Upper bits |
|
1603 ** ignored by libdwarf (and zero on return). |
|
1604 ** Returns previous value. |
|
1605 */ |
|
1606 int dwarf_set_stringcheck(int /*stringcheck*/); |
|
1607 |
|
1608 /* Unimplemented */ |
|
1609 Dwarf_Handler dwarf_seterrhand(Dwarf_Debug /*dbg*/, Dwarf_Handler /*errhand*/); |
|
1610 |
|
1611 /* Unimplemented */ |
|
1612 Dwarf_Ptr dwarf_seterrarg(Dwarf_Debug /*dbg*/, Dwarf_Ptr /*errarg*/); |
|
1613 |
|
1614 void dwarf_dealloc(Dwarf_Debug /*dbg*/, void* /*space*/, |
|
1615 Dwarf_Unsigned /*type*/); |
|
1616 |
|
1617 /* DWARF Producer Interface */ |
|
1618 |
|
1619 typedef int (*Dwarf_Callback_Func)( |
|
1620 char* /*name*/, |
|
1621 int /*size*/, |
|
1622 Dwarf_Unsigned /*type*/, |
|
1623 Dwarf_Unsigned /*flags*/, |
|
1624 Dwarf_Unsigned /*link*/, |
|
1625 Dwarf_Unsigned /*info*/, |
|
1626 int* /*sect name index*/, |
|
1627 int* /*error*/); |
|
1628 |
|
1629 Dwarf_P_Debug dwarf_producer_init( |
|
1630 Dwarf_Unsigned /*creation_flags*/, |
|
1631 Dwarf_Callback_Func /*func*/, |
|
1632 Dwarf_Handler /*errhand*/, |
|
1633 Dwarf_Ptr /*errarg*/, |
|
1634 Dwarf_Error* /*error*/); |
|
1635 |
|
1636 typedef int (*Dwarf_Callback_Func_b)( |
|
1637 char* /*name*/, |
|
1638 int /*size*/, |
|
1639 Dwarf_Unsigned /*type*/, |
|
1640 Dwarf_Unsigned /*flags*/, |
|
1641 Dwarf_Unsigned /*link*/, |
|
1642 Dwarf_Unsigned /*info*/, |
|
1643 Dwarf_Unsigned* /*sect_name_index*/, |
|
1644 int* /*error*/); |
|
1645 |
|
1646 |
|
1647 Dwarf_P_Debug dwarf_producer_init_b( |
|
1648 Dwarf_Unsigned /*flags*/, |
|
1649 Dwarf_Callback_Func_b /*func*/, |
|
1650 Dwarf_Handler /*errhand*/, |
|
1651 Dwarf_Ptr /*errarg*/, |
|
1652 Dwarf_Error * /*error*/); |
|
1653 |
|
1654 |
|
1655 Dwarf_Signed dwarf_transform_to_disk_form(Dwarf_P_Debug /*dbg*/, |
|
1656 Dwarf_Error* /*error*/); |
|
1657 |
|
1658 Dwarf_Ptr dwarf_get_section_bytes(Dwarf_P_Debug /*dbg*/, |
|
1659 Dwarf_Signed /*dwarf_section*/, |
|
1660 Dwarf_Signed* /*elf_section_index*/, |
|
1661 Dwarf_Unsigned* /*length*/, |
|
1662 Dwarf_Error* /*error*/); |
|
1663 |
|
1664 int dwarf_get_relocation_info_count( |
|
1665 Dwarf_P_Debug /*dbg*/, |
|
1666 Dwarf_Unsigned * /*count_of_relocation_sections*/, |
|
1667 int * /*drd_buffer_version*/, |
|
1668 Dwarf_Error* /*error*/); |
|
1669 |
|
1670 int dwarf_get_relocation_info( |
|
1671 Dwarf_P_Debug /*dbg*/, |
|
1672 Dwarf_Signed * /*elf_section_index*/, |
|
1673 Dwarf_Signed * /*elf_section_index_link*/, |
|
1674 Dwarf_Unsigned * /*relocation_buffer_count*/, |
|
1675 Dwarf_Relocation_Data * /*reldata_buffer*/, |
|
1676 Dwarf_Error* /*error*/); |
|
1677 |
|
1678 /* v1: no drd_length field, enum explicit */ |
|
1679 /* v2: has the drd_length field, enum value in uchar member */ |
|
1680 #define DWARF_DRD_BUFFER_VERSION 2 |
|
1681 |
|
1682 Dwarf_Signed dwarf_get_die_markers( |
|
1683 Dwarf_P_Debug /*dbg*/, |
|
1684 Dwarf_P_Marker * /*marker_list*/, |
|
1685 Dwarf_Unsigned * /*marker_count*/, |
|
1686 Dwarf_Error * /*error*/); |
|
1687 |
|
1688 int dwarf_get_string_attributes_count(Dwarf_P_Debug, |
|
1689 Dwarf_Unsigned *, |
|
1690 int *, |
|
1691 Dwarf_Error *); |
|
1692 |
|
1693 int dwarf_get_string_attributes_info(Dwarf_P_Debug, |
|
1694 Dwarf_Signed *, |
|
1695 Dwarf_Unsigned *, |
|
1696 Dwarf_P_String_Attr *, |
|
1697 Dwarf_Error *); |
|
1698 |
|
1699 void dwarf_reset_section_bytes(Dwarf_P_Debug /*dbg*/); |
|
1700 |
|
1701 Dwarf_Unsigned dwarf_producer_finish(Dwarf_P_Debug /*dbg*/, |
|
1702 Dwarf_Error* /*error*/); |
|
1703 |
|
1704 /* Producer attribute addition functions. */ |
|
1705 Dwarf_P_Attribute dwarf_add_AT_targ_address(Dwarf_P_Debug /*dbg*/, |
|
1706 Dwarf_P_Die /*ownerdie*/, |
|
1707 Dwarf_Half /*attr*/, |
|
1708 Dwarf_Unsigned /*pc_value*/, |
|
1709 Dwarf_Signed /*sym_index*/, |
|
1710 Dwarf_Error* /*error*/); |
|
1711 |
|
1712 Dwarf_P_Attribute dwarf_add_AT_block(Dwarf_P_Debug /*dbg*/, |
|
1713 Dwarf_P_Die /*ownerdie*/, |
|
1714 Dwarf_Half /*attr*/, |
|
1715 Dwarf_Small* /*block_data*/, |
|
1716 Dwarf_Unsigned /*block_len*/, |
|
1717 Dwarf_Error* /*error*/); |
|
1718 |
|
1719 Dwarf_P_Attribute dwarf_add_AT_targ_address_b(Dwarf_P_Debug /*dbg*/, |
|
1720 Dwarf_P_Die /*ownerdie*/, |
|
1721 Dwarf_Half /*attr*/, |
|
1722 Dwarf_Unsigned /*pc_value*/, |
|
1723 Dwarf_Unsigned /*sym_index*/, |
|
1724 Dwarf_Error* /*error*/); |
|
1725 |
|
1726 Dwarf_P_Attribute dwarf_add_AT_ref_address(Dwarf_P_Debug /*dbg*/, |
|
1727 Dwarf_P_Die /*ownerdie*/, |
|
1728 Dwarf_Half /*attr*/, |
|
1729 Dwarf_Unsigned /*pc_value*/, |
|
1730 Dwarf_Unsigned /*sym_index*/, |
|
1731 Dwarf_Error* /*error*/); |
|
1732 |
|
1733 Dwarf_P_Attribute dwarf_add_AT_unsigned_const(Dwarf_P_Debug /*dbg*/, |
|
1734 Dwarf_P_Die /*ownerdie*/, |
|
1735 Dwarf_Half /*attr*/, |
|
1736 Dwarf_Unsigned /*value*/, |
|
1737 Dwarf_Error* /*error*/); |
|
1738 |
|
1739 Dwarf_P_Attribute dwarf_add_AT_signed_const(Dwarf_P_Debug /*dbg*/, |
|
1740 Dwarf_P_Die /*ownerdie*/, |
|
1741 Dwarf_Half /*attr*/, |
|
1742 Dwarf_Signed /*value*/, |
|
1743 Dwarf_Error* /*error*/); |
|
1744 |
|
1745 Dwarf_P_Attribute dwarf_add_AT_reference(Dwarf_P_Debug /*dbg*/, |
|
1746 Dwarf_P_Die /*ownerdie*/, |
|
1747 Dwarf_Half /*attr*/, |
|
1748 Dwarf_P_Die /*otherdie*/, |
|
1749 Dwarf_Error* /*error*/); |
|
1750 |
|
1751 Dwarf_P_Attribute dwarf_add_AT_dataref( |
|
1752 Dwarf_P_Debug /* dbg*/, |
|
1753 Dwarf_P_Die /*ownerdie*/, |
|
1754 Dwarf_Half /*attr*/, |
|
1755 Dwarf_Unsigned /*pcvalue*/, |
|
1756 Dwarf_Unsigned /*sym_index*/, |
|
1757 Dwarf_Error* /*error*/); |
|
1758 |
|
1759 Dwarf_P_Attribute dwarf_add_AT_const_value_string(Dwarf_P_Die /*ownerdie*/, |
|
1760 char* /*string_value*/, |
|
1761 Dwarf_Error* /*error*/); |
|
1762 |
|
1763 Dwarf_P_Attribute dwarf_add_AT_location_expr(Dwarf_P_Debug /*dbg*/, |
|
1764 Dwarf_P_Die /*ownerdie*/, |
|
1765 Dwarf_Half /*attr*/, |
|
1766 Dwarf_P_Expr /*loc_expr*/, |
|
1767 Dwarf_Error* /*error*/); |
|
1768 |
|
1769 Dwarf_P_Attribute dwarf_add_AT_string(Dwarf_P_Debug /*dbg*/, |
|
1770 Dwarf_P_Die /*ownerdie*/, |
|
1771 Dwarf_Half /*attr*/, |
|
1772 char* /*string*/, |
|
1773 Dwarf_Error* /*error*/); |
|
1774 |
|
1775 Dwarf_P_Attribute dwarf_add_AT_flag(Dwarf_P_Debug /*dbg*/, |
|
1776 Dwarf_P_Die /*ownerdie*/, |
|
1777 Dwarf_Half /*attr*/, |
|
1778 Dwarf_Small /*flag*/, |
|
1779 Dwarf_Error* /*error*/); |
|
1780 |
|
1781 Dwarf_P_Attribute dwarf_add_AT_producer(Dwarf_P_Die /*ownerdie*/, |
|
1782 char* /*producer_string*/, |
|
1783 Dwarf_Error* /*error*/); |
|
1784 |
|
1785 Dwarf_P_Attribute dwarf_add_AT_const_value_signedint(Dwarf_P_Die /*ownerdie*/, |
|
1786 Dwarf_Signed /*signed_value*/, |
|
1787 Dwarf_Error* /*error*/); |
|
1788 |
|
1789 Dwarf_P_Attribute dwarf_add_AT_const_value_unsignedint( |
|
1790 Dwarf_P_Die /*ownerdie*/, |
|
1791 Dwarf_Unsigned /*unsigned_value*/, |
|
1792 Dwarf_Error* /*error*/); |
|
1793 |
|
1794 Dwarf_P_Attribute dwarf_add_AT_comp_dir(Dwarf_P_Die /*ownerdie*/, |
|
1795 char* /*current_working_directory*/, |
|
1796 Dwarf_Error* /*error*/); |
|
1797 |
|
1798 Dwarf_P_Attribute dwarf_add_AT_name(Dwarf_P_Die /*die*/, |
|
1799 char* /*name*/, |
|
1800 Dwarf_Error* /*error*/); |
|
1801 |
|
1802 /* Producer line creation functions (.debug_line) */ |
|
1803 Dwarf_Unsigned dwarf_add_directory_decl(Dwarf_P_Debug /*dbg*/, |
|
1804 char* /*name*/, |
|
1805 Dwarf_Error* /*error*/); |
|
1806 |
|
1807 Dwarf_Unsigned dwarf_add_file_decl(Dwarf_P_Debug /*dbg*/, |
|
1808 char* /*name*/, |
|
1809 Dwarf_Unsigned /*dir_index*/, |
|
1810 Dwarf_Unsigned /*time_last_modified*/, |
|
1811 Dwarf_Unsigned /*length*/, |
|
1812 Dwarf_Error* /*error*/); |
|
1813 |
|
1814 Dwarf_Unsigned dwarf_add_line_entry(Dwarf_P_Debug /*dbg*/, |
|
1815 Dwarf_Unsigned /*file_index*/, |
|
1816 Dwarf_Addr /*code_address*/, |
|
1817 Dwarf_Unsigned /*lineno*/, |
|
1818 Dwarf_Signed /*column_number*/, |
|
1819 Dwarf_Bool /*is_source_stmt_begin*/, |
|
1820 Dwarf_Bool /*is_basic_block_begin*/, |
|
1821 Dwarf_Error* /*error*/); |
|
1822 |
|
1823 Dwarf_Unsigned dwarf_lne_set_address(Dwarf_P_Debug /*dbg*/, |
|
1824 Dwarf_Unsigned /*offset*/, |
|
1825 Dwarf_Unsigned /*symbol_index*/, |
|
1826 Dwarf_Error* /*error*/); |
|
1827 |
|
1828 Dwarf_Unsigned dwarf_lne_end_sequence(Dwarf_P_Debug /*dbg*/, |
|
1829 Dwarf_Addr /*end_address*/, |
|
1830 Dwarf_Error* /*error*/); |
|
1831 |
|
1832 /* Producer .debug_frame functions */ |
|
1833 Dwarf_Unsigned dwarf_add_frame_cie(Dwarf_P_Debug /*dbg*/, |
|
1834 char* /*augmenter*/, |
|
1835 Dwarf_Small /*code_alignent_factor*/, |
|
1836 Dwarf_Small /*data_alignment_factor*/, |
|
1837 Dwarf_Small /*return_address_reg*/, |
|
1838 Dwarf_Ptr /*initialization_bytes*/, |
|
1839 Dwarf_Unsigned /*init_byte_len*/, |
|
1840 Dwarf_Error* /*error*/); |
|
1841 |
|
1842 Dwarf_Unsigned dwarf_add_frame_fde( |
|
1843 Dwarf_P_Debug /*dbg*/, |
|
1844 Dwarf_P_Fde /*fde*/, |
|
1845 Dwarf_P_Die /*corresponding subprogram die*/, |
|
1846 Dwarf_Unsigned /*cie_to_use*/, |
|
1847 Dwarf_Unsigned /*virt_addr_of_described_code*/, |
|
1848 Dwarf_Unsigned /*length_of_code*/, |
|
1849 Dwarf_Unsigned /*symbol_index*/, |
|
1850 Dwarf_Error* /*error*/); |
|
1851 |
|
1852 Dwarf_Unsigned dwarf_add_frame_fde_b( |
|
1853 Dwarf_P_Debug /*dbg*/, |
|
1854 Dwarf_P_Fde /*fde*/, |
|
1855 Dwarf_P_Die /*die*/, |
|
1856 Dwarf_Unsigned /*cie*/, |
|
1857 Dwarf_Addr /*virt_addr*/, |
|
1858 Dwarf_Unsigned /*code_len*/, |
|
1859 Dwarf_Unsigned /*sym_idx*/, |
|
1860 Dwarf_Unsigned /*sym_idx_of_end*/, |
|
1861 Dwarf_Addr /*offset_from_end_sym*/, |
|
1862 Dwarf_Error* /*error*/); |
|
1863 |
|
1864 Dwarf_Unsigned dwarf_add_frame_info_b( |
|
1865 Dwarf_P_Debug dbg /*dbg*/, |
|
1866 Dwarf_P_Fde /*fde*/, |
|
1867 Dwarf_P_Die /*die*/, |
|
1868 Dwarf_Unsigned /*cie*/, |
|
1869 Dwarf_Addr /*virt_addr*/, |
|
1870 Dwarf_Unsigned /*code_len*/, |
|
1871 Dwarf_Unsigned /*symidx*/, |
|
1872 Dwarf_Unsigned /* end_symbol */, |
|
1873 Dwarf_Addr /* offset_from_end_symbol */, |
|
1874 Dwarf_Signed /*offset_into_exception_tables*/, |
|
1875 Dwarf_Unsigned /*exception_table_symbol*/, |
|
1876 Dwarf_Error* /*error*/); |
|
1877 |
|
1878 Dwarf_Unsigned dwarf_add_frame_info( |
|
1879 Dwarf_P_Debug dbg /*dbg*/, |
|
1880 Dwarf_P_Fde /*fde*/, |
|
1881 Dwarf_P_Die /*die*/, |
|
1882 Dwarf_Unsigned /*cie*/, |
|
1883 Dwarf_Addr /*virt_addr*/, |
|
1884 Dwarf_Unsigned /*code_len*/, |
|
1885 Dwarf_Unsigned /*symidx*/, |
|
1886 Dwarf_Signed /*offset_into_exception_tables*/, |
|
1887 Dwarf_Unsigned /*exception_table_symbol*/, |
|
1888 Dwarf_Error* /*error*/); |
|
1889 |
|
1890 Dwarf_P_Fde dwarf_add_fde_inst( |
|
1891 Dwarf_P_Fde /*fde*/, |
|
1892 Dwarf_Small /*op*/, |
|
1893 Dwarf_Unsigned /*val1*/, |
|
1894 Dwarf_Unsigned /*val2*/, |
|
1895 Dwarf_Error* /*error*/); |
|
1896 |
|
1897 Dwarf_P_Fde dwarf_new_fde(Dwarf_P_Debug /*dbg*/, Dwarf_Error* /*error*/); |
|
1898 |
|
1899 Dwarf_P_Fde dwarf_fde_cfa_offset( |
|
1900 Dwarf_P_Fde /*fde*/, |
|
1901 Dwarf_Unsigned /*register_number*/, |
|
1902 Dwarf_Signed /*offset*/, |
|
1903 Dwarf_Error* /*error*/); |
|
1904 |
|
1905 /* die creation & addition routines */ |
|
1906 Dwarf_P_Die dwarf_new_die( |
|
1907 Dwarf_P_Debug /*dbg*/, |
|
1908 Dwarf_Tag /*tag*/, |
|
1909 Dwarf_P_Die /*parent*/, |
|
1910 Dwarf_P_Die /*child*/, |
|
1911 Dwarf_P_Die /*left */, |
|
1912 Dwarf_P_Die /*right*/, |
|
1913 Dwarf_Error* /*error*/); |
|
1914 |
|
1915 Dwarf_Unsigned dwarf_add_die_to_debug( |
|
1916 Dwarf_P_Debug /*dbg*/, |
|
1917 Dwarf_P_Die /*die*/, |
|
1918 Dwarf_Error* /*error*/); |
|
1919 |
|
1920 Dwarf_Unsigned dwarf_add_die_marker( |
|
1921 Dwarf_P_Debug /*dbg*/, |
|
1922 Dwarf_P_Die /*die*/, |
|
1923 Dwarf_Unsigned /*marker*/, |
|
1924 Dwarf_Error * /*error*/); |
|
1925 |
|
1926 Dwarf_Unsigned dwarf_get_die_marker( |
|
1927 Dwarf_P_Debug /*dbg*/, |
|
1928 Dwarf_P_Die /*die*/, |
|
1929 Dwarf_Unsigned * /*marker*/, |
|
1930 Dwarf_Error * /*error*/); |
|
1931 |
|
1932 Dwarf_P_Die dwarf_die_link( |
|
1933 Dwarf_P_Die /*die*/, |
|
1934 Dwarf_P_Die /*parent*/, |
|
1935 Dwarf_P_Die /*child*/, |
|
1936 Dwarf_P_Die /*left*/, |
|
1937 Dwarf_P_Die /*right*/, |
|
1938 Dwarf_Error* /*error*/); |
|
1939 |
|
1940 void dwarf_dealloc_compressed_block( |
|
1941 Dwarf_P_Debug, |
|
1942 void * |
|
1943 ); |
|
1944 |
|
1945 void dwarf_dealloc_uncompressed_block( |
|
1946 Dwarf_Debug, |
|
1947 void * |
|
1948 ); |
|
1949 |
|
1950 void * dwarf_compress_integer_block( |
|
1951 Dwarf_P_Debug, /* dbg */ |
|
1952 Dwarf_Bool, /* signed==true (or unsigned) */ |
|
1953 Dwarf_Small, /* size of integer units: 8, 16, 32, 64 */ |
|
1954 void*, /* data */ |
|
1955 Dwarf_Unsigned, /* number of elements */ |
|
1956 Dwarf_Unsigned*, /* number of bytes in output block */ |
|
1957 Dwarf_Error* /* error */ |
|
1958 ); |
|
1959 |
|
1960 void * dwarf_uncompress_integer_block( |
|
1961 Dwarf_Debug, /* dbg */ |
|
1962 Dwarf_Bool, /* signed==true (or unsigned) */ |
|
1963 Dwarf_Small, /* size of integer units: 8, 16, 32, 64 */ |
|
1964 void*, /* data */ |
|
1965 Dwarf_Unsigned, /* number of bytes in input */ |
|
1966 Dwarf_Unsigned*, /* number of units in output block */ |
|
1967 Dwarf_Error* /* error */ |
|
1968 ); |
|
1969 |
|
1970 /* Operations to create location expressions. */ |
|
1971 Dwarf_P_Expr dwarf_new_expr(Dwarf_P_Debug /*dbg*/, Dwarf_Error* /*error*/); |
|
1972 |
|
1973 void dwarf_expr_reset( |
|
1974 Dwarf_P_Expr /*expr*/, |
|
1975 Dwarf_Error* /*error*/); |
|
1976 |
|
1977 Dwarf_Unsigned dwarf_add_expr_gen( |
|
1978 Dwarf_P_Expr /*expr*/, |
|
1979 Dwarf_Small /*opcode*/, |
|
1980 Dwarf_Unsigned /*val1*/, |
|
1981 Dwarf_Unsigned /*val2*/, |
|
1982 Dwarf_Error* /*error*/); |
|
1983 |
|
1984 Dwarf_Unsigned dwarf_add_expr_addr( |
|
1985 Dwarf_P_Expr /*expr*/, |
|
1986 Dwarf_Unsigned /*addr*/, |
|
1987 Dwarf_Signed /*sym_index*/, |
|
1988 Dwarf_Error* /*error*/); |
|
1989 |
|
1990 Dwarf_Unsigned dwarf_add_expr_addr_b( |
|
1991 Dwarf_P_Expr /*expr*/, |
|
1992 Dwarf_Unsigned /*addr*/, |
|
1993 Dwarf_Unsigned /*sym_index*/, |
|
1994 Dwarf_Error* /*error*/); |
|
1995 |
|
1996 Dwarf_Unsigned dwarf_expr_current_offset( |
|
1997 Dwarf_P_Expr /*expr*/, |
|
1998 Dwarf_Error* /*error*/); |
|
1999 |
|
2000 Dwarf_Addr dwarf_expr_into_block( |
|
2001 Dwarf_P_Expr /*expr*/, |
|
2002 Dwarf_Unsigned* /*length*/, |
|
2003 Dwarf_Error* /*error*/); |
|
2004 |
|
2005 Dwarf_Unsigned dwarf_add_arange(Dwarf_P_Debug /*dbg*/, |
|
2006 Dwarf_Addr /*begin_address*/, |
|
2007 Dwarf_Unsigned /*length*/, |
|
2008 Dwarf_Signed /*symbol_index*/, |
|
2009 Dwarf_Error* /*error*/); |
|
2010 |
|
2011 Dwarf_Unsigned dwarf_add_arange_b( |
|
2012 Dwarf_P_Debug /*dbg*/, |
|
2013 Dwarf_Addr /*begin_address*/, |
|
2014 Dwarf_Unsigned /*length*/, |
|
2015 Dwarf_Unsigned /*symbol_index*/, |
|
2016 Dwarf_Unsigned /*end_symbol_index*/, |
|
2017 Dwarf_Addr /*offset_from_end_symbol*/, |
|
2018 Dwarf_Error * /*error*/); |
|
2019 |
|
2020 Dwarf_Unsigned dwarf_add_pubname( |
|
2021 Dwarf_P_Debug /*dbg*/, |
|
2022 Dwarf_P_Die /*die*/, |
|
2023 char* /*pubname_name*/, |
|
2024 Dwarf_Error* /*error*/); |
|
2025 |
|
2026 Dwarf_Unsigned dwarf_add_funcname( |
|
2027 Dwarf_P_Debug /*dbg*/, |
|
2028 Dwarf_P_Die /*die*/, |
|
2029 char* /*func_name*/, |
|
2030 Dwarf_Error* /*error*/); |
|
2031 |
|
2032 Dwarf_Unsigned dwarf_add_typename( |
|
2033 Dwarf_P_Debug /*dbg*/, |
|
2034 Dwarf_P_Die /*die*/, |
|
2035 char* /*type_name*/, |
|
2036 Dwarf_Error* /*error*/); |
|
2037 |
|
2038 Dwarf_Unsigned dwarf_add_varname( |
|
2039 Dwarf_P_Debug /*dbg*/, |
|
2040 Dwarf_P_Die /*die*/, |
|
2041 char* /*var_name*/, |
|
2042 Dwarf_Error* /*error*/); |
|
2043 |
|
2044 Dwarf_Unsigned dwarf_add_weakname( |
|
2045 Dwarf_P_Debug /*dbg*/, |
|
2046 Dwarf_P_Die /*die*/, |
|
2047 char* /*weak_name*/, |
|
2048 Dwarf_Error* /*error*/); |
|
2049 |
|
2050 /* .debug_macinfo producer functions |
|
2051 Functions must be called in right order: the section is output |
|
2052 In the order these are presented. |
|
2053 */ |
|
2054 int dwarf_def_macro(Dwarf_P_Debug /*dbg*/, |
|
2055 Dwarf_Unsigned /*line*/, |
|
2056 char * /*macname, with (arglist), no space before (*/, |
|
2057 char * /*macvalue*/, |
|
2058 Dwarf_Error* /*error*/); |
|
2059 |
|
2060 int dwarf_undef_macro(Dwarf_P_Debug /*dbg*/, |
|
2061 Dwarf_Unsigned /*line*/, |
|
2062 char * /*macname, no arglist, of course*/, |
|
2063 Dwarf_Error* /*error*/); |
|
2064 |
|
2065 int dwarf_start_macro_file(Dwarf_P_Debug /*dbg*/, |
|
2066 Dwarf_Unsigned /*fileindex*/, |
|
2067 Dwarf_Unsigned /*linenumber*/, |
|
2068 Dwarf_Error* /*error*/); |
|
2069 |
|
2070 int dwarf_end_macro_file(Dwarf_P_Debug /*dbg*/, |
|
2071 Dwarf_Error* /*error*/); |
|
2072 |
|
2073 int dwarf_vendor_ext(Dwarf_P_Debug /*dbg*/, |
|
2074 Dwarf_Unsigned /*constant*/, |
|
2075 char * /*string*/, |
|
2076 Dwarf_Error* /*error*/); |
|
2077 |
|
2078 /* end macinfo producer functions */ |
|
2079 |
|
2080 int dwarf_attr_offset(Dwarf_Die /*die*/, |
|
2081 Dwarf_Attribute /*attr of above die*/, |
|
2082 Dwarf_Off * /*returns offset thru this ptr */, |
|
2083 Dwarf_Error * /*error*/); |
|
2084 |
|
2085 /* This is a hack so clients can verify offsets. |
|
2086 Added April 2005 so that debugger can detect broken offsets |
|
2087 (which happened in an IRIX executable larger than 2GB |
|
2088 with MIPSpro 7.3.1.3 toolchain.). |
|
2089 */ |
|
2090 int |
|
2091 dwarf_get_section_max_offsets(Dwarf_Debug /*dbg*/, |
|
2092 Dwarf_Unsigned * /*debug_info_size*/, |
|
2093 Dwarf_Unsigned * /*debug_abbrev_size*/, |
|
2094 Dwarf_Unsigned * /*debug_line_size*/, |
|
2095 Dwarf_Unsigned * /*debug_loc_size*/, |
|
2096 Dwarf_Unsigned * /*debug_aranges_size*/, |
|
2097 Dwarf_Unsigned * /*debug_macinfo_size*/, |
|
2098 Dwarf_Unsigned * /*debug_pubnames_size*/, |
|
2099 Dwarf_Unsigned * /*debug_str_size*/, |
|
2100 Dwarf_Unsigned * /*debug_frame_size*/, |
|
2101 Dwarf_Unsigned * /*debug_ranges_size*/, |
|
2102 Dwarf_Unsigned * /*debug_pubtypes_size*/); |
|
2103 |
|
2104 Dwarf_Half |
|
2105 dwarf_set_frame_rule_inital_value(Dwarf_Debug /*dbg*/, |
|
2106 Dwarf_Half /*value*/); |
|
2107 |
|
2108 Dwarf_Half |
|
2109 dwarf_set_frame_rule_table_size(Dwarf_Debug dbg, |
|
2110 Dwarf_Half value); |
|
2111 |
|
2112 |
|
2113 #ifdef __cplusplus |
|
2114 } |
|
2115 #endif |
|
2116 #endif /* _LIBDWARF_H */ |
|
2117 |