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