* elf32-spu.c (build_stub): Fix malloc under-allocation.
[binutils.git] / binutils / debug.h
blob1846119b7898e31e4a26f07c617f2f3b39ad0f63
1 /* debug.h -- Describe generic debugging information.
2 Copyright 1995, 1996, 2002, 2003, 2005, 2007, 2009
3 Free Software Foundation, Inc.
4 Written by Ian Lance Taylor <ian@cygnus.com>.
6 This file is part of GNU Binutils.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
21 02110-1301, USA. */
23 #ifndef DEBUG_H
24 #define DEBUG_H
26 /* This header file describes a generic debugging information format.
27 We may eventually have readers which convert different formats into
28 this generic format, and writers which write it out. The initial
29 impetus for this was writing a converter from stabs to HP IEEE-695
30 debugging format. */
32 /* Different kinds of types. */
34 enum debug_type_kind
36 /* Not used. */
37 DEBUG_KIND_ILLEGAL,
38 /* Indirect via a pointer. */
39 DEBUG_KIND_INDIRECT,
40 /* Void. */
41 DEBUG_KIND_VOID,
42 /* Integer. */
43 DEBUG_KIND_INT,
44 /* Floating point. */
45 DEBUG_KIND_FLOAT,
46 /* Complex. */
47 DEBUG_KIND_COMPLEX,
48 /* Boolean. */
49 DEBUG_KIND_BOOL,
50 /* Struct. */
51 DEBUG_KIND_STRUCT,
52 /* Union. */
53 DEBUG_KIND_UNION,
54 /* Class. */
55 DEBUG_KIND_CLASS,
56 /* Union class (can this really happen?). */
57 DEBUG_KIND_UNION_CLASS,
58 /* Enumeration type. */
59 DEBUG_KIND_ENUM,
60 /* Pointer. */
61 DEBUG_KIND_POINTER,
62 /* Function. */
63 DEBUG_KIND_FUNCTION,
64 /* Reference. */
65 DEBUG_KIND_REFERENCE,
66 /* Range. */
67 DEBUG_KIND_RANGE,
68 /* Array. */
69 DEBUG_KIND_ARRAY,
70 /* Set. */
71 DEBUG_KIND_SET,
72 /* Based pointer. */
73 DEBUG_KIND_OFFSET,
74 /* Method. */
75 DEBUG_KIND_METHOD,
76 /* Const qualified type. */
77 DEBUG_KIND_CONST,
78 /* Volatile qualified type. */
79 DEBUG_KIND_VOLATILE,
80 /* Named type. */
81 DEBUG_KIND_NAMED,
82 /* Tagged type. */
83 DEBUG_KIND_TAGGED
86 /* Different kinds of variables. */
88 enum debug_var_kind
90 /* Not used. */
91 DEBUG_VAR_ILLEGAL,
92 /* A global variable. */
93 DEBUG_GLOBAL,
94 /* A static variable. */
95 DEBUG_STATIC,
96 /* A local static variable. */
97 DEBUG_LOCAL_STATIC,
98 /* A local variable. */
99 DEBUG_LOCAL,
100 /* A register variable. */
101 DEBUG_REGISTER
104 /* Different kinds of function parameters. */
106 enum debug_parm_kind
108 /* Not used. */
109 DEBUG_PARM_ILLEGAL,
110 /* A stack based parameter. */
111 DEBUG_PARM_STACK,
112 /* A register parameter. */
113 DEBUG_PARM_REG,
114 /* A stack based reference parameter. */
115 DEBUG_PARM_REFERENCE,
116 /* A register reference parameter. */
117 DEBUG_PARM_REF_REG
120 /* Different kinds of visibility. */
122 enum debug_visibility
124 /* A public field (e.g., a field in a C struct). */
125 DEBUG_VISIBILITY_PUBLIC,
126 /* A protected field. */
127 DEBUG_VISIBILITY_PROTECTED,
128 /* A private field. */
129 DEBUG_VISIBILITY_PRIVATE,
130 /* A field which should be ignored. */
131 DEBUG_VISIBILITY_IGNORE
134 /* A type. */
136 typedef struct debug_type_s *debug_type;
138 #define DEBUG_TYPE_NULL ((debug_type) NULL)
140 /* A field in a struct or union. */
142 typedef struct debug_field_s *debug_field;
144 #define DEBUG_FIELD_NULL ((debug_field) NULL)
146 /* A base class for an object. */
148 typedef struct debug_baseclass_s *debug_baseclass;
150 #define DEBUG_BASECLASS_NULL ((debug_baseclass) NULL)
152 /* A method of an object. */
154 typedef struct debug_method_s *debug_method;
156 #define DEBUG_METHOD_NULL ((debug_method) NULL)
158 /* The arguments to a method function of an object. These indicate
159 which method to run. */
161 typedef struct debug_method_variant_s *debug_method_variant;
163 #define DEBUG_METHOD_VARIANT_NULL ((debug_method_variant) NULL)
165 /* This structure is passed to debug_write. It holds function
166 pointers that debug_write will call based on the accumulated
167 debugging information. */
169 struct debug_write_fns
171 /* This is called at the start of each new compilation unit with the
172 name of the main file in the new unit. */
173 bfd_boolean (*start_compilation_unit) (void *, const char *);
175 /* This is called at the start of each source file within a
176 compilation unit, before outputting any global information for
177 that file. The argument is the name of the file. */
178 bfd_boolean (*start_source) (void *, const char *);
180 /* Each writer must keep a stack of types. */
182 /* Push an empty type onto the type stack. This type can appear if
183 there is a reference to a type which is never defined. */
184 bfd_boolean (*empty_type) (void *);
186 /* Push a void type onto the type stack. */
187 bfd_boolean (*void_type) (void *);
189 /* Push an integer type onto the type stack, given the size and
190 whether it is unsigned. */
191 bfd_boolean (*int_type) (void *, unsigned int, bfd_boolean);
193 /* Push a floating type onto the type stack, given the size. */
194 bfd_boolean (*float_type) (void *, unsigned int);
196 /* Push a complex type onto the type stack, given the size. */
197 bfd_boolean (*complex_type) (void *, unsigned int);
199 /* Push a bfd_boolean type onto the type stack, given the size. */
200 bfd_boolean (*bool_type) (void *, unsigned int);
202 /* Push an enum type onto the type stack, given the tag, a NULL
203 terminated array of names and the associated values. If there is
204 no tag, the tag argument will be NULL. If this is an undefined
205 enum, the names and values arguments will be NULL. */
206 bfd_boolean (*enum_type)
207 (void *, const char *, const char **, bfd_signed_vma *);
209 /* Pop the top type on the type stack, and push a pointer to that
210 type onto the type stack. */
211 bfd_boolean (*pointer_type) (void *);
213 /* Push a function type onto the type stack. The second argument
214 indicates the number of argument types that have been pushed onto
215 the stack. If the number of argument types is passed as -1, then
216 the argument types of the function are unknown, and no types have
217 been pushed onto the stack. The third argument is TRUE if the
218 function takes a variable number of arguments. The return type
219 of the function is pushed onto the type stack below the argument
220 types, if any. */
221 bfd_boolean (*function_type) (void *, int, bfd_boolean);
223 /* Pop the top type on the type stack, and push a reference to that
224 type onto the type stack. */
225 bfd_boolean (*reference_type) (void *);
227 /* Pop the top type on the type stack, and push a range of that type
228 with the given lower and upper bounds onto the type stack. */
229 bfd_boolean (*range_type) (void *, bfd_signed_vma, bfd_signed_vma);
231 /* Push an array type onto the type stack. The top type on the type
232 stack is the range, and the next type on the type stack is the
233 element type. These should be popped before the array type is
234 pushed. The arguments are the lower bound, the upper bound, and
235 whether the array is a string. */
236 bfd_boolean (*array_type)
237 (void *, bfd_signed_vma, bfd_signed_vma, bfd_boolean);
239 /* Pop the top type on the type stack, and push a set of that type
240 onto the type stack. The argument indicates whether this set is
241 a bitstring. */
242 bfd_boolean (*set_type) (void *, bfd_boolean);
244 /* Push an offset type onto the type stack. The top type on the
245 type stack is the target type, and the next type on the type
246 stack is the base type. These should be popped before the offset
247 type is pushed. */
248 bfd_boolean (*offset_type) (void *);
250 /* Push a method type onto the type stack. If the second argument
251 is TRUE, the top type on the stack is the class to which the
252 method belongs; otherwise, the class must be determined by the
253 class to which the method is attached. The third argument is the
254 number of argument types; these are pushed onto the type stack in
255 reverse order (the first type popped is the last argument to the
256 method). A value of -1 for the third argument means that no
257 argument information is available. The fourth argument is TRUE
258 if the function takes a variable number of arguments. The next
259 type on the type stack below the domain and the argument types is
260 the return type of the method. All these types must be popped,
261 and then the method type must be pushed. */
262 bfd_boolean (*method_type) (void *, bfd_boolean, int, bfd_boolean);
264 /* Pop the top type off the type stack, and push a const qualified
265 version of that type onto the type stack. */
266 bfd_boolean (*const_type) (void *);
268 /* Pop the top type off the type stack, and push a volatile
269 qualified version of that type onto the type stack. */
270 bfd_boolean (*volatile_type) (void *);
272 /* Start building a struct. This is followed by calls to the
273 struct_field function, and finished by a call to the
274 end_struct_type function. The second argument is the tag; this
275 will be NULL if there isn't one. If the second argument is NULL,
276 the third argument is a constant identifying this struct for use
277 with tag_type. The fourth argument is TRUE for a struct, FALSE
278 for a union. The fifth argument is the size. If this is an
279 undefined struct or union, the size will be 0 and struct_field
280 will not be called before end_struct_type is called. */
281 bfd_boolean (*start_struct_type)
282 (void *, const char *, unsigned int, bfd_boolean, unsigned int);
284 /* Add a field to the struct type currently being built. The type
285 of the field should be popped off the type stack. The arguments
286 are the name, the bit position, the bit size (may be zero if the
287 field is not packed), and the visibility. */
288 bfd_boolean (*struct_field)
289 (void *, const char *, bfd_vma, bfd_vma, enum debug_visibility);
291 /* Finish building a struct, and push it onto the type stack. */
292 bfd_boolean (*end_struct_type) (void *);
294 /* Start building a class. This is followed by calls to several
295 functions: struct_field, class_static_member, class_baseclass,
296 class_start_method, class_method_variant,
297 class_static_method_variant, and class_end_method. The class is
298 finished by a call to end_class_type. The first five arguments
299 are the same as for start_struct_type. The sixth argument is
300 TRUE if there is a virtual function table; if there is, the
301 seventh argument is TRUE if the virtual function table can be
302 found in the type itself, and is FALSE if the type of the object
303 holding the virtual function table should be popped from the type
304 stack. */
305 bfd_boolean (*start_class_type)
306 (void *, const char *, unsigned int, bfd_boolean, unsigned int,
307 bfd_boolean, bfd_boolean);
309 /* Add a static member to the class currently being built. The
310 arguments are the field name, the physical name, and the
311 visibility. The type must be popped off the type stack. */
312 bfd_boolean (*class_static_member)
313 (void *, const char *, const char *, enum debug_visibility);
315 /* Add a baseclass to the class currently being built. The type of
316 the baseclass must be popped off the type stack. The arguments
317 are the bit position, whether the class is virtual, and the
318 visibility. */
319 bfd_boolean (*class_baseclass)
320 (void *, bfd_vma, bfd_boolean, enum debug_visibility);
322 /* Start adding a method to the class currently being built. This
323 is followed by calls to class_method_variant and
324 class_static_method_variant to describe different variants of the
325 method which take different arguments. The method is finished
326 with a call to class_end_method. The argument is the method
327 name. */
328 bfd_boolean (*class_start_method) (void *, const char *);
330 /* Describe a variant to the class method currently being built.
331 The type of the variant must be popped off the type stack. The
332 second argument is the physical name of the function. The
333 following arguments are the visibility, whether the variant is
334 const, whether the variant is volatile, the offset in the virtual
335 function table, and whether the context is on the type stack
336 (below the variant type). */
337 bfd_boolean (*class_method_variant)
338 (void *, const char *, enum debug_visibility, bfd_boolean,
339 bfd_boolean, bfd_vma, bfd_boolean);
341 /* Describe a static variant to the class method currently being
342 built. The arguments are the same as for class_method_variant,
343 except that the last two arguments are omitted. The type of the
344 variant must be popped off the type stack. */
345 bfd_boolean (*class_static_method_variant)
346 (void *, const char *, enum debug_visibility, bfd_boolean,
347 bfd_boolean);
349 /* Finish describing a class method. */
350 bfd_boolean (*class_end_method) (void *);
352 /* Finish describing a class, and push it onto the type stack. */
353 bfd_boolean (*end_class_type) (void *);
355 /* Push a type on the stack which was given a name by an earlier
356 call to typdef. */
357 bfd_boolean (*typedef_type) (void *, const char *);
359 /* Push a tagged type on the stack which was defined earlier. If
360 the second argument is not NULL, the type was defined by a call
361 to tag. If the second argument is NULL, the type was defined by
362 a call to start_struct_type or start_class_type with a tag of
363 NULL and the number of the third argument. Either way, the
364 fourth argument is the tag kind. Note that this may be called
365 for a struct (class) being defined, in between the call to
366 start_struct_type (start_class_type) and the call to
367 end_struct_type (end_class_type). */
368 bfd_boolean (*tag_type)
369 (void *, const char *, unsigned int, enum debug_type_kind);
371 /* Pop the type stack, and typedef it to the given name. */
372 bfd_boolean (*typdef) (void *, const char *);
374 /* Pop the type stack, and declare it as a tagged struct or union or
375 enum or whatever. The tag passed down here is redundant, since
376 was also passed when enum_type, start_struct_type, or
377 start_class_type was called. */
378 bfd_boolean (*tag) (void *, const char *);
380 /* This is called to record a named integer constant. */
381 bfd_boolean (*int_constant) (void *, const char *, bfd_vma);
383 /* This is called to record a named floating point constant. */
384 bfd_boolean (*float_constant) (void *, const char *, double);
386 /* This is called to record a typed integer constant. The type is
387 popped off the type stack. */
388 bfd_boolean (*typed_constant) (void *, const char *, bfd_vma);
390 /* This is called to record a variable. The type is popped off the
391 type stack. */
392 bfd_boolean (*variable)
393 (void *, const char *, enum debug_var_kind, bfd_vma);
395 /* Start writing out a function. The return type must be popped off
396 the stack. The bfd_boolean is TRUE if the function is global. This
397 is followed by calls to function_parameter, followed by block
398 information. */
399 bfd_boolean (*start_function) (void *, const char *, bfd_boolean);
401 /* Record a function parameter for the current function. The type
402 must be popped off the stack. */
403 bfd_boolean (*function_parameter)
404 (void *, const char *, enum debug_parm_kind, bfd_vma);
406 /* Start writing out a block. There is at least one top level block
407 per function. Blocks may be nested. The argument is the
408 starting address of the block. */
409 bfd_boolean (*start_block) (void *, bfd_vma);
411 /* Finish writing out a block. The argument is the ending address
412 of the block. */
413 bfd_boolean (*end_block) (void *, bfd_vma);
415 /* Finish writing out a function. */
416 bfd_boolean (*end_function) (void *);
418 /* Record line number information for the current compilation unit. */
419 bfd_boolean (*lineno) (void *, const char *, unsigned long, bfd_vma);
422 /* Exported functions. */
424 /* The first argument to most of these functions is a handle. This
425 handle is returned by the debug_init function. The purpose of the
426 handle is to permit the debugging routines to not use static
427 variables, and hence to be reentrant. This would be useful for a
428 program which wanted to handle two executables simultaneously. */
430 /* Return a debugging handle. */
432 extern void *debug_init (void);
434 /* Set the source filename. This implicitly starts a new compilation
435 unit. */
437 extern bfd_boolean debug_set_filename (void *, const char *);
439 /* Change source files to the given file name. This is used for
440 include files in a single compilation unit. */
442 extern bfd_boolean debug_start_source (void *, const char *);
444 /* Record a function definition. This implicitly starts a function
445 block. The debug_type argument is the type of the return value.
446 The bfd_boolean indicates whether the function is globally visible.
447 The bfd_vma is the address of the start of the function. Currently
448 the parameter types are specified by calls to
449 debug_record_parameter. */
451 extern bfd_boolean debug_record_function
452 (void *, const char *, debug_type, bfd_boolean, bfd_vma);
454 /* Record a parameter for the current function. */
456 extern bfd_boolean debug_record_parameter
457 (void *, const char *, debug_type, enum debug_parm_kind, bfd_vma);
459 /* End a function definition. The argument is the address where the
460 function ends. */
462 extern bfd_boolean debug_end_function (void *, bfd_vma);
464 /* Start a block in a function. All local information will be
465 recorded in this block, until the matching call to debug_end_block.
466 debug_start_block and debug_end_block may be nested. The argument
467 is the address at which this block starts. */
469 extern bfd_boolean debug_start_block (void *, bfd_vma);
471 /* Finish a block in a function. This matches the call to
472 debug_start_block. The argument is the address at which this block
473 ends. */
475 extern bfd_boolean debug_end_block (void *, bfd_vma);
477 /* Associate a line number in the current source file with a given
478 address. */
480 extern bfd_boolean debug_record_line (void *, unsigned long, bfd_vma);
482 /* Start a named common block. This is a block of variables that may
483 move in memory. */
485 extern bfd_boolean debug_start_common_block (void *, const char *);
487 /* End a named common block. */
489 extern bfd_boolean debug_end_common_block (void *, const char *);
491 /* Record a named integer constant. */
493 extern bfd_boolean debug_record_int_const (void *, const char *, bfd_vma);
495 /* Record a named floating point constant. */
497 extern bfd_boolean debug_record_float_const (void *, const char *, double);
499 /* Record a typed constant with an integral value. */
501 extern bfd_boolean debug_record_typed_const
502 (void *, const char *, debug_type, bfd_vma);
504 /* Record a label. */
506 extern bfd_boolean debug_record_label
507 (void *, const char *, debug_type, bfd_vma);
509 /* Record a variable. */
511 extern bfd_boolean debug_record_variable
512 (void *, const char *, debug_type, enum debug_var_kind, bfd_vma);
514 /* Make an indirect type. The first argument is a pointer to the
515 location where the real type will be placed. The second argument
516 is the type tag, if there is one; this may be NULL; the only
517 purpose of this argument is so that debug_get_type_name can return
518 something useful. This function may be used when a type is
519 referenced before it is defined. */
521 extern debug_type debug_make_indirect_type
522 (void *, debug_type *, const char *);
524 /* Make a void type. */
526 extern debug_type debug_make_void_type (void *);
528 /* Make an integer type of a given size. The bfd_boolean argument is TRUE
529 if the integer is unsigned. */
531 extern debug_type debug_make_int_type (void *, unsigned int, bfd_boolean);
533 /* Make a floating point type of a given size. FIXME: On some
534 platforms, like an Alpha, you probably need to be able to specify
535 the format. */
537 extern debug_type debug_make_float_type (void *, unsigned int);
539 /* Make a boolean type of a given size. */
541 extern debug_type debug_make_bool_type (void *, unsigned int);
543 /* Make a complex type of a given size. */
545 extern debug_type debug_make_complex_type (void *, unsigned int);
547 /* Make a structure type. The second argument is TRUE for a struct,
548 FALSE for a union. The third argument is the size of the struct.
549 The fourth argument is a NULL terminated array of fields. */
551 extern debug_type debug_make_struct_type
552 (void *, bfd_boolean, bfd_vma, debug_field *);
554 /* Make an object type. The first three arguments after the handle
555 are the same as for debug_make_struct_type. The next arguments are
556 a NULL terminated array of base classes, a NULL terminated array of
557 methods, the type of the object holding the virtual function table
558 if it is not this object, and a bfd_boolean which is TRUE if this
559 object has its own virtual function table. */
561 extern debug_type debug_make_object_type
562 (void *, bfd_boolean, bfd_vma, debug_field *, debug_baseclass *,
563 debug_method *, debug_type, bfd_boolean);
565 /* Make an enumeration type. The arguments are a null terminated
566 array of strings, and an array of corresponding values. */
568 extern debug_type debug_make_enum_type
569 (void *, const char **, bfd_signed_vma *);
571 /* Make a pointer to a given type. */
573 extern debug_type debug_make_pointer_type (void *, debug_type);
575 /* Make a function type. The second argument is the return type. The
576 third argument is a NULL terminated array of argument types. The
577 fourth argument is TRUE if the function takes a variable number of
578 arguments. If the third argument is NULL, then the argument types
579 are unknown. */
581 extern debug_type debug_make_function_type
582 (void *, debug_type, debug_type *, bfd_boolean);
584 /* Make a reference to a given type. */
586 extern debug_type debug_make_reference_type (void *, debug_type);
588 /* Make a range of a given type from a lower to an upper bound. */
590 extern debug_type debug_make_range_type
591 (void *, debug_type, bfd_signed_vma, bfd_signed_vma);
593 /* Make an array type. The second argument is the type of an element
594 of the array. The third argument is the type of a range of the
595 array. The fourth and fifth argument are the lower and upper
596 bounds, respectively (if the bounds are not known, lower should be
597 0 and upper should be -1). The sixth argument is TRUE if this
598 array is actually a string, as in C. */
600 extern debug_type debug_make_array_type
601 (void *, debug_type, debug_type, bfd_signed_vma, bfd_signed_vma,
602 bfd_boolean);
604 /* Make a set of a given type. For example, a Pascal set type. The
605 bfd_boolean argument is TRUE if this set is actually a bitstring, as in
606 CHILL. */
608 extern debug_type debug_make_set_type (void *, debug_type, bfd_boolean);
610 /* Make a type for a pointer which is relative to an object. The
611 second argument is the type of the object to which the pointer is
612 relative. The third argument is the type that the pointer points
613 to. */
615 extern debug_type debug_make_offset_type (void *, debug_type, debug_type);
617 /* Make a type for a method function. The second argument is the
618 return type. The third argument is the domain. The fourth
619 argument is a NULL terminated array of argument types. The fifth
620 argument is TRUE if the function takes a variable number of
621 arguments, in which case the array of argument types indicates the
622 types of the first arguments. The domain and the argument array
623 may be NULL, in which case this is a stub method and that
624 information is not available. Stabs debugging uses this, and gets
625 the argument types from the mangled name. */
627 extern debug_type debug_make_method_type
628 (void *, debug_type, debug_type, debug_type *, bfd_boolean);
630 /* Make a const qualified version of a given type. */
632 extern debug_type debug_make_const_type (void *, debug_type);
634 /* Make a volatile qualified version of a given type. */
636 extern debug_type debug_make_volatile_type (void *, debug_type);
638 /* Make an undefined tagged type. For example, a struct which has
639 been mentioned, but not defined. */
641 extern debug_type debug_make_undefined_tagged_type
642 (void *, const char *, enum debug_type_kind);
644 /* Make a base class for an object. The second argument is the base
645 class type. The third argument is the bit position of this base
646 class in the object. The fourth argument is whether this is a
647 virtual class. The fifth argument is the visibility of the base
648 class. */
650 extern debug_baseclass debug_make_baseclass
651 (void *, debug_type, bfd_vma, bfd_boolean, enum debug_visibility);
653 /* Make a field for a struct. The second argument is the name. The
654 third argument is the type of the field. The fourth argument is
655 the bit position of the field. The fifth argument is the size of
656 the field (it may be zero). The sixth argument is the visibility
657 of the field. */
659 extern debug_field debug_make_field
660 (void *, const char *, debug_type, bfd_vma, bfd_vma, enum debug_visibility);
662 /* Make a static member of an object. The second argument is the
663 name. The third argument is the type of the member. The fourth
664 argument is the physical name of the member (i.e., the name as a
665 global variable). The fifth argument is the visibility of the
666 member. */
668 extern debug_field debug_make_static_member
669 (void *, const char *, debug_type, const char *, enum debug_visibility);
671 /* Make a method. The second argument is the name, and the third
672 argument is a NULL terminated array of method variants. Each
673 method variant is a method with this name but with different
674 argument types. */
676 extern debug_method debug_make_method
677 (void *, const char *, debug_method_variant *);
679 /* Make a method variant. The second argument is the physical name of
680 the function. The third argument is the type of the function,
681 probably constructed by debug_make_method_type. The fourth
682 argument is the visibility. The fifth argument is whether this is
683 a const function. The sixth argument is whether this is a volatile
684 function. The seventh argument is the index in the virtual
685 function table, if any. The eighth argument is the virtual
686 function context. */
688 extern debug_method_variant debug_make_method_variant
689 (void *, const char *, debug_type, enum debug_visibility, bfd_boolean,
690 bfd_boolean, bfd_vma, debug_type);
692 /* Make a static method argument. The arguments are the same as for
693 debug_make_method_variant, except that the last two are omitted
694 since a static method can not also be virtual. */
696 extern debug_method_variant debug_make_static_method_variant
697 (void *, const char *, debug_type, enum debug_visibility, bfd_boolean,
698 bfd_boolean);
700 /* Name a type. This returns a new type with an attached name. */
702 extern debug_type debug_name_type (void *, const char *, debug_type);
704 /* Give a tag to a type, such as a struct or union. This returns a
705 new type with an attached tag. */
707 extern debug_type debug_tag_type (void *, const char *, debug_type);
709 /* Record the size of a given type. */
711 extern bfd_boolean debug_record_type_size (void *, debug_type, unsigned int);
713 /* Find a named type. */
715 extern debug_type debug_find_named_type (void *, const char *);
717 /* Find a tagged type. */
719 extern debug_type debug_find_tagged_type
720 (void *, const char *, enum debug_type_kind);
722 /* Get the kind of a type. */
724 extern enum debug_type_kind debug_get_type_kind (void *, debug_type);
726 /* Get the name of a type. */
728 extern const char *debug_get_type_name (void *, debug_type);
730 /* Get the size of a type. */
732 extern bfd_vma debug_get_type_size (void *, debug_type);
734 /* Get the return type of a function or method type. */
736 extern debug_type debug_get_return_type (void *, debug_type);
738 /* Get the NULL terminated array of parameter types for a function or
739 method type (actually, parameter types are not currently stored for
740 function types). This may be used to determine whether a method
741 type is a stub method or not. The last argument points to a
742 bfd_boolean which is set to TRUE if the function takes a variable
743 number of arguments. */
745 extern const debug_type *debug_get_parameter_types
746 (void *, debug_type, bfd_boolean *);
748 /* Get the target type of a pointer or reference or const or volatile
749 type. */
751 extern debug_type debug_get_target_type (void *, debug_type);
753 /* Get the NULL terminated array of fields for a struct, union, or
754 class. */
756 extern const debug_field *debug_get_fields (void *, debug_type);
758 /* Get the type of a field. */
760 extern debug_type debug_get_field_type (void *, debug_field);
762 /* Get the name of a field. */
764 extern const char *debug_get_field_name (void *, debug_field);
766 /* Get the bit position of a field within the containing structure.
767 If the field is a static member, this will return (bfd_vma) -1. */
769 extern bfd_vma debug_get_field_bitpos (void *, debug_field);
771 /* Get the bit size of a field. If the field is a static member, this
772 will return (bfd_vma) -1. */
774 extern bfd_vma debug_get_field_bitsize (void *, debug_field);
776 /* Get the visibility of a field. */
778 extern enum debug_visibility debug_get_field_visibility (void *, debug_field);
780 /* Get the physical name of a field, if it is a static member. If the
781 field is not a static member, this will return NULL. */
783 extern const char *debug_get_field_physname (void *, debug_field);
785 /* Write out the recorded debugging information. This takes a set of
786 function pointers which are called to do the actual writing. The
787 first void * is the debugging handle. The second void * is a handle
788 which is passed to the functions. */
790 extern bfd_boolean debug_write
791 (void *, const struct debug_write_fns *, void *);
793 #endif /* DEBUG_H */