]>
Commit | Line | Data |
---|---|---|
e1c14599 | 1 | /* debug.h -- Describe generic debugging information. |
63840d26 | 2 | Copyright (C) 1995, 1996 Free Software Foundation, Inc. |
e1c14599 ILT |
3 | Written by Ian Lance Taylor <[email protected]>. |
4 | ||
5 | This file is part of GNU Binutils. | |
6 | ||
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. | |
11 | ||
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. | |
16 | ||
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. */ | |
21 | ||
22 | #ifndef DEBUG_H | |
23 | #define DEBUG_H | |
24 | ||
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. */ | |
30 | ||
31 | /* Different kinds of types. */ | |
32 | ||
33 | enum debug_type_kind | |
34 | { | |
07aa1e1b ILT |
35 | /* Not used. */ |
36 | DEBUG_KIND_ILLEGAL, | |
e1c14599 ILT |
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 | |
83 | }; | |
84 | ||
85 | /* Different kinds of variables. */ | |
86 | ||
87 | enum debug_var_kind | |
88 | { | |
89 | /* A global variable. */ | |
90 | DEBUG_GLOBAL, | |
91 | /* A static variable. */ | |
92 | DEBUG_STATIC, | |
93 | /* A local static variable. */ | |
94 | DEBUG_LOCAL_STATIC, | |
95 | /* A local variable. */ | |
96 | DEBUG_LOCAL, | |
97 | /* A register variable. */ | |
98 | DEBUG_REGISTER | |
99 | }; | |
100 | ||
101 | /* Different kinds of function parameters. */ | |
102 | ||
103 | enum debug_parm_kind | |
104 | { | |
105 | /* A stack based parameter. */ | |
106 | DEBUG_PARM_STACK, | |
107 | /* A register parameter. */ | |
108 | DEBUG_PARM_REG, | |
109 | /* A stack based reference parameter. */ | |
110 | DEBUG_PARM_REFERENCE, | |
111 | /* A register reference parameter. */ | |
112 | DEBUG_PARM_REF_REG | |
113 | }; | |
114 | ||
115 | /* Different kinds of visibility. */ | |
116 | ||
117 | enum debug_visibility | |
118 | { | |
119 | /* A public field (e.g., a field in a C struct). */ | |
120 | DEBUG_VISIBILITY_PUBLIC, | |
121 | /* A protected field. */ | |
122 | DEBUG_VISIBILITY_PROTECTED, | |
123 | /* A private field. */ | |
124 | DEBUG_VISIBILITY_PRIVATE, | |
125 | /* A field which should be ignored. */ | |
126 | DEBUG_VISIBILITY_IGNORE | |
127 | }; | |
128 | ||
129 | /* A type. */ | |
130 | ||
131 | typedef struct debug_type *debug_type; | |
132 | ||
133 | #define DEBUG_TYPE_NULL ((debug_type) NULL) | |
134 | ||
135 | /* A field in a struct or union. */ | |
136 | ||
137 | typedef struct debug_field *debug_field; | |
138 | ||
139 | #define DEBUG_FIELD_NULL ((debug_field) NULL) | |
140 | ||
141 | /* A base class for an object. */ | |
142 | ||
143 | typedef struct debug_baseclass *debug_baseclass; | |
144 | ||
145 | #define DEBUG_BASECLASS_NULL ((debug_baseclass) NULL) | |
146 | ||
147 | /* A method of an object. */ | |
148 | ||
149 | typedef struct debug_method *debug_method; | |
150 | ||
151 | #define DEBUG_METHOD_NULL ((debug_method) NULL) | |
152 | ||
153 | /* The arguments to a method function of an object. These indicate | |
154 | which method to run. */ | |
155 | ||
156 | typedef struct debug_method_variant *debug_method_variant; | |
157 | ||
158 | #define DEBUG_METHOD_VARIANT_NULL ((debug_method_variant) NULL) | |
159 | ||
160 | /* This structure is passed to debug_write. It holds function | |
161 | pointers that debug_write will call based on the accumulated | |
162 | debugging information. */ | |
163 | ||
164 | struct debug_write_fns | |
165 | { | |
166 | /* This is called at the start of each new compilation unit with the | |
167 | name of the main file in the new unit. */ | |
168 | boolean (*start_compilation_unit) PARAMS ((PTR, const char *)); | |
169 | ||
170 | /* This is called at the start of each source file within a | |
171 | compilation unit, before outputting any global information for | |
172 | that file. The argument is the name of the file. */ | |
173 | boolean (*start_source) PARAMS ((PTR, const char *)); | |
174 | ||
175 | /* Each writer must keep a stack of types. */ | |
176 | ||
07aa1e1b ILT |
177 | /* Push an ellipsis type onto the type stack. This is not a real |
178 | type, but is used when a method takes a variable number of | |
179 | arguments. */ | |
180 | boolean (*ellipsis_type) PARAMS ((PTR)); | |
181 | ||
e1c14599 ILT |
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 | boolean (*empty_type) PARAMS ((PTR)); | |
185 | ||
186 | /* Push a void type onto the type stack. */ | |
187 | boolean (*void_type) PARAMS ((PTR)); | |
188 | ||
189 | /* Push an integer type onto the type stack, given the size and | |
190 | whether it is unsigned. */ | |
191 | boolean (*int_type) PARAMS ((PTR, unsigned int, boolean)); | |
192 | ||
193 | /* Push a floating type onto the type stack, given the size. */ | |
194 | boolean (*float_type) PARAMS ((PTR, unsigned int)); | |
195 | ||
196 | /* Push a complex type onto the type stack, given the size. */ | |
197 | boolean (*complex_type) PARAMS ((PTR, unsigned int)); | |
198 | ||
199 | /* Push a boolean type onto the type stack, given the size. */ | |
200 | boolean (*bool_type) PARAMS ((PTR, unsigned int)); | |
201 | ||
63840d26 ILT |
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 | |
36302909 ILT |
204 | no tag, the tag argument will be NULL. If this is an undefined |
205 | enum, the names and values arguments will be NULL. */ | |
63840d26 ILT |
206 | boolean (*enum_type) PARAMS ((PTR, const char *, const char **, |
207 | bfd_signed_vma *)); | |
e1c14599 ILT |
208 | |
209 | /* Pop the top type on the type stack, and push a pointer to that | |
210 | type onto the type stack. */ | |
211 | boolean (*pointer_type) PARAMS ((PTR)); | |
212 | ||
213 | /* Pop the top type on the type stack, and push a function returning | |
214 | that type onto the type stack. */ | |
215 | boolean (*function_type) PARAMS ((PTR)); | |
216 | ||
217 | /* Pop the top type on the type stack, and push a reference to that | |
218 | type onto the type stack. */ | |
219 | boolean (*reference_type) PARAMS ((PTR)); | |
220 | ||
221 | /* Pop the top type on the type stack, and push a range of that type | |
222 | with the given lower and upper bounds onto the type stack. */ | |
223 | boolean (*range_type) PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma)); | |
224 | ||
225 | /* Push an array type onto the type stack. The top type on the type | |
226 | stack is the range, and the next type on the type stack is the | |
227 | element type. These should be popped before the array type is | |
228 | pushed. The arguments are the lower bound, the upper bound, and | |
229 | whether the array is a string. */ | |
230 | boolean (*array_type) PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma, | |
231 | boolean)); | |
232 | ||
233 | /* Pop the top type on the type stack, and push a set of that type | |
234 | onto the type stack. The argument indicates whether this set is | |
235 | a bitstring. */ | |
236 | boolean (*set_type) PARAMS ((PTR, boolean)); | |
237 | ||
238 | /* Push an offset type onto the type stack. The top type on the | |
239 | type stack is the target type, and the next type on the type | |
240 | stack is the base type. These should be popped before the offset | |
241 | type is pushed. */ | |
242 | boolean (*offset_type) PARAMS ((PTR)); | |
243 | ||
244 | /* Push a method type onto the type stack. If the second argument | |
245 | is true, the top type on the stack is the class to which the | |
246 | method belongs; otherwise, the class must be determined by the | |
247 | class to which the method is attached. The third argument is the | |
248 | number of argument types; these are pushed onto the type stack in | |
249 | reverse order (the first type popped is the last argument to the | |
250 | method). An argument type of -1 means that no argument in | |
251 | formation is available. The next type on the type stack below | |
252 | the domain and the argument types is the return type of the | |
63840d26 ILT |
253 | method. All these types must be popped, and then the method type |
254 | must be pushed. */ | |
e1c14599 ILT |
255 | boolean (*method_type) PARAMS ((PTR, boolean, int)); |
256 | ||
257 | /* Pop the top type off the type stack, and push a const qualified | |
258 | version of that type onto the type stack. */ | |
259 | boolean (*const_type) PARAMS ((PTR)); | |
260 | ||
261 | /* Pop the top type off the type stack, and push a volatile | |
262 | qualified version of that type onto the type stack. */ | |
263 | boolean (*volatile_type) PARAMS ((PTR)); | |
264 | ||
265 | /* Start building a struct. This is followed by calls to the | |
266 | struct_field function, and finished by a call to the | |
63840d26 | 267 | end_struct_type function. The second argument is the tag; this |
07aa1e1b ILT |
268 | will be NULL if there isn't one. If the second argument is NULL, |
269 | the third argument is a constant identifying this struct for use | |
270 | with tag_type. The fourth argument is true for a struct, false | |
271 | for a union. The fifth argument is the size. If this is an | |
272 | undefined struct or union, the size will be 0 and struct_field | |
273 | will not be called before end_struct_type is called. */ | |
274 | boolean (*start_struct_type) PARAMS ((PTR, const char *, unsigned int, | |
275 | boolean, unsigned int)); | |
e1c14599 ILT |
276 | |
277 | /* Add a field to the struct type currently being built. The type | |
278 | of the field should be popped off the type stack. The arguments | |
279 | are the name, the bit position, the bit size (may be zero if the | |
280 | field is not packed), and the visibility. */ | |
281 | boolean (*struct_field) PARAMS ((PTR, const char *, bfd_vma, bfd_vma, | |
282 | enum debug_visibility)); | |
283 | ||
284 | /* Finish building a struct, and push it onto the type stack. */ | |
285 | boolean (*end_struct_type) PARAMS ((PTR)); | |
286 | ||
287 | /* Start building a class. This is followed by calls to several | |
288 | functions: struct_field, class_static_member, class_baseclass, | |
289 | class_start_method, class_method_variant, | |
290 | class_static_method_variant, and class_end_method. The class is | |
07aa1e1b ILT |
291 | finished by a call to end_class_type. The first five arguments |
292 | are the same as for start_struct_type. The sixth argument is | |
293 | true if there is a virtual function table; if there is, the | |
294 | seventh argument is true if the virtual function table can be | |
295 | found in the type itself, and is false if the type of the object | |
296 | holding the virtual function table should be popped from the type | |
297 | stack. */ | |
298 | boolean (*start_class_type) PARAMS ((PTR, const char *, unsigned int, | |
299 | boolean, unsigned int, boolean, | |
300 | boolean)); | |
e1c14599 ILT |
301 | |
302 | /* Add a static member to the class currently being built. The | |
303 | arguments are the field name, the physical name, and the | |
63840d26 | 304 | visibility. The type must be popped off the type stack. */ |
e1c14599 ILT |
305 | boolean (*class_static_member) PARAMS ((PTR, const char *, const char *, |
306 | enum debug_visibility)); | |
307 | ||
308 | /* Add a baseclass to the class currently being built. The type of | |
309 | the baseclass must be popped off the type stack. The arguments | |
310 | are the bit position, whether the class is virtual, and the | |
311 | visibility. */ | |
312 | boolean (*class_baseclass) PARAMS ((PTR, bfd_vma, boolean, | |
313 | enum debug_visibility)); | |
314 | ||
315 | /* Start adding a method to the class currently being built. This | |
316 | is followed by calls to class_method_variant and | |
317 | class_static_method_variant to describe different variants of the | |
318 | method which take different arguments. The method is finished | |
319 | with a call to class_end_method. The argument is the method | |
320 | name. */ | |
321 | boolean (*class_start_method) PARAMS ((PTR, const char *)); | |
322 | ||
323 | /* Describe a variant to the class method currently being built. | |
324 | The type of the variant must be popped off the type stack. The | |
07aa1e1b ILT |
325 | second argument is the physical name of the function. The |
326 | following arguments are the visibility, whether the variant is | |
327 | const, whether the variant is volatile, the offset in the virtual | |
328 | function table, and whether the context is on the type stack | |
329 | (below the variant type). */ | |
e1c14599 ILT |
330 | boolean (*class_method_variant) PARAMS ((PTR, const char *, |
331 | enum debug_visibility, | |
332 | boolean, boolean, | |
333 | bfd_vma, boolean)); | |
334 | ||
335 | /* Describe a static variant to the class method currently being | |
336 | built. The arguments are the same as for class_method_variant, | |
63840d26 ILT |
337 | except that the last two arguments are omitted. The type of the |
338 | variant must be popped off the type stack. */ | |
e1c14599 ILT |
339 | boolean (*class_static_method_variant) PARAMS ((PTR, const char *, |
340 | enum debug_visibility, | |
341 | boolean, boolean)); | |
342 | ||
343 | /* Finish describing a class method. */ | |
344 | boolean (*class_end_method) PARAMS ((PTR)); | |
345 | ||
346 | /* Finish describing a class, and push it onto the type stack. */ | |
347 | boolean (*end_class_type) PARAMS ((PTR)); | |
348 | ||
349 | /* Push a type on the stack which was given a name by an earlier | |
350 | call to typdef. */ | |
351 | boolean (*typedef_type) PARAMS ((PTR, const char *)); | |
352 | ||
07aa1e1b ILT |
353 | /* Push a tagged type on the stack which was defined earlier. If |
354 | the second argument is not NULL, the type was defined by a call | |
355 | to tag. If the second argument is NULL, the type was defined by | |
356 | a call to start_struct_type or start_class_type with a tag of | |
357 | NULL and the number of the third argument. Either way, the | |
358 | fourth argument is the tag kind. Note that this may be called | |
359 | for a struct (class) being defined, in between the call to | |
360 | start_struct_type (start_class_type) and the call to | |
361 | end_struct_type (end_class_type). */ | |
362 | boolean (*tag_type) PARAMS ((PTR, const char *, unsigned int, | |
363 | enum debug_type_kind)); | |
e1c14599 ILT |
364 | |
365 | /* Pop the type stack, and typedef it to the given name. */ | |
366 | boolean (*typdef) PARAMS ((PTR, const char *)); | |
367 | ||
368 | /* Pop the type stack, and declare it as a tagged struct or union or | |
63840d26 ILT |
369 | enum or whatever. The tag passed down here is redundant, since |
370 | was also passed when enum_type, start_struct_type, or | |
371 | start_class_type was called. */ | |
e1c14599 ILT |
372 | boolean (*tag) PARAMS ((PTR, const char *)); |
373 | ||
374 | /* This is called to record a named integer constant. */ | |
375 | boolean (*int_constant) PARAMS ((PTR, const char *, bfd_vma)); | |
376 | ||
377 | /* This is called to record a named floating point constant. */ | |
378 | boolean (*float_constant) PARAMS ((PTR, const char *, double)); | |
379 | ||
380 | /* This is called to record a typed integer constant. The type is | |
381 | popped off the type stack. */ | |
382 | boolean (*typed_constant) PARAMS ((PTR, const char *, bfd_vma)); | |
383 | ||
384 | /* This is called to record a variable. The type is popped off the | |
385 | type stack. */ | |
386 | boolean (*variable) PARAMS ((PTR, const char *, enum debug_var_kind, | |
387 | bfd_vma)); | |
388 | ||
389 | /* Start writing out a function. The return type must be popped off | |
390 | the stack. The boolean is true if the function is global. This | |
391 | is followed by calls to function_parameter, followed by block | |
392 | information. */ | |
393 | boolean (*start_function) PARAMS ((PTR, const char *, boolean)); | |
394 | ||
395 | /* Record a function parameter for the current function. The type | |
396 | must be popped off the stack. */ | |
397 | boolean (*function_parameter) PARAMS ((PTR, const char *, | |
398 | enum debug_parm_kind, bfd_vma)); | |
399 | ||
400 | /* Start writing out a block. There is at least one top level block | |
401 | per function. Blocks may be nested. The argument is the | |
402 | starting address of the block. */ | |
403 | boolean (*start_block) PARAMS ((PTR, bfd_vma)); | |
404 | ||
e1c14599 ILT |
405 | /* Finish writing out a block. The argument is the ending address |
406 | of the block. */ | |
407 | boolean (*end_block) PARAMS ((PTR, bfd_vma)); | |
408 | ||
409 | /* Finish writing out a function. */ | |
410 | boolean (*end_function) PARAMS ((PTR)); | |
63840d26 ILT |
411 | |
412 | /* Record line number information for the current compilation unit. */ | |
413 | boolean (*lineno) PARAMS ((PTR, const char *, unsigned long, bfd_vma)); | |
e1c14599 ILT |
414 | }; |
415 | ||
416 | /* Exported functions. */ | |
417 | ||
418 | /* The first argument to most of these functions is a handle. This | |
419 | handle is returned by the debug_init function. The purpose of the | |
420 | handle is to permit the debugging routines to not use static | |
421 | variables, and hence to be reentrant. This would be useful for a | |
422 | program which wanted to handle two executables simultaneously. */ | |
423 | ||
424 | /* Return a debugging handle. */ | |
425 | ||
426 | extern PTR debug_init PARAMS ((void)); | |
427 | ||
428 | /* Set the source filename. This implicitly starts a new compilation | |
429 | unit. */ | |
430 | ||
431 | extern boolean debug_set_filename PARAMS ((PTR, const char *)); | |
432 | ||
433 | /* Append a string to the source filename. */ | |
434 | ||
435 | extern boolean debug_append_filename PARAMS ((PTR, const char *)); | |
436 | ||
437 | /* Change source files to the given file name. This is used for | |
438 | include files in a single compilation unit. */ | |
439 | ||
440 | extern boolean debug_start_source PARAMS ((PTR, const char *)); | |
441 | ||
442 | /* Record a function definition. This implicitly starts a function | |
443 | block. The debug_type argument is the type of the return value. | |
444 | The boolean indicates whether the function is globally visible. | |
445 | The bfd_vma is the address of the start of the function. Currently | |
446 | the parameter types are specified by calls to | |
447 | debug_record_parameter. */ | |
448 | ||
449 | extern boolean debug_record_function | |
450 | PARAMS ((PTR, const char *, debug_type, boolean, bfd_vma)); | |
451 | ||
452 | /* Record a parameter for the current function. */ | |
453 | ||
454 | extern boolean debug_record_parameter | |
455 | PARAMS ((PTR, const char *, debug_type, enum debug_parm_kind, bfd_vma)); | |
456 | ||
457 | /* End a function definition. The argument is the address where the | |
458 | function ends. */ | |
459 | ||
460 | extern boolean debug_end_function PARAMS ((PTR, bfd_vma)); | |
461 | ||
462 | /* Start a block in a function. All local information will be | |
463 | recorded in this block, until the matching call to debug_end_block. | |
464 | debug_start_block and debug_end_block may be nested. The argument | |
465 | is the address at which this block starts. */ | |
466 | ||
467 | extern boolean debug_start_block PARAMS ((PTR, bfd_vma)); | |
468 | ||
469 | /* Finish a block in a function. This matches the call to | |
470 | debug_start_block. The argument is the address at which this block | |
471 | ends. */ | |
472 | ||
473 | extern boolean debug_end_block PARAMS ((PTR, bfd_vma)); | |
474 | ||
63840d26 ILT |
475 | /* Associate a line number in the current source file with a given |
476 | address. */ | |
e1c14599 ILT |
477 | |
478 | extern boolean debug_record_line PARAMS ((PTR, unsigned long, bfd_vma)); | |
479 | ||
480 | /* Start a named common block. This is a block of variables that may | |
481 | move in memory. */ | |
482 | ||
483 | extern boolean debug_start_common_block PARAMS ((PTR, const char *)); | |
484 | ||
485 | /* End a named common block. */ | |
486 | ||
487 | extern boolean debug_end_common_block PARAMS ((PTR, const char *)); | |
488 | ||
489 | /* Record a named integer constant. */ | |
490 | ||
491 | extern boolean debug_record_int_const PARAMS ((PTR, const char *, bfd_vma)); | |
492 | ||
493 | /* Record a named floating point constant. */ | |
494 | ||
495 | extern boolean debug_record_float_const PARAMS ((PTR, const char *, double)); | |
496 | ||
497 | /* Record a typed constant with an integral value. */ | |
498 | ||
499 | extern boolean debug_record_typed_const | |
500 | PARAMS ((PTR, const char *, debug_type, bfd_vma)); | |
501 | ||
502 | /* Record a label. */ | |
503 | ||
504 | extern boolean debug_record_label | |
505 | PARAMS ((PTR, const char *, debug_type, bfd_vma)); | |
506 | ||
507 | /* Record a variable. */ | |
508 | ||
509 | extern boolean debug_record_variable | |
510 | PARAMS ((PTR, const char *, debug_type, enum debug_var_kind, bfd_vma)); | |
511 | ||
512 | /* Make an indirect type. The first argument is a pointer to the | |
513 | location where the real type will be placed. The second argument | |
514 | is the type tag, if there is one; this may be NULL; the only | |
515 | purpose of this argument is so that debug_get_type_name can return | |
516 | something useful. This function may be used when a type is | |
517 | referenced before it is defined. */ | |
518 | ||
519 | extern debug_type debug_make_indirect_type | |
520 | PARAMS ((PTR, debug_type *, const char *)); | |
521 | ||
07aa1e1b ILT |
522 | /* Make an ellipsis type. This is not a type at all, but is a marker |
523 | suitable for appearing in the list of argument types passed to | |
524 | debug_make_method_type. It should be used to indicate a method | |
525 | which takes a variable number of arguments. */ | |
526 | ||
527 | extern debug_type debug_make_ellipsis_type PARAMS ((PTR)); | |
528 | ||
e1c14599 ILT |
529 | /* Make a void type. */ |
530 | ||
531 | extern debug_type debug_make_void_type PARAMS ((PTR)); | |
532 | ||
533 | /* Make an integer type of a given size. The boolean argument is true | |
534 | if the integer is unsigned. */ | |
535 | ||
536 | extern debug_type debug_make_int_type PARAMS ((PTR, unsigned int, boolean)); | |
537 | ||
538 | /* Make a floating point type of a given size. FIXME: On some | |
539 | platforms, like an Alpha, you probably need to be able to specify | |
540 | the format. */ | |
541 | ||
542 | extern debug_type debug_make_float_type PARAMS ((PTR, unsigned int)); | |
543 | ||
544 | /* Make a boolean type of a given size. */ | |
545 | ||
546 | extern debug_type debug_make_bool_type PARAMS ((PTR, unsigned int)); | |
547 | ||
548 | /* Make a complex type of a given size. */ | |
549 | ||
550 | extern debug_type debug_make_complex_type PARAMS ((PTR, unsigned int)); | |
551 | ||
552 | /* Make a structure type. The second argument is true for a struct, | |
553 | false for a union. The third argument is the size of the struct. | |
554 | The fourth argument is a NULL terminated array of fields. */ | |
555 | ||
556 | extern debug_type debug_make_struct_type | |
557 | PARAMS ((PTR, boolean, bfd_vma, debug_field *)); | |
558 | ||
559 | /* Make an object type. The first three arguments after the handle | |
560 | are the same as for debug_make_struct_type. The next arguments are | |
561 | a NULL terminated array of base classes, a NULL terminated array of | |
562 | methods, the type of the object holding the virtual function table | |
563 | if it is not this object, and a boolean which is true if this | |
564 | object has its own virtual function table. */ | |
565 | ||
566 | extern debug_type debug_make_object_type | |
567 | PARAMS ((PTR, boolean, bfd_vma, debug_field *, debug_baseclass *, | |
568 | debug_method *, debug_type, boolean)); | |
569 | ||
570 | /* Make an enumeration type. The arguments are a null terminated | |
571 | array of strings, and an array of corresponding values. */ | |
572 | ||
573 | extern debug_type debug_make_enum_type | |
574 | PARAMS ((PTR, const char **, bfd_signed_vma *)); | |
575 | ||
576 | /* Make a pointer to a given type. */ | |
577 | ||
578 | extern debug_type debug_make_pointer_type | |
579 | PARAMS ((PTR, debug_type)); | |
580 | ||
581 | /* Make a function returning a given type. FIXME: We should be able | |
582 | to record the parameter types. */ | |
583 | ||
584 | extern debug_type debug_make_function_type PARAMS ((PTR, debug_type)); | |
585 | ||
586 | /* Make a reference to a given type. */ | |
587 | ||
588 | extern debug_type debug_make_reference_type PARAMS ((PTR, debug_type)); | |
589 | ||
590 | /* Make a range of a given type from a lower to an upper bound. */ | |
591 | ||
592 | extern debug_type debug_make_range_type | |
593 | PARAMS ((PTR, debug_type, bfd_signed_vma, bfd_signed_vma)); | |
594 | ||
595 | /* Make an array type. The second argument is the type of an element | |
596 | of the array. The third argument is the type of a range of the | |
597 | array. The fourth and fifth argument are the lower and upper | |
598 | bounds, respectively (if the bounds are not known, lower should be | |
599 | 0 and upper should be -1). The sixth argument is true if this | |
600 | array is actually a string, as in C. */ | |
601 | ||
602 | extern debug_type debug_make_array_type | |
603 | PARAMS ((PTR, debug_type, debug_type, bfd_signed_vma, bfd_signed_vma, | |
604 | boolean)); | |
605 | ||
606 | /* Make a set of a given type. For example, a Pascal set type. The | |
607 | boolean argument is true if this set is actually a bitstring, as in | |
608 | CHILL. */ | |
609 | ||
610 | extern debug_type debug_make_set_type PARAMS ((PTR, debug_type, boolean)); | |
611 | ||
612 | /* Make a type for a pointer which is relative to an object. The | |
613 | second argument is the type of the object to which the pointer is | |
614 | relative. The third argument is the type that the pointer points | |
615 | to. */ | |
616 | ||
617 | extern debug_type debug_make_offset_type | |
618 | PARAMS ((PTR, debug_type, debug_type)); | |
619 | ||
620 | /* Make a type for a method function. The second argument is the | |
621 | return type, the third argument is the domain, and the fourth | |
622 | argument is a NULL terminated array of argument types. The domain | |
623 | and the argument array may be NULL, in which case this is a stub | |
624 | method and that information is not available. Stabs debugging uses | |
625 | this, and gets the argument types from the mangled name. */ | |
626 | ||
627 | extern debug_type debug_make_method_type | |
628 | PARAMS ((PTR, debug_type, debug_type, debug_type *)); | |
629 | ||
630 | /* Make a const qualified version of a given type. */ | |
631 | ||
632 | extern debug_type debug_make_const_type PARAMS ((PTR, debug_type)); | |
633 | ||
634 | /* Make a volatile qualified version of a given type. */ | |
635 | ||
636 | extern debug_type debug_make_volatile_type PARAMS ((PTR, debug_type)); | |
637 | ||
638 | /* Make an undefined tagged type. For example, a struct which has | |
639 | been mentioned, but not defined. */ | |
640 | ||
641 | extern debug_type debug_make_undefined_tagged_type | |
642 | PARAMS ((PTR, const char *, enum debug_type_kind)); | |
643 | ||
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 (always 0 unless doing multiple inheritance). | |
647 | The fourth argument is whether this is a virtual class. The fifth | |
648 | argument is the visibility of the base class. */ | |
649 | ||
650 | extern debug_baseclass debug_make_baseclass | |
651 | PARAMS ((PTR, debug_type, bfd_vma, boolean, enum debug_visibility)); | |
652 | ||
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. */ | |
658 | ||
659 | extern debug_field debug_make_field | |
660 | PARAMS ((PTR, const char *, debug_type, bfd_vma, bfd_vma, | |
661 | enum debug_visibility)); | |
662 | ||
663 | /* Make a static member of an object. The second argument is the | |
664 | name. The third argument is the type of the member. The fourth | |
665 | argument is the physical name of the member (i.e., the name as a | |
666 | global variable). The fifth argument is the visibility of the | |
667 | member. */ | |
668 | ||
669 | extern debug_field debug_make_static_member | |
670 | PARAMS ((PTR, const char *, debug_type, const char *, | |
671 | enum debug_visibility)); | |
672 | ||
673 | /* Make a method. The second argument is the name, and the third | |
674 | argument is a NULL terminated array of method variants. Each | |
675 | method variant is a method with this name but with different | |
676 | argument types. */ | |
677 | ||
678 | extern debug_method debug_make_method | |
679 | PARAMS ((PTR, const char *, debug_method_variant *)); | |
680 | ||
07aa1e1b ILT |
681 | /* Make a method variant. The second argument is the physical name of |
682 | the function. The third argument is the type of the function, | |
683 | probably constructed by debug_make_method_type. The fourth | |
e1c14599 ILT |
684 | argument is the visibility. The fifth argument is whether this is |
685 | a const function. The sixth argument is whether this is a volatile | |
686 | function. The seventh argument is the offset in the virtual | |
687 | function table, if any. The eighth argument is the virtual | |
688 | function context. FIXME: Are the const and volatile arguments | |
689 | necessary? Could we just use debug_make_const_type? The handling | |
690 | of the second argument is biased toward the way that stabs works. */ | |
691 | ||
692 | extern debug_method_variant debug_make_method_variant | |
693 | PARAMS ((PTR, const char *, debug_type, enum debug_visibility, boolean, | |
694 | boolean, bfd_vma, debug_type)); | |
695 | ||
696 | /* Make a static method argument. The arguments are the same as for | |
697 | debug_make_method_variant, except that the last two are omitted | |
698 | since a static method can not also be virtual. */ | |
699 | ||
700 | extern debug_method_variant debug_make_static_method_variant | |
701 | PARAMS ((PTR, const char *, debug_type, enum debug_visibility, boolean, | |
702 | boolean)); | |
703 | ||
704 | /* Name a type. This returns a new type with an attached name. */ | |
705 | ||
706 | extern debug_type debug_name_type PARAMS ((PTR, const char *, debug_type)); | |
707 | ||
708 | /* Give a tag to a type, such as a struct or union. This returns a | |
709 | new type with an attached tag. */ | |
710 | ||
711 | extern debug_type debug_tag_type PARAMS ((PTR, const char *, debug_type)); | |
712 | ||
713 | /* Record the size of a given type. */ | |
714 | ||
715 | extern boolean debug_record_type_size PARAMS ((PTR, debug_type, unsigned int)); | |
716 | ||
07aa1e1b ILT |
717 | /* Find a named type. */ |
718 | ||
719 | extern debug_type debug_find_named_type PARAMS ((PTR, const char *)); | |
720 | ||
e1c14599 ILT |
721 | /* Find a tagged type. */ |
722 | ||
723 | extern debug_type debug_find_tagged_type | |
724 | PARAMS ((PTR, const char *, enum debug_type_kind)); | |
725 | ||
07aa1e1b ILT |
726 | /* Get the kind of a type. */ |
727 | ||
728 | extern enum debug_type_kind debug_get_type_kind PARAMS ((PTR, debug_type)); | |
729 | ||
e1c14599 ILT |
730 | /* Get the name of a type. */ |
731 | ||
732 | extern const char *debug_get_type_name PARAMS ((PTR, debug_type)); | |
733 | ||
07aa1e1b ILT |
734 | /* Get the return type of a function or method type. */ |
735 | ||
736 | extern debug_type debug_get_return_type PARAMS ((PTR, debug_type)); | |
737 | ||
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. */ | |
742 | ||
743 | extern const debug_type *debug_get_parameter_types PARAMS ((PTR, debug_type)); | |
744 | ||
745 | /* Get the NULL terminated array of fields for a struct, union, or | |
746 | class. */ | |
747 | ||
748 | extern const debug_field *debug_get_fields PARAMS ((PTR, debug_type)); | |
749 | ||
750 | /* Get the type of a field. */ | |
751 | ||
752 | extern debug_type debug_get_field_type PARAMS ((PTR, debug_field)); | |
753 | ||
e1c14599 ILT |
754 | /* Write out the recorded debugging information. This takes a set of |
755 | function pointers which are called to do the actual writing. The | |
756 | first PTR is the debugging handle. The second PTR is a handle | |
757 | which is passed to the functions. */ | |
758 | ||
759 | extern boolean debug_write PARAMS ((PTR, const struct debug_write_fns *, PTR)); | |
760 | ||
761 | #endif /* DEBUG_H */ |