* MAINTAINERS: Add myself as Xtensa maintainer.
[binutils.git] / binutils / debug.h
blobd53210e5b747cdc96fc299079b74c1194c2621bc
1 /* debug.h -- Describe generic debugging information.
2 Copyright 1995, 1996, 2002 Free Software Foundation, Inc.
3 Written by Ian Lance Taylor <ian@cygnus.com>.
5 This file is part of GNU Binutils.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
22 #ifndef DEBUG_H
23 #define DEBUG_H
25 /* This header file describes a generic debugging information format.
26 We may eventually have readers which convert different formats into
27 this generic format, and writers which write it out. The initial
28 impetus for this was writing a convertor from stabs to HP IEEE-695
29 debugging format. */
31 /* Different kinds of types. */
33 enum debug_type_kind
35 /* Not used. */
36 DEBUG_KIND_ILLEGAL,
37 /* Indirect via a pointer. */
38 DEBUG_KIND_INDIRECT,
39 /* Void. */
40 DEBUG_KIND_VOID,
41 /* Integer. */
42 DEBUG_KIND_INT,
43 /* Floating point. */
44 DEBUG_KIND_FLOAT,
45 /* Complex. */
46 DEBUG_KIND_COMPLEX,
47 /* Boolean. */
48 DEBUG_KIND_BOOL,
49 /* Struct. */
50 DEBUG_KIND_STRUCT,
51 /* Union. */
52 DEBUG_KIND_UNION,
53 /* Class. */
54 DEBUG_KIND_CLASS,
55 /* Union class (can this really happen?). */
56 DEBUG_KIND_UNION_CLASS,
57 /* Enumeration type. */
58 DEBUG_KIND_ENUM,
59 /* Pointer. */
60 DEBUG_KIND_POINTER,
61 /* Function. */
62 DEBUG_KIND_FUNCTION,
63 /* Reference. */
64 DEBUG_KIND_REFERENCE,
65 /* Range. */
66 DEBUG_KIND_RANGE,
67 /* Array. */
68 DEBUG_KIND_ARRAY,
69 /* Set. */
70 DEBUG_KIND_SET,
71 /* Based pointer. */
72 DEBUG_KIND_OFFSET,
73 /* Method. */
74 DEBUG_KIND_METHOD,
75 /* Const qualified type. */
76 DEBUG_KIND_CONST,
77 /* Volatile qualified type. */
78 DEBUG_KIND_VOLATILE,
79 /* Named type. */
80 DEBUG_KIND_NAMED,
81 /* Tagged type. */
82 DEBUG_KIND_TAGGED
85 /* Different kinds of variables. */
87 enum debug_var_kind
89 /* Not used. */
90 DEBUG_VAR_ILLEGAL,
91 /* A global variable. */
92 DEBUG_GLOBAL,
93 /* A static variable. */
94 DEBUG_STATIC,
95 /* A local static variable. */
96 DEBUG_LOCAL_STATIC,
97 /* A local variable. */
98 DEBUG_LOCAL,
99 /* A register variable. */
100 DEBUG_REGISTER
103 /* Different kinds of function parameters. */
105 enum debug_parm_kind
107 /* Not used. */
108 DEBUG_PARM_ILLEGAL,
109 /* A stack based parameter. */
110 DEBUG_PARM_STACK,
111 /* A register parameter. */
112 DEBUG_PARM_REG,
113 /* A stack based reference parameter. */
114 DEBUG_PARM_REFERENCE,
115 /* A register reference parameter. */
116 DEBUG_PARM_REF_REG
119 /* Different kinds of visibility. */
121 enum debug_visibility
123 /* A public field (e.g., a field in a C struct). */
124 DEBUG_VISIBILITY_PUBLIC,
125 /* A protected field. */
126 DEBUG_VISIBILITY_PROTECTED,
127 /* A private field. */
128 DEBUG_VISIBILITY_PRIVATE,
129 /* A field which should be ignored. */
130 DEBUG_VISIBILITY_IGNORE
133 /* A type. */
135 typedef struct debug_type *debug_type;
137 #define DEBUG_TYPE_NULL ((debug_type) NULL)
139 /* A field in a struct or union. */
141 typedef struct debug_field *debug_field;
143 #define DEBUG_FIELD_NULL ((debug_field) NULL)
145 /* A base class for an object. */
147 typedef struct debug_baseclass *debug_baseclass;
149 #define DEBUG_BASECLASS_NULL ((debug_baseclass) NULL)
151 /* A method of an object. */
153 typedef struct debug_method *debug_method;
155 #define DEBUG_METHOD_NULL ((debug_method) NULL)
157 /* The arguments to a method function of an object. These indicate
158 which method to run. */
160 typedef struct debug_method_variant *debug_method_variant;
162 #define DEBUG_METHOD_VARIANT_NULL ((debug_method_variant) NULL)
164 /* This structure is passed to debug_write. It holds function
165 pointers that debug_write will call based on the accumulated
166 debugging information. */
168 struct debug_write_fns
170 /* This is called at the start of each new compilation unit with the
171 name of the main file in the new unit. */
172 bfd_boolean (*start_compilation_unit) PARAMS ((PTR, const char *));
174 /* This is called at the start of each source file within a
175 compilation unit, before outputting any global information for
176 that file. The argument is the name of the file. */
177 bfd_boolean (*start_source) PARAMS ((PTR, const char *));
179 /* Each writer must keep a stack of types. */
181 /* Push an empty type onto the type stack. This type can appear if
182 there is a reference to a type which is never defined. */
183 bfd_boolean (*empty_type) PARAMS ((PTR));
185 /* Push a void type onto the type stack. */
186 bfd_boolean (*void_type) PARAMS ((PTR));
188 /* Push an integer type onto the type stack, given the size and
189 whether it is unsigned. */
190 bfd_boolean (*int_type) PARAMS ((PTR, unsigned int, bfd_boolean));
192 /* Push a floating type onto the type stack, given the size. */
193 bfd_boolean (*float_type) PARAMS ((PTR, unsigned int));
195 /* Push a complex type onto the type stack, given the size. */
196 bfd_boolean (*complex_type) PARAMS ((PTR, unsigned int));
198 /* Push a bfd_boolean type onto the type stack, given the size. */
199 bfd_boolean (*bool_type) PARAMS ((PTR, unsigned int));
201 /* Push an enum type onto the type stack, given the tag, a NULL
202 terminated array of names and the associated values. If there is
203 no tag, the tag argument will be NULL. If this is an undefined
204 enum, the names and values arguments will be NULL. */
205 bfd_boolean (*enum_type)
206 PARAMS ((PTR, const char *, const char **, bfd_signed_vma *));
208 /* Pop the top type on the type stack, and push a pointer to that
209 type onto the type stack. */
210 bfd_boolean (*pointer_type) PARAMS ((PTR));
212 /* Push a function type onto the type stack. The second argument
213 indicates the number of argument types that have been pushed onto
214 the stack. If the number of argument types is passed as -1, then
215 the argument types of the function are unknown, and no types have
216 been pushed onto the stack. The third argument is TRUE if the
217 function takes a variable number of arguments. The return type
218 of the function is pushed onto the type stack below the argument
219 types, if any. */
220 bfd_boolean (*function_type) PARAMS ((PTR, int, bfd_boolean));
222 /* Pop the top type on the type stack, and push a reference to that
223 type onto the type stack. */
224 bfd_boolean (*reference_type) PARAMS ((PTR));
226 /* Pop the top type on the type stack, and push a range of that type
227 with the given lower and upper bounds onto the type stack. */
228 bfd_boolean (*range_type) PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma));
230 /* Push an array type onto the type stack. The top type on the type
231 stack is the range, and the next type on the type stack is the
232 element type. These should be popped before the array type is
233 pushed. The arguments are the lower bound, the upper bound, and
234 whether the array is a string. */
235 bfd_boolean (*array_type)
236 PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma, bfd_boolean));
238 /* Pop the top type on the type stack, and push a set of that type
239 onto the type stack. The argument indicates whether this set is
240 a bitstring. */
241 bfd_boolean (*set_type) PARAMS ((PTR, bfd_boolean));
243 /* Push an offset type onto the type stack. The top type on the
244 type stack is the target type, and the next type on the type
245 stack is the base type. These should be popped before the offset
246 type is pushed. */
247 bfd_boolean (*offset_type) PARAMS ((PTR));
249 /* Push a method type onto the type stack. If the second argument
250 is TRUE, the top type on the stack is the class to which the
251 method belongs; otherwise, the class must be determined by the
252 class to which the method is attached. The third argument is the
253 number of argument types; these are pushed onto the type stack in
254 reverse order (the first type popped is the last argument to the
255 method). A value of -1 for the third argument means that no
256 argument information is available. The fourth argument is TRUE
257 if the function takes a variable number of arguments. The next
258 type on the type stack below the domain and the argument types is
259 the return type of the method. All these types must be popped,
260 and then the method type must be pushed. */
261 bfd_boolean (*method_type) PARAMS ((PTR, bfd_boolean, int, bfd_boolean));
263 /* Pop the top type off the type stack, and push a const qualified
264 version of that type onto the type stack. */
265 bfd_boolean (*const_type) PARAMS ((PTR));
267 /* Pop the top type off the type stack, and push a volatile
268 qualified version of that type onto the type stack. */
269 bfd_boolean (*volatile_type) PARAMS ((PTR));
271 /* Start building a struct. This is followed by calls to the
272 struct_field function, and finished by a call to the
273 end_struct_type function. The second argument is the tag; this
274 will be NULL if there isn't one. If the second argument is NULL,
275 the third argument is a constant identifying this struct for use
276 with tag_type. The fourth argument is TRUE for a struct, FALSE
277 for a union. The fifth argument is the size. If this is an
278 undefined struct or union, the size will be 0 and struct_field
279 will not be called before end_struct_type is called. */
280 bfd_boolean (*start_struct_type)
281 PARAMS ((PTR, const char *, unsigned int, bfd_boolean, unsigned int));
283 /* Add a field to the struct type currently being built. The type
284 of the field should be popped off the type stack. The arguments
285 are the name, the bit position, the bit size (may be zero if the
286 field is not packed), and the visibility. */
287 bfd_boolean (*struct_field)
288 PARAMS ((PTR, const char *, bfd_vma, bfd_vma, enum debug_visibility));
290 /* Finish building a struct, and push it onto the type stack. */
291 bfd_boolean (*end_struct_type) PARAMS ((PTR));
293 /* Start building a class. This is followed by calls to several
294 functions: struct_field, class_static_member, class_baseclass,
295 class_start_method, class_method_variant,
296 class_static_method_variant, and class_end_method. The class is
297 finished by a call to end_class_type. The first five arguments
298 are the same as for start_struct_type. The sixth argument is
299 TRUE if there is a virtual function table; if there is, the
300 seventh argument is TRUE if the virtual function table can be
301 found in the type itself, and is FALSE if the type of the object
302 holding the virtual function table should be popped from the type
303 stack. */
304 bfd_boolean (*start_class_type)
305 PARAMS ((PTR, const char *, unsigned int, bfd_boolean, unsigned int,
306 bfd_boolean, bfd_boolean));
308 /* Add a static member to the class currently being built. The
309 arguments are the field name, the physical name, and the
310 visibility. The type must be popped off the type stack. */
311 bfd_boolean (*class_static_member)
312 PARAMS ((PTR, const char *, const char *, enum debug_visibility));
314 /* Add a baseclass to the class currently being built. The type of
315 the baseclass must be popped off the type stack. The arguments
316 are the bit position, whether the class is virtual, and the
317 visibility. */
318 bfd_boolean (*class_baseclass)
319 PARAMS ((PTR, bfd_vma, bfd_boolean, enum debug_visibility));
321 /* Start adding a method to the class currently being built. This
322 is followed by calls to class_method_variant and
323 class_static_method_variant to describe different variants of the
324 method which take different arguments. The method is finished
325 with a call to class_end_method. The argument is the method
326 name. */
327 bfd_boolean (*class_start_method) PARAMS ((PTR, const char *));
329 /* Describe a variant to the class method currently being built.
330 The type of the variant must be popped off the type stack. The
331 second argument is the physical name of the function. The
332 following arguments are the visibility, whether the variant is
333 const, whether the variant is volatile, the offset in the virtual
334 function table, and whether the context is on the type stack
335 (below the variant type). */
336 bfd_boolean (*class_method_variant)
337 PARAMS ((PTR, const char *, enum debug_visibility, bfd_boolean,
338 bfd_boolean, bfd_vma, bfd_boolean));
340 /* Describe a static variant to the class method currently being
341 built. The arguments are the same as for class_method_variant,
342 except that the last two arguments are omitted. The type of the
343 variant must be popped off the type stack. */
344 bfd_boolean (*class_static_method_variant)
345 PARAMS ((PTR, const char *, enum debug_visibility, bfd_boolean,
346 bfd_boolean));
348 /* Finish describing a class method. */
349 bfd_boolean (*class_end_method) PARAMS ((PTR));
351 /* Finish describing a class, and push it onto the type stack. */
352 bfd_boolean (*end_class_type) PARAMS ((PTR));
354 /* Push a type on the stack which was given a name by an earlier
355 call to typdef. */
356 bfd_boolean (*typedef_type) PARAMS ((PTR, const char *));
358 /* Push a tagged type on the stack which was defined earlier. If
359 the second argument is not NULL, the type was defined by a call
360 to tag. If the second argument is NULL, the type was defined by
361 a call to start_struct_type or start_class_type with a tag of
362 NULL and the number of the third argument. Either way, the
363 fourth argument is the tag kind. Note that this may be called
364 for a struct (class) being defined, in between the call to
365 start_struct_type (start_class_type) and the call to
366 end_struct_type (end_class_type). */
367 bfd_boolean (*tag_type)
368 PARAMS ((PTR, const char *, unsigned int, enum debug_type_kind));
370 /* Pop the type stack, and typedef it to the given name. */
371 bfd_boolean (*typdef) PARAMS ((PTR, const char *));
373 /* Pop the type stack, and declare it as a tagged struct or union or
374 enum or whatever. The tag passed down here is redundant, since
375 was also passed when enum_type, start_struct_type, or
376 start_class_type was called. */
377 bfd_boolean (*tag) PARAMS ((PTR, const char *));
379 /* This is called to record a named integer constant. */
380 bfd_boolean (*int_constant) PARAMS ((PTR, const char *, bfd_vma));
382 /* This is called to record a named floating point constant. */
383 bfd_boolean (*float_constant) PARAMS ((PTR, const char *, double));
385 /* This is called to record a typed integer constant. The type is
386 popped off the type stack. */
387 bfd_boolean (*typed_constant) PARAMS ((PTR, const char *, bfd_vma));
389 /* This is called to record a variable. The type is popped off the
390 type stack. */
391 bfd_boolean (*variable)
392 PARAMS ((PTR, const char *, enum debug_var_kind, bfd_vma));
394 /* Start writing out a function. The return type must be popped off
395 the stack. The bfd_boolean is TRUE if the function is global. This
396 is followed by calls to function_parameter, followed by block
397 information. */
398 bfd_boolean (*start_function) PARAMS ((PTR, const char *, bfd_boolean));
400 /* Record a function parameter for the current function. The type
401 must be popped off the stack. */
402 bfd_boolean (*function_parameter)
403 PARAMS ((PTR, const char *, enum debug_parm_kind, bfd_vma));
405 /* Start writing out a block. There is at least one top level block
406 per function. Blocks may be nested. The argument is the
407 starting address of the block. */
408 bfd_boolean (*start_block) PARAMS ((PTR, bfd_vma));
410 /* Finish writing out a block. The argument is the ending address
411 of the block. */
412 bfd_boolean (*end_block) PARAMS ((PTR, bfd_vma));
414 /* Finish writing out a function. */
415 bfd_boolean (*end_function) PARAMS ((PTR));
417 /* Record line number information for the current compilation unit. */
418 bfd_boolean (*lineno) PARAMS ((PTR, const char *, unsigned long, bfd_vma));
421 /* Exported functions. */
423 /* The first argument to most of these functions is a handle. This
424 handle is returned by the debug_init function. The purpose of the
425 handle is to permit the debugging routines to not use static
426 variables, and hence to be reentrant. This would be useful for a
427 program which wanted to handle two executables simultaneously. */
429 /* Return a debugging handle. */
431 extern PTR debug_init PARAMS ((void));
433 /* Set the source filename. This implicitly starts a new compilation
434 unit. */
436 extern bfd_boolean debug_set_filename PARAMS ((PTR, const char *));
438 /* Change source files to the given file name. This is used for
439 include files in a single compilation unit. */
441 extern bfd_boolean debug_start_source PARAMS ((PTR, const char *));
443 /* Record a function definition. This implicitly starts a function
444 block. The debug_type argument is the type of the return value.
445 The bfd_boolean indicates whether the function is globally visible.
446 The bfd_vma is the address of the start of the function. Currently
447 the parameter types are specified by calls to
448 debug_record_parameter. */
450 extern bfd_boolean debug_record_function
451 PARAMS ((PTR, const char *, debug_type, bfd_boolean, bfd_vma));
453 /* Record a parameter for the current function. */
455 extern bfd_boolean debug_record_parameter
456 PARAMS ((PTR, const char *, debug_type, enum debug_parm_kind, bfd_vma));
458 /* End a function definition. The argument is the address where the
459 function ends. */
461 extern bfd_boolean debug_end_function PARAMS ((PTR, bfd_vma));
463 /* Start a block in a function. All local information will be
464 recorded in this block, until the matching call to debug_end_block.
465 debug_start_block and debug_end_block may be nested. The argument
466 is the address at which this block starts. */
468 extern bfd_boolean debug_start_block PARAMS ((PTR, bfd_vma));
470 /* Finish a block in a function. This matches the call to
471 debug_start_block. The argument is the address at which this block
472 ends. */
474 extern bfd_boolean debug_end_block PARAMS ((PTR, bfd_vma));
476 /* Associate a line number in the current source file with a given
477 address. */
479 extern bfd_boolean debug_record_line PARAMS ((PTR, unsigned long, bfd_vma));
481 /* Start a named common block. This is a block of variables that may
482 move in memory. */
484 extern bfd_boolean debug_start_common_block PARAMS ((PTR, const char *));
486 /* End a named common block. */
488 extern bfd_boolean debug_end_common_block PARAMS ((PTR, const char *));
490 /* Record a named integer constant. */
492 extern bfd_boolean debug_record_int_const
493 PARAMS ((PTR, const char *, bfd_vma));
495 /* Record a named floating point constant. */
497 extern bfd_boolean debug_record_float_const
498 PARAMS ((PTR, const char *, double));
500 /* Record a typed constant with an integral value. */
502 extern bfd_boolean debug_record_typed_const
503 PARAMS ((PTR, const char *, debug_type, bfd_vma));
505 /* Record a label. */
507 extern bfd_boolean debug_record_label
508 PARAMS ((PTR, const char *, debug_type, bfd_vma));
510 /* Record a variable. */
512 extern bfd_boolean debug_record_variable
513 PARAMS ((PTR, const char *, debug_type, enum debug_var_kind, bfd_vma));
515 /* Make an indirect type. The first argument is a pointer to the
516 location where the real type will be placed. The second argument
517 is the type tag, if there is one; this may be NULL; the only
518 purpose of this argument is so that debug_get_type_name can return
519 something useful. This function may be used when a type is
520 referenced before it is defined. */
522 extern debug_type debug_make_indirect_type
523 PARAMS ((PTR, debug_type *, const char *));
525 /* Make a void type. */
527 extern debug_type debug_make_void_type PARAMS ((PTR));
529 /* Make an integer type of a given size. The bfd_boolean argument is TRUE
530 if the integer is unsigned. */
532 extern debug_type debug_make_int_type
533 PARAMS ((PTR, unsigned int, bfd_boolean));
535 /* Make a floating point type of a given size. FIXME: On some
536 platforms, like an Alpha, you probably need to be able to specify
537 the format. */
539 extern debug_type debug_make_float_type PARAMS ((PTR, unsigned int));
541 /* Make a boolean type of a given size. */
543 extern debug_type debug_make_bool_type PARAMS ((PTR, unsigned int));
545 /* Make a complex type of a given size. */
547 extern debug_type debug_make_complex_type PARAMS ((PTR, unsigned int));
549 /* Make a structure type. The second argument is TRUE for a struct,
550 FALSE for a union. The third argument is the size of the struct.
551 The fourth argument is a NULL terminated array of fields. */
553 extern debug_type debug_make_struct_type
554 PARAMS ((PTR, bfd_boolean, bfd_vma, debug_field *));
556 /* Make an object type. The first three arguments after the handle
557 are the same as for debug_make_struct_type. The next arguments are
558 a NULL terminated array of base classes, a NULL terminated array of
559 methods, the type of the object holding the virtual function table
560 if it is not this object, and a bfd_boolean which is TRUE if this
561 object has its own virtual function table. */
563 extern debug_type debug_make_object_type
564 PARAMS ((PTR, bfd_boolean, bfd_vma, debug_field *, debug_baseclass *,
565 debug_method *, debug_type, bfd_boolean));
567 /* Make an enumeration type. The arguments are a null terminated
568 array of strings, and an array of corresponding values. */
570 extern debug_type debug_make_enum_type
571 PARAMS ((PTR, const char **, bfd_signed_vma *));
573 /* Make a pointer to a given type. */
575 extern debug_type debug_make_pointer_type
576 PARAMS ((PTR, debug_type));
578 /* Make a function type. The second argument is the return type. The
579 third argument is a NULL terminated array of argument types. The
580 fourth argument is TRUE if the function takes a variable number of
581 arguments. If the third argument is NULL, then the argument types
582 are unknown. */
584 extern debug_type debug_make_function_type
585 PARAMS ((PTR, debug_type, debug_type *, bfd_boolean));
587 /* Make a reference to a given type. */
589 extern debug_type debug_make_reference_type PARAMS ((PTR, debug_type));
591 /* Make a range of a given type from a lower to an upper bound. */
593 extern debug_type debug_make_range_type
594 PARAMS ((PTR, debug_type, bfd_signed_vma, bfd_signed_vma));
596 /* Make an array type. The second argument is the type of an element
597 of the array. The third argument is the type of a range of the
598 array. The fourth and fifth argument are the lower and upper
599 bounds, respectively (if the bounds are not known, lower should be
600 0 and upper should be -1). The sixth argument is TRUE if this
601 array is actually a string, as in C. */
603 extern debug_type debug_make_array_type
604 PARAMS ((PTR, debug_type, debug_type, bfd_signed_vma, bfd_signed_vma,
605 bfd_boolean));
607 /* Make a set of a given type. For example, a Pascal set type. The
608 bfd_boolean argument is TRUE if this set is actually a bitstring, as in
609 CHILL. */
611 extern debug_type debug_make_set_type PARAMS ((PTR, debug_type, bfd_boolean));
613 /* Make a type for a pointer which is relative to an object. The
614 second argument is the type of the object to which the pointer is
615 relative. The third argument is the type that the pointer points
616 to. */
618 extern debug_type debug_make_offset_type
619 PARAMS ((PTR, debug_type, debug_type));
621 /* Make a type for a method function. The second argument is the
622 return type. The third argument is the domain. The fourth
623 argument is a NULL terminated array of argument types. The fifth
624 argument is TRUE if the function takes a variable number of
625 arguments, in which case the array of argument types indicates the
626 types of the first arguments. The domain and the argument array
627 may be NULL, in which case this is a stub method and that
628 information is not available. Stabs debugging uses this, and gets
629 the argument types from the mangled name. */
631 extern debug_type debug_make_method_type
632 PARAMS ((PTR, debug_type, debug_type, debug_type *, bfd_boolean));
634 /* Make a const qualified version of a given type. */
636 extern debug_type debug_make_const_type PARAMS ((PTR, debug_type));
638 /* Make a volatile qualified version of a given type. */
640 extern debug_type debug_make_volatile_type PARAMS ((PTR, debug_type));
642 /* Make an undefined tagged type. For example, a struct which has
643 been mentioned, but not defined. */
645 extern debug_type debug_make_undefined_tagged_type
646 PARAMS ((PTR, const char *, enum debug_type_kind));
648 /* Make a base class for an object. The second argument is the base
649 class type. The third argument is the bit position of this base
650 class in the object. The fourth argument is whether this is a
651 virtual class. The fifth argument is the visibility of the base
652 class. */
654 extern debug_baseclass debug_make_baseclass
655 PARAMS ((PTR, debug_type, bfd_vma, bfd_boolean, enum debug_visibility));
657 /* Make a field for a struct. The second argument is the name. The
658 third argument is the type of the field. The fourth argument is
659 the bit position of the field. The fifth argument is the size of
660 the field (it may be zero). The sixth argument is the visibility
661 of the field. */
663 extern debug_field debug_make_field
664 PARAMS ((PTR, const char *, debug_type, bfd_vma, bfd_vma,
665 enum debug_visibility));
667 /* Make a static member of an object. The second argument is the
668 name. The third argument is the type of the member. The fourth
669 argument is the physical name of the member (i.e., the name as a
670 global variable). The fifth argument is the visibility of the
671 member. */
673 extern debug_field debug_make_static_member
674 PARAMS ((PTR, const char *, debug_type, const char *,
675 enum debug_visibility));
677 /* Make a method. The second argument is the name, and the third
678 argument is a NULL terminated array of method variants. Each
679 method variant is a method with this name but with different
680 argument types. */
682 extern debug_method debug_make_method
683 PARAMS ((PTR, const char *, debug_method_variant *));
685 /* Make a method variant. The second argument is the physical name of
686 the function. The third argument is the type of the function,
687 probably constructed by debug_make_method_type. The fourth
688 argument is the visibility. The fifth argument is whether this is
689 a const function. The sixth argument is whether this is a volatile
690 function. The seventh argument is the index in the virtual
691 function table, if any. The eighth argument is the virtual
692 function context. */
694 extern debug_method_variant debug_make_method_variant
695 PARAMS ((PTR, const char *, debug_type, enum debug_visibility, bfd_boolean,
696 bfd_boolean, bfd_vma, debug_type));
698 /* Make a static method argument. The arguments are the same as for
699 debug_make_method_variant, except that the last two are omitted
700 since a static method can not also be virtual. */
702 extern debug_method_variant debug_make_static_method_variant
703 PARAMS ((PTR, const char *, debug_type, enum debug_visibility, bfd_boolean,
704 bfd_boolean));
706 /* Name a type. This returns a new type with an attached name. */
708 extern debug_type debug_name_type PARAMS ((PTR, const char *, debug_type));
710 /* Give a tag to a type, such as a struct or union. This returns a
711 new type with an attached tag. */
713 extern debug_type debug_tag_type PARAMS ((PTR, const char *, debug_type));
715 /* Record the size of a given type. */
717 extern bfd_boolean debug_record_type_size
718 PARAMS ((PTR, debug_type, unsigned int));
720 /* Find a named type. */
722 extern debug_type debug_find_named_type PARAMS ((PTR, const char *));
724 /* Find a tagged type. */
726 extern debug_type debug_find_tagged_type
727 PARAMS ((PTR, const char *, enum debug_type_kind));
729 /* Get the kind of a type. */
731 extern enum debug_type_kind debug_get_type_kind PARAMS ((PTR, debug_type));
733 /* Get the name of a type. */
735 extern const char *debug_get_type_name PARAMS ((PTR, debug_type));
737 /* Get the size of a type. */
739 extern bfd_vma debug_get_type_size PARAMS ((PTR, debug_type));
741 /* Get the return type of a function or method type. */
743 extern debug_type debug_get_return_type PARAMS ((PTR, debug_type));
745 /* Get the NULL terminated array of parameter types for a function or
746 method type (actually, parameter types are not currently stored for
747 function types). This may be used to determine whether a method
748 type is a stub method or not. The last argument points to a
749 bfd_boolean which is set to TRUE if the function takes a variable
750 number of arguments. */
752 extern const debug_type *debug_get_parameter_types
753 PARAMS ((PTR, debug_type, bfd_boolean *));
755 /* Get the target type of a pointer or reference or const or volatile
756 type. */
758 extern debug_type debug_get_target_type PARAMS ((PTR, debug_type));
760 /* Get the NULL terminated array of fields for a struct, union, or
761 class. */
763 extern const debug_field *debug_get_fields PARAMS ((PTR, debug_type));
765 /* Get the type of a field. */
767 extern debug_type debug_get_field_type PARAMS ((PTR, debug_field));
769 /* Get the name of a field. */
771 extern const char *debug_get_field_name PARAMS ((PTR, debug_field));
773 /* Get the bit position of a field within the containing structure.
774 If the field is a static member, this will return (bfd_vma) -1. */
776 extern bfd_vma debug_get_field_bitpos PARAMS ((PTR, debug_field));
778 /* Get the bit size of a field. If the field is a static member, this
779 will return (bfd_vma) -1. */
781 extern bfd_vma debug_get_field_bitsize PARAMS ((PTR, debug_field));
783 /* Get the visibility of a field. */
785 extern enum debug_visibility debug_get_field_visibility
786 PARAMS ((PTR, debug_field));
788 /* Get the physical name of a field, if it is a static member. If the
789 field is not a static member, this will return NULL. */
791 extern const char *debug_get_field_physname PARAMS ((PTR, debug_field));
793 /* Write out the recorded debugging information. This takes a set of
794 function pointers which are called to do the actual writing. The
795 first PTR is the debugging handle. The second PTR is a handle
796 which is passed to the functions. */
798 extern bfd_boolean debug_write
799 PARAMS ((PTR, const struct debug_write_fns *, PTR));
801 #endif /* DEBUG_H */