#include <stdio.h>#include <assert.h>#include <bfd.h>#include "bucomm.h"#include <libiberty.h>#include "debug.h"Include dependency graph for debug.c:

Go to the source code of this file.
| #define DEBUG_LINENO_COUNT 10 |
| #define VOFFSET_STATIC_METHOD ((bfd_vma) -1) |
| enum debug_object_kind |
| DEBUG_OBJECT_TYPE | |
| DEBUG_OBJECT_TAG | |
| DEBUG_OBJECT_VARIABLE | |
| DEBUG_OBJECT_FUNCTION | |
| DEBUG_OBJECT_INT_CONSTANT | |
| DEBUG_OBJECT_FLOAT_CONSTANT | |
| DEBUG_OBJECT_TYPED_CONSTANT |
Definition at line 452 of file debug.c.
00453 { 00454 /* A type. */ 00455 DEBUG_OBJECT_TYPE, 00456 /* A tagged type (really a different sort of namespace). */ 00457 DEBUG_OBJECT_TAG, 00458 /* A variable. */ 00459 DEBUG_OBJECT_VARIABLE, 00460 /* A function. */ 00461 DEBUG_OBJECT_FUNCTION, 00462 /* An integer constant. */ 00463 DEBUG_OBJECT_INT_CONSTANT, 00464 /* A floating point constant. */ 00465 DEBUG_OBJECT_FLOAT_CONSTANT, 00466 /* A typed constant. */ 00467 DEBUG_OBJECT_TYPED_CONSTANT 00468 };
| enum debug_object_linkage |
Definition at line 472 of file debug.c.
00473 { 00474 /* Local variable. */ 00475 DEBUG_LINKAGE_AUTOMATIC, 00476 /* Static--either file static or function static, depending upon the 00477 namespace is. */ 00478 DEBUG_LINKAGE_STATIC, 00479 /* Global. */ 00480 DEBUG_LINKAGE_GLOBAL, 00481 /* No linkage. */ 00482 DEBUG_LINKAGE_NONE 00483 };
| static struct debug_name* debug_add_to_current_namespace | ( | struct debug_handle * | info, | |
| const char * | name, | |||
| enum debug_object_kind | kind, | |||
| enum debug_object_linkage | linkage | |||
| ) | [static] |
Definition at line 630 of file debug.c.
References debug_add_to_namespace(), debug_error(), and NULL.
Referenced by debug_record_float_const(), debug_record_int_const(), and debug_record_typed_const().
00635 { 00636 struct debug_namespace **nsp; 00637 00638 if (info->current_unit == NULL 00639 || info->current_file == NULL) 00640 { 00641 debug_error ("debug_add_to_current_namespace: no current file"); 00642 return NULL; 00643 } 00644 00645 if (info->current_block != NULL) 00646 nsp = &info->current_block->locals; 00647 else 00648 nsp = &info->current_file->globals; 00649 00650 return debug_add_to_namespace (info, nsp, name, kind, linkage); 00651 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static struct debug_name* debug_add_to_namespace | ( | struct debug_handle * | info, | |
| struct debug_namespace ** | nsp, | |||
| const char * | name, | |||
| enum debug_object_kind | kind, | |||
| enum debug_object_linkage | linkage | |||
| ) | [static] |
Definition at line 593 of file debug.c.
References memset, n, debug_name::next, NULL, debug_namespace::tail, and xmalloc().
Referenced by debug_add_to_current_namespace(), debug_name_type(), debug_record_function(), debug_record_variable(), and debug_tag_type().
00599 { 00600 struct debug_name *n; 00601 struct debug_namespace *ns; 00602 00603 n = (struct debug_name *) xmalloc (sizeof *n); 00604 memset (n, 0, sizeof *n); 00605 00606 n->name = name; 00607 n->kind = kind; 00608 n->linkage = linkage; 00609 00610 ns = *nsp; 00611 if (ns == NULL) 00612 { 00613 ns = (struct debug_namespace *) xmalloc (sizeof *ns); 00614 memset (ns, 0, sizeof *ns); 00615 00616 ns->tail = &ns->list; 00617 00618 *nsp = ns; 00619 } 00620 00621 *ns->tail = n; 00622 ns->tail = &n->next; 00623 00624 return n; 00625 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean debug_class_type_samep | ( | struct debug_handle * | info, | |
| struct debug_type * | t1, | |||
| struct debug_type * | t2 | |||
| ) | [static] |
Definition at line 3369 of file debug.c.
References debug_class_type::baseclasses, debug_baseclass::bitpos, debug_method_variant::constp, debug_method_variant::context, debug_get_real_type(), debug_type_samep(), f1, f2, debug_class_type::fields, debug_type::kclass, debug_class_type::methods, debug_method::name, NULL, debug_method_variant::physname, strcmp(), debug_method_variant::type, debug_baseclass::type, debug_type::u, debug_method::variants, debug_baseclass::virtual, debug_method_variant::visibility, debug_baseclass::visibility, debug_method_variant::voffset, debug_method_variant::volatilep, and debug_class_type::vptrbase.
Referenced by debug_type_samep().
03373 { 03374 struct debug_class_type *c1, *c2; 03375 03376 c1 = t1->u.kclass; 03377 c2 = t2->u.kclass; 03378 03379 if ((c1->fields == NULL) != (c2->fields == NULL) 03380 || (c1->baseclasses == NULL) != (c2->baseclasses == NULL) 03381 || (c1->methods == NULL) != (c2->methods == NULL) 03382 || (c1->vptrbase == NULL) != (c2->vptrbase == NULL)) 03383 return false; 03384 03385 if (c1->fields != NULL) 03386 { 03387 struct debug_field **pf1, **pf2; 03388 03389 for (pf1 = c1->fields, pf2 = c2->fields; 03390 *pf1 != NULL && *pf2 != NULL; 03391 pf1++, pf2++) 03392 { 03393 struct debug_field *f1, *f2; 03394 03395 f1 = *pf1; 03396 f2 = *pf2; 03397 if (f1->name[0] != f2->name[0] 03398 || f1->visibility != f2->visibility 03399 || f1->static_member != f2->static_member) 03400 return false; 03401 if (f1->static_member) 03402 { 03403 if (strcmp (f1->u.s.physname, f2->u.s.physname) != 0) 03404 return false; 03405 } 03406 else 03407 { 03408 if (f1->u.f.bitpos != f2->u.f.bitpos 03409 || f1->u.f.bitsize != f2->u.f.bitsize) 03410 return false; 03411 } 03412 /* We do the checks which require function calls last. We 03413 don't require that the types of fields have the same 03414 names, since that sometimes fails in the presence of 03415 typedefs and we really don't care. */ 03416 if (strcmp (f1->name, f2->name) != 0 03417 || ! debug_type_samep (info, 03418 debug_get_real_type ((PTR) info, 03419 f1->type), 03420 debug_get_real_type ((PTR) info, 03421 f2->type))) 03422 return false; 03423 } 03424 if (*pf1 != NULL || *pf2 != NULL) 03425 return false; 03426 } 03427 03428 if (c1->vptrbase != NULL) 03429 { 03430 if (! debug_type_samep (info, c1->vptrbase, c2->vptrbase)) 03431 return false; 03432 } 03433 03434 if (c1->baseclasses != NULL) 03435 { 03436 struct debug_baseclass **pb1, **pb2; 03437 03438 for (pb1 = c1->baseclasses, pb2 = c2->baseclasses; 03439 *pb1 != NULL && *pb2 != NULL; 03440 ++pb1, ++pb2) 03441 { 03442 struct debug_baseclass *b1, *b2; 03443 03444 b1 = *pb1; 03445 b2 = *pb2; 03446 if (b1->bitpos != b2->bitpos 03447 || b1->virtual != b2->virtual 03448 || b1->visibility != b2->visibility 03449 || ! debug_type_samep (info, b1->type, b2->type)) 03450 return false; 03451 } 03452 if (*pb1 != NULL || *pb2 != NULL) 03453 return false; 03454 } 03455 03456 if (c1->methods != NULL) 03457 { 03458 struct debug_method **pm1, **pm2; 03459 03460 for (pm1 = c1->methods, pm2 = c2->methods; 03461 *pm1 != NULL && *pm2 != NULL; 03462 ++pm1, ++pm2) 03463 { 03464 struct debug_method *m1, *m2; 03465 03466 m1 = *pm1; 03467 m2 = *pm2; 03468 if (m1->name[0] != m2->name[0] 03469 || strcmp (m1->name, m2->name) != 0 03470 || (m1->variants == NULL) != (m2->variants == NULL)) 03471 return false; 03472 if (m1->variants == NULL) 03473 { 03474 struct debug_method_variant **pv1, **pv2; 03475 03476 for (pv1 = m1->variants, pv2 = m2->variants; 03477 *pv1 != NULL && *pv2 != NULL; 03478 ++pv1, ++pv2) 03479 { 03480 struct debug_method_variant *v1, *v2; 03481 03482 v1 = *pv1; 03483 v2 = *pv2; 03484 if (v1->physname[0] != v2->physname[0] 03485 || v1->visibility != v2->visibility 03486 || v1->constp != v2->constp 03487 || v1->volatilep != v2->volatilep 03488 || v1->voffset != v2->voffset 03489 || (v1->context == NULL) != (v2->context == NULL) 03490 || strcmp (v1->physname, v2->physname) != 0 03491 || ! debug_type_samep (info, v1->type, v2->type)) 03492 return false; 03493 if (v1->context != NULL) 03494 { 03495 if (! debug_type_samep (info, v1->context, 03496 v2->context)) 03497 return false; 03498 } 03499 } 03500 if (*pv1 != NULL || *pv2 != NULL) 03501 return false; 03502 } 03503 } 03504 if (*pm1 != NULL || *pm2 != NULL) 03505 return false; 03506 } 03507 03508 return true; 03509 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_end_block | ( | PTR | handle, | |
| bfd_vma | addr | |||
| ) |
Definition at line 937 of file debug.c.
References debug_handle::current_block, debug_handle::current_unit, debug_error(), debug_block::end, info, NULL, and debug_block::parent.
Referenced by parse_ieee_be(), and parse_stab().
00940 { 00941 struct debug_handle *info = (struct debug_handle *) handle; 00942 struct debug_block *parent; 00943 00944 if (info->current_unit == NULL 00945 || info->current_block == NULL) 00946 { 00947 debug_error ("debug_end_block: no current block"); 00948 return false; 00949 } 00950 00951 parent = info->current_block->parent; 00952 if (parent == NULL) 00953 { 00954 debug_error ("debug_end_block: attempt to close top level block"); 00955 return false; 00956 } 00957 00958 info->current_block->end = addr; 00959 00960 info->current_block = parent; 00961 00962 return true; 00963 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_end_common_block | ( | PTR | handle, | |
| const char * | name | |||
| ) |
Definition at line 1041 of file debug.c.
References debug_error().
Referenced by parse_stab().
01044 { 01045 /* FIXME */ 01046 debug_error ("debug_end_common_block: not implemented"); 01047 return false; 01048 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_end_function | ( | PTR | handle, | |
| bfd_vma | addr | |||
| ) |
Definition at line 863 of file debug.c.
References debug_handle::current_block, debug_handle::current_function, debug_handle::current_unit, debug_error(), debug_block::end, info, NULL, and debug_block::parent.
Referenced by finish_stab(), parse_ieee_be(), and parse_stab().
00866 { 00867 struct debug_handle *info = (struct debug_handle *) handle; 00868 00869 if (info->current_unit == NULL 00870 || info->current_block == NULL 00871 || info->current_function == NULL) 00872 { 00873 debug_error ("debug_end_function: no current function"); 00874 return false; 00875 } 00876 00877 if (info->current_block->parent != NULL) 00878 { 00879 debug_error ("debug_end_function: some blocks were not closed"); 00880 return false; 00881 } 00882 00883 info->current_block->end = addr; 00884 00885 info->current_function = NULL; 00886 info->current_block = NULL; 00887 00888 return true; 00889 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void debug_error | ( | char * | message | ) | const [static] |
Definition at line 584 of file debug.c.
Referenced by debug_add_to_current_namespace(), debug_end_block(), debug_end_common_block(), debug_end_function(), debug_find_named_type(), debug_make_undefined_tagged_type(), debug_name_type(), debug_record_function(), debug_record_label(), debug_record_line(), debug_record_parameter(), debug_record_variable(), debug_start_block(), debug_start_common_block(), debug_start_source(), debug_tag_type(), and debug_write_type().
00586 { 00587 fprintf (stderr, "%s\n", message); 00588 }
Here is the caller graph for this function:

| debug_type debug_find_named_type | ( | PTR | handle, | |
| const char * | name | |||
| ) |
Definition at line 2068 of file debug.c.
References debug_handle::current_block, debug_handle::current_unit, debug_error(), DEBUG_OBJECT_TYPE, DEBUG_TYPE_NULL, f, debug_unit::files, info, debug_namespace::list, debug_block::locals, n, NULL, debug_block::parent, and strcmp().
Referenced by parse_stab_array_type(), stab_demangle_fund_type(), stab_demangle_qualified(), and stab_demangle_type().
02071 { 02072 struct debug_handle *info = (struct debug_handle *) handle; 02073 struct debug_block *b; 02074 struct debug_file *f; 02075 02076 /* We only search the current compilation unit. I don't know if 02077 this is right or not. */ 02078 02079 if (info->current_unit == NULL) 02080 { 02081 debug_error ("debug_find_named_type: no current compilation unit"); 02082 return DEBUG_TYPE_NULL; 02083 } 02084 02085 for (b = info->current_block; b != NULL; b = b->parent) 02086 { 02087 if (b->locals != NULL) 02088 { 02089 struct debug_name *n; 02090 02091 for (n = b->locals->list; n != NULL; n = n->next) 02092 { 02093 if (n->kind == DEBUG_OBJECT_TYPE 02094 && n->name[0] == name[0] 02095 && strcmp (n->name, name) == 0) 02096 return n->u.type; 02097 } 02098 } 02099 } 02100 02101 for (f = info->current_unit->files; f != NULL; f = f->next) 02102 { 02103 if (f->globals != NULL) 02104 { 02105 struct debug_name *n; 02106 02107 for (n = f->globals->list; n != NULL; n = n->next) 02108 { 02109 if (n->kind == DEBUG_OBJECT_TYPE 02110 && n->name[0] == name[0] 02111 && strcmp (n->name, name) == 0) 02112 return n->u.type; 02113 } 02114 } 02115 } 02116 02117 return DEBUG_TYPE_NULL; 02118 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_find_tagged_type | ( | PTR | handle, | |
| const char * | name, | |||
| enum debug_type_kind | kind | |||
| ) |
Definition at line 2123 of file debug.c.
References DEBUG_KIND_ILLEGAL, DEBUG_OBJECT_TAG, DEBUG_TYPE_NULL, f, debug_unit::files, info, n, debug_unit::next, NULL, strcmp(), and debug_handle::units.
Referenced by ieee_read_cxx_class(), and stab_find_tagged_type().
02127 { 02128 struct debug_handle *info = (struct debug_handle *) handle; 02129 struct debug_unit *u; 02130 02131 /* We search the globals of all the compilation units. I don't know 02132 if this is correct or not. It would be easy to change. */ 02133 02134 for (u = info->units; u != NULL; u = u->next) 02135 { 02136 struct debug_file *f; 02137 02138 for (f = u->files; f != NULL; f = f->next) 02139 { 02140 struct debug_name *n; 02141 02142 if (f->globals != NULL) 02143 { 02144 for (n = f->globals->list; n != NULL; n = n->next) 02145 { 02146 if (n->kind == DEBUG_OBJECT_TAG 02147 && (kind == DEBUG_KIND_ILLEGAL 02148 || n->u.tag->kind == kind) 02149 && n->name[0] == name[0] 02150 && strcmp (n->name, name) == 0) 02151 return n->u.tag; 02152 } 02153 } 02154 } 02155 } 02156 02157 return DEBUG_TYPE_NULL; 02158 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bfd_vma debug_get_field_bitpos | ( | PTR | handle, | |
| debug_field | field | |||
| ) |
Definition at line 2373 of file debug.c.
References debug_field::f, NULL, debug_field::static_member, and debug_field::u.
Referenced by ieee_read_cxx_class().
02376 { 02377 if (field == NULL || field->static_member) 02378 return (bfd_vma) -1; 02379 return field->u.f.bitpos; 02380 }
Here is the caller graph for this function:

| bfd_vma debug_get_field_bitsize | ( | PTR | handle, | |
| debug_field | field | |||
| ) |
Definition at line 2386 of file debug.c.
References debug_field::f, NULL, debug_field::static_member, and debug_field::u.
Referenced by ieee_read_cxx_class().
02389 { 02390 if (field == NULL || field->static_member) 02391 return (bfd_vma) -1; 02392 return field->u.f.bitsize; 02393 }
Here is the caller graph for this function:

| const char* debug_get_field_name | ( | PTR | handle, | |
| debug_field | field | |||
| ) |
Definition at line 2360 of file debug.c.
References debug_field::name, and NULL.
Referenced by ieee_read_cxx_class().
Here is the caller graph for this function:

| const char* debug_get_field_physname | ( | PTR | handle, | |
| debug_field | field | |||
| ) |
Definition at line 2411 of file debug.c.
References NULL, debug_field::s, debug_field::static_member, and debug_field::u.
02414 { 02415 if (field == NULL || ! field->static_member) 02416 return NULL; 02417 return field->u.s.physname; 02418 }
| debug_type debug_get_field_type | ( | PTR | handle, | |
| debug_field | field | |||
| ) |
Definition at line 2347 of file debug.c.
References NULL, and debug_field::type.
Referenced by ieee_read_cxx_class(), and stab_demangle_qualified().
Here is the caller graph for this function:

| enum debug_visibility debug_get_field_visibility | ( | PTR | handle, | |
| debug_field | field | |||
| ) |
Definition at line 2399 of file debug.c.
References DEBUG_VISIBILITY_IGNORE, NULL, and debug_field::visibility.
02402 { 02403 if (field == NULL) 02404 return DEBUG_VISIBILITY_IGNORE; 02405 return field->visibility; 02406 }
| const debug_field* debug_get_fields | ( | PTR | handle, | |
| debug_type | type | |||
| ) |
Definition at line 2323 of file debug.c.
References debug_get_real_type(), DEBUG_KIND_CLASS, DEBUG_KIND_STRUCT, DEBUG_KIND_UNION, DEBUG_KIND_UNION_CLASS, debug_class_type::fields, debug_type::kclass, debug_type::kind, NULL, and debug_type::u.
Referenced by ieee_read_cxx_class(), and stab_demangle_qualified().
02326 { 02327 if (type == NULL) 02328 return NULL; 02329 type = debug_get_real_type (handle, type); 02330 switch (type->kind) 02331 { 02332 default: 02333 return NULL; 02334 case DEBUG_KIND_STRUCT: 02335 case DEBUG_KIND_UNION: 02336 case DEBUG_KIND_CLASS: 02337 case DEBUG_KIND_UNION_CLASS: 02338 return type->u.kclass->fields; 02339 } 02340 /*NOTREACHED*/ 02341 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const debug_type* debug_get_parameter_types | ( | PTR | handle, | |
| debug_type | type, | |||
| boolean * | pvarargs | |||
| ) |
Definition at line 2271 of file debug.c.
References debug_method_type::arg_types, debug_function_type::arg_types, debug_get_real_type(), DEBUG_KIND_FUNCTION, DEBUG_KIND_METHOD, debug_type::kfunction, debug_type::kind, debug_type::kmethod, NULL, debug_type::u, debug_method_type::varargs, and debug_function_type::varargs.
Referenced by ieee_read_cxx_class(), and parse_stab_members().
02275 { 02276 if (type == NULL) 02277 return NULL; 02278 type = debug_get_real_type (handle, type); 02279 switch (type->kind) 02280 { 02281 default: 02282 return NULL; 02283 case DEBUG_KIND_FUNCTION: 02284 *pvarargs = type->u.kfunction->varargs; 02285 return type->u.kfunction->arg_types; 02286 case DEBUG_KIND_METHOD: 02287 *pvarargs = type->u.kmethod->varargs; 02288 return type->u.kmethod->arg_types; 02289 } 02290 /*NOTREACHED*/ 02291 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static struct debug_type* debug_get_real_type | ( | PTR | handle, | |
| debug_type | type | |||
| ) | [static] |
Definition at line 2163 of file debug.c.
References DEBUG_KIND_INDIRECT, DEBUG_KIND_NAMED, DEBUG_KIND_TAGGED, debug_type::kind, debug_type::kindirect, debug_type::knamed, NULL, debug_indirect_type::slot, debug_named_type::type, and debug_type::u.
Referenced by debug_class_type_samep(), debug_get_fields(), debug_get_parameter_types(), debug_get_return_type(), debug_get_target_type(), debug_get_type_kind(), and debug_write_type().
02166 { 02167 switch (type->kind) 02168 { 02169 default: 02170 return type; 02171 case DEBUG_KIND_INDIRECT: 02172 if (*type->u.kindirect->slot != NULL) 02173 return debug_get_real_type (handle, *type->u.kindirect->slot); 02174 return type; 02175 case DEBUG_KIND_NAMED: 02176 case DEBUG_KIND_TAGGED: 02177 return debug_get_real_type (handle, type->u.knamed->type); 02178 } 02179 /*NOTREACHED*/ 02180 }
Here is the caller graph for this function:

| debug_type debug_get_return_type | ( | PTR | handle, | |
| debug_type | type | |||
| ) |
Definition at line 2248 of file debug.c.
References debug_get_real_type(), DEBUG_KIND_FUNCTION, DEBUG_KIND_METHOD, DEBUG_TYPE_NULL, debug_type::kfunction, debug_type::kind, debug_type::kmethod, NULL, debug_method_type::return_type, debug_function_type::return_type, and debug_type::u.
Referenced by ieee_read_cxx_class(), parse_ieee_bb(), and parse_stab_members().
02251 { 02252 if (type == NULL) 02253 return DEBUG_TYPE_NULL; 02254 type = debug_get_real_type (handle, type); 02255 switch (type->kind) 02256 { 02257 default: 02258 return DEBUG_TYPE_NULL; 02259 case DEBUG_KIND_FUNCTION: 02260 return type->u.kfunction->return_type; 02261 case DEBUG_KIND_METHOD: 02262 return type->u.kmethod->return_type; 02263 } 02264 /*NOTREACHED*/ 02265 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_get_target_type | ( | PTR | handle, | |
| debug_type | type | |||
| ) |
Definition at line 2296 of file debug.c.
References debug_get_real_type(), DEBUG_KIND_CONST, DEBUG_KIND_POINTER, DEBUG_KIND_REFERENCE, DEBUG_KIND_VOLATILE, debug_type::kconst, debug_type::kind, debug_type::kpointer, debug_type::kreference, debug_type::kvolatile, NULL, and debug_type::u.
Referenced by ieee_read_cxx_defaults(), and parse_ieee_ty().
02299 { 02300 if (type == NULL) 02301 return NULL; 02302 type = debug_get_real_type (handle, type); 02303 switch (type->kind) 02304 { 02305 default: 02306 return NULL; 02307 case DEBUG_KIND_POINTER: 02308 return type->u.kpointer; 02309 case DEBUG_KIND_REFERENCE: 02310 return type->u.kreference; 02311 case DEBUG_KIND_CONST: 02312 return type->u.kconst; 02313 case DEBUG_KIND_VOLATILE: 02314 return type->u.kvolatile; 02315 } 02316 /*NOTREACHED*/ 02317 }
Here is the call graph for this function:

Here is the caller graph for this function:

| enum debug_type_kind debug_get_type_kind | ( | PTR | handle, | |
| debug_type | type | |||
| ) |
Definition at line 2185 of file debug.c.
References debug_get_real_type(), DEBUG_KIND_ILLEGAL, debug_type::kind, and NULL.
Referenced by ieee_read_cxx_class(), ieee_read_cxx_defaults(), parse_ieee_atn(), parse_ieee_bb(), parse_ieee_ty(), parse_stab_members(), and parse_stab_type().
02188 { 02189 if (type == NULL) 02190 return DEBUG_KIND_ILLEGAL; 02191 type = debug_get_real_type (handle, type); 02192 return type->kind; 02193 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const char* debug_get_type_name | ( | PTR | handle, | |
| debug_type | type | |||
| ) |
Definition at line 2198 of file debug.c.
References DEBUG_KIND_INDIRECT, DEBUG_KIND_NAMED, DEBUG_KIND_TAGGED, debug_type::kind, debug_type::kindirect, debug_type::knamed, debug_name::name, debug_named_type::name, NULL, debug_indirect_type::slot, debug_indirect_type::tag, and debug_type::u.
Referenced by parse_stab_cpp_abbrev(), and stab_demangle_qualified().
02201 { 02202 if (type->kind == DEBUG_KIND_INDIRECT) 02203 { 02204 if (*type->u.kindirect->slot != NULL) 02205 return debug_get_type_name (handle, *type->u.kindirect->slot); 02206 return type->u.kindirect->tag; 02207 } 02208 if (type->kind == DEBUG_KIND_NAMED 02209 || type->kind == DEBUG_KIND_TAGGED) 02210 return type->u.knamed->name->name; 02211 return NULL; 02212 }
Here is the caller graph for this function:

| bfd_vma debug_get_type_size | ( | PTR | handle, | |
| debug_type | type | |||
| ) |
Definition at line 2217 of file debug.c.
References DEBUG_KIND_INDIRECT, DEBUG_KIND_NAMED, DEBUG_KIND_TAGGED, debug_type::kind, debug_type::kindirect, debug_type::knamed, NULL, debug_type::size, debug_indirect_type::slot, debug_named_type::type, and debug_type::u.
02220 { 02221 if (type == NULL) 02222 return 0; 02223 02224 /* We don't call debug_get_real_type, because somebody might have 02225 called debug_record_type_size on a named or indirect type. */ 02226 02227 if (type->size != 0) 02228 return type->size; 02229 02230 switch (type->kind) 02231 { 02232 default: 02233 return 0; 02234 case DEBUG_KIND_INDIRECT: 02235 if (*type->u.kindirect->slot != NULL) 02236 return debug_get_type_size (handle, *type->u.kindirect->slot); 02237 return 0; 02238 case DEBUG_KIND_NAMED: 02239 case DEBUG_KIND_TAGGED: 02240 return debug_get_type_size (handle, type->u.knamed->type); 02241 } 02242 /*NOTREACHED*/ 02243 }
| PTR debug_init | ( | ) |
Definition at line 656 of file debug.c.
References memset, and xmalloc().
Referenced by read_debugging_info().
00657 { 00658 struct debug_handle *ret; 00659 00660 ret = (struct debug_handle *) xmalloc (sizeof *ret); 00661 memset (ret, 0, sizeof *ret); 00662 return (PTR) ret; 00663 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_array_type | ( | PTR | handle, | |
| debug_type | element_type, | |||
| debug_type | range_type, | |||
| bfd_signed_vma | lower, | |||
| bfd_signed_vma | upper, | |||
| boolean | stringp | |||
| ) |
Definition at line 1548 of file debug.c.
References DEBUG_KIND_ARRAY, debug_make_type(), DEBUG_TYPE_NULL, debug_array_type::element_type, info, debug_type::karray, memset, NULL, debug_array_type::range_type, debug_type::u, and xmalloc().
Referenced by ieee_builtin_type(), parse_ieee_ty(), parse_stab_array_type(), and stab_demangle_type().
01556 { 01557 struct debug_handle *info = (struct debug_handle *) handle; 01558 struct debug_type *t; 01559 struct debug_array_type *a; 01560 01561 if (element_type == NULL || range_type == NULL) 01562 return DEBUG_TYPE_NULL; 01563 01564 t = debug_make_type (info, DEBUG_KIND_ARRAY, 0); 01565 if (t == NULL) 01566 return DEBUG_TYPE_NULL; 01567 01568 a = (struct debug_array_type *) xmalloc (sizeof *a); 01569 memset (a, 0, sizeof *a); 01570 01571 a->element_type = element_type; 01572 a->range_type = range_type; 01573 a->lower = lower; 01574 a->upper = upper; 01575 a->stringp = stringp; 01576 01577 t->u.karray = a; 01578 01579 return t; 01580 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_baseclass debug_make_baseclass | ( | PTR | handle, | |
| debug_type | type, | |||
| bfd_vma | bitpos, | |||
| boolean | virtual, | |||
| enum debug_visibility | visibility | |||
| ) |
Definition at line 1771 of file debug.c.
References memset, debug_baseclass::type, and xmalloc().
Referenced by ieee_read_cxx_class(), and parse_stab_baseclasses().
01777 { 01778 struct debug_baseclass *b; 01779 01780 b = (struct debug_baseclass *) xmalloc (sizeof *b); 01781 memset (b, 0, sizeof *b); 01782 01783 b->type = type; 01784 b->bitpos = bitpos; 01785 b->virtual = virtual; 01786 b->visibility = visibility; 01787 01788 return b; 01789 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_bool_type | ( | PTR | handle, | |
| unsigned int | size | |||
| ) |
Definition at line 1302 of file debug.c.
References DEBUG_KIND_BOOL, debug_make_type(), and info.
Referenced by stab_demangle_fund_type(), and stab_xcoff_builtin_type().
01305 { 01306 struct debug_handle *info = (struct debug_handle *) handle; 01307 01308 return debug_make_type (info, DEBUG_KIND_BOOL, size); 01309 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_complex_type | ( | PTR | handle, | |
| unsigned int | size | |||
| ) |
Definition at line 1314 of file debug.c.
References DEBUG_KIND_COMPLEX, debug_make_type(), and info.
Referenced by parse_ieee_ty(), parse_stab_range_type(), parse_stab_sun_floating_type(), and stab_xcoff_builtin_type().
01317 { 01318 struct debug_handle *info = (struct debug_handle *) handle; 01319 01320 return debug_make_type (info, DEBUG_KIND_COMPLEX, size); 01321 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_const_type | ( | PTR | handle, | |
| debug_type | type | |||
| ) |
Definition at line 1686 of file debug.c.
References DEBUG_KIND_CONST, debug_make_type(), DEBUG_TYPE_NULL, info, debug_type::kconst, NULL, and debug_type::u.
Referenced by parse_ieee_ty(), parse_stab_type(), stab_demangle_fund_type(), and stab_demangle_type().
01689 { 01690 struct debug_handle *info = (struct debug_handle *) handle; 01691 struct debug_type *t; 01692 01693 if (type == NULL) 01694 return DEBUG_TYPE_NULL; 01695 01696 t = debug_make_type (info, DEBUG_KIND_CONST, 0); 01697 if (t == NULL) 01698 return DEBUG_TYPE_NULL; 01699 01700 t->u.kconst = type; 01701 01702 return t; 01703 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_enum_type | ( | PTR | handle, | |
| const char ** | names, | |||
| bfd_signed_vma * | values | |||
| ) |
Definition at line 1403 of file debug.c.
References DEBUG_KIND_ENUM, debug_make_type(), DEBUG_TYPE_NULL, e, info, debug_type::kenum, memset, NULL, debug_type::u, and xmalloc().
Referenced by parse_ieee_ty(), and parse_stab_enum_type().
01407 { 01408 struct debug_handle *info = (struct debug_handle *) handle; 01409 struct debug_type *t; 01410 struct debug_enum_type *e; 01411 01412 t = debug_make_type (info, DEBUG_KIND_ENUM, 0); 01413 if (t == NULL) 01414 return DEBUG_TYPE_NULL; 01415 01416 e = (struct debug_enum_type *) xmalloc (sizeof *e); 01417 memset (e, 0, sizeof *e); 01418 01419 e->names = names; 01420 e->values = values; 01421 01422 t->u.kenum = e; 01423 01424 return t; 01425 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_field debug_make_field | ( | PTR | handle, | |
| const char * | name, | |||
| debug_type | type, | |||
| bfd_vma | bitpos, | |||
| bfd_vma | bitsize, | |||
| enum debug_visibility | visibility | |||
| ) |
Definition at line 1799 of file debug.c.
References f, memset, debug_field::type, debug_type::u, and xmalloc().
Referenced by ieee_read_cxx_class(), parse_ieee_ty(), parse_stab_cpp_abbrev(), and parse_stab_one_struct_field().
01806 { 01807 struct debug_field *f; 01808 01809 f = (struct debug_field *) xmalloc (sizeof *f); 01810 memset (f, 0, sizeof *f); 01811 01812 f->name = name; 01813 f->type = type; 01814 f->static_member = false; 01815 f->u.f.bitpos = bitpos; 01816 f->u.f.bitsize = bitsize; 01817 f->visibility = visibility; 01818 01819 return f; 01820 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_float_type | ( | PTR | handle, | |
| unsigned int | size | |||
| ) |
Definition at line 1290 of file debug.c.
References DEBUG_KIND_FLOAT, debug_make_type(), and info.
Referenced by ieee_builtin_type(), parse_stab_range_type(), parse_stab_sun_floating_type(), stab_demangle_fund_type(), and stab_xcoff_builtin_type().
01293 { 01294 struct debug_handle *info = (struct debug_handle *) handle; 01295 01296 return debug_make_type (info, DEBUG_KIND_FLOAT, size); 01297 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_function_type | ( | PTR | handle, | |
| debug_type | type, | |||
| debug_type * | arg_types, | |||
| boolean | varargs | |||
| ) |
Definition at line 1458 of file debug.c.
References debug_function_type::arg_types, DEBUG_KIND_FUNCTION, debug_make_type(), DEBUG_TYPE_NULL, f, info, debug_type::kfunction, memset, NULL, debug_type::u, and xmalloc().
Referenced by ieee_read_cxx_class(), parse_ieee_ty(), parse_stab_string(), parse_stab_type(), and stab_demangle_type().
01463 { 01464 struct debug_handle *info = (struct debug_handle *) handle; 01465 struct debug_type *t; 01466 struct debug_function_type *f; 01467 01468 if (type == NULL) 01469 return DEBUG_TYPE_NULL; 01470 01471 t = debug_make_type (info, DEBUG_KIND_FUNCTION, 0); 01472 if (t == NULL) 01473 return DEBUG_TYPE_NULL; 01474 01475 f = (struct debug_function_type *) xmalloc (sizeof *f); 01476 memset (f, 0, sizeof *f); 01477 01478 f->return_type = type; 01479 f->arg_types = arg_types; 01480 f->varargs = varargs; 01481 01482 t->u.kfunction = f; 01483 01484 return t; 01485 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_indirect_type | ( | PTR | handle, | |
| debug_type * | slot, | |||
| const char * | tag | |||
| ) |
Definition at line 1229 of file debug.c.
References DEBUG_KIND_INDIRECT, debug_make_type(), DEBUG_TYPE_NULL, info, debug_type::kindirect, memset, NULL, debug_indirect_type::slot, debug_type::u, and xmalloc().
Referenced by ieee_alloc_type(), ieee_read_cxx_class(), parse_ieee_atn(), parse_ieee_ty(), stab_find_tagged_type(), and stab_find_type().
01233 { 01234 struct debug_handle *info = (struct debug_handle *) handle; 01235 struct debug_type *t; 01236 struct debug_indirect_type *i; 01237 01238 t = debug_make_type (info, DEBUG_KIND_INDIRECT, 0); 01239 if (t == NULL) 01240 return DEBUG_TYPE_NULL; 01241 01242 i = (struct debug_indirect_type *) xmalloc (sizeof *i); 01243 memset (i, 0, sizeof *i); 01244 01245 i->slot = slot; 01246 i->tag = tag; 01247 01248 t->u.kindirect = i; 01249 01250 return t; 01251 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_int_type | ( | PTR | handle, | |
| unsigned int | size, | |||
| boolean | unsignedp | |||
| ) |
Definition at line 1268 of file debug.c.
References DEBUG_KIND_INT, debug_make_type(), DEBUG_TYPE_NULL, info, debug_type::kint, NULL, and debug_type::u.
Referenced by ieee_builtin_type(), parse_ieee_ty(), parse_stab_array_type(), parse_stab_range_type(), parse_stab_sun_builtin_type(), stab_demangle_fund_type(), stab_demangle_type(), and stab_xcoff_builtin_type().
01272 { 01273 struct debug_handle *info = (struct debug_handle *) handle; 01274 struct debug_type *t; 01275 01276 t = debug_make_type (info, DEBUG_KIND_INT, size); 01277 if (t == NULL) 01278 return DEBUG_TYPE_NULL; 01279 01280 t->u.kint = unsignedp; 01281 01282 return t; 01283 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_method debug_make_method | ( | PTR | handle, | |
| const char * | name, | |||
| debug_method_variant * | variants | |||
| ) |
Definition at line 1856 of file debug.c.
References memset, debug_method::variants, and xmalloc().
Referenced by parse_stab_members().
01860 { 01861 struct debug_method *m; 01862 01863 m = (struct debug_method *) xmalloc (sizeof *m); 01864 memset (m, 0, sizeof *m); 01865 01866 m->name = name; 01867 m->variants = variants; 01868 01869 return m; 01870 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_method_type | ( | PTR | handle, | |
| debug_type | return_type, | |||
| debug_type | domain_type, | |||
| debug_type * | arg_types, | |||
| boolean | varargs | |||
| ) |
Definition at line 1652 of file debug.c.
References debug_method_type::arg_types, DEBUG_KIND_METHOD, debug_make_type(), DEBUG_TYPE_NULL, debug_method_type::domain_type, info, debug_type::kmethod, memset, NULL, debug_method_type::return_type, debug_type::u, and xmalloc().
Referenced by ieee_read_cxx_class(), parse_stab_argtypes(), parse_stab_type(), and stab_demangle_type().
01658 { 01659 struct debug_handle *info = (struct debug_handle *) handle; 01660 struct debug_type *t; 01661 struct debug_method_type *m; 01662 01663 if (return_type == NULL) 01664 return DEBUG_TYPE_NULL; 01665 01666 t = debug_make_type (info, DEBUG_KIND_METHOD, 0); 01667 if (t == NULL) 01668 return DEBUG_TYPE_NULL; 01669 01670 m = (struct debug_method_type *) xmalloc (sizeof *m); 01671 memset (m, 0, sizeof *m); 01672 01673 m->return_type = return_type; 01674 m->domain_type = domain_type; 01675 m->arg_types = arg_types; 01676 m->varargs = varargs; 01677 01678 t->u.kmethod = m; 01679 01680 return t; 01681 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_method_variant debug_make_method_variant | ( | PTR | handle, | |
| const char * | physname, | |||
| debug_type | type, | |||
| enum debug_visibility | visibility, | |||
| boolean | constp, | |||
| boolean | volatilep, | |||
| bfd_vma | voffset, | |||
| debug_type | context | |||
| ) |
Definition at line 1883 of file debug.c.
References debug_method_variant::context, memset, debug_method_variant::type, and xmalloc().
Referenced by ieee_read_cxx_class(), and parse_stab_members().
01893 { 01894 struct debug_method_variant *m; 01895 01896 m = (struct debug_method_variant *) xmalloc (sizeof *m); 01897 memset (m, 0, sizeof *m); 01898 01899 m->physname = physname; 01900 m->type = type; 01901 m->visibility = visibility; 01902 m->constp = constp; 01903 m->volatilep = volatilep; 01904 m->voffset = voffset; 01905 m->context = context; 01906 01907 return m; 01908 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_object_type | ( | PTR | handle, | |
| boolean | structp, | |||
| bfd_vma | size, | |||
| debug_field * | fields, | |||
| debug_baseclass * | baseclasses, | |||
| debug_method * | methods, | |||
| debug_type | vptrbase, | |||
| boolean | ownvptr | |||
| ) |
Definition at line 1362 of file debug.c.
References debug_class_type::baseclasses, DEBUG_KIND_CLASS, DEBUG_KIND_UNION_CLASS, debug_make_type(), DEBUG_TYPE_NULL, debug_class_type::fields, info, debug_type::kclass, memset, debug_class_type::methods, NULL, debug_type::u, debug_class_type::vptrbase, and xmalloc().
Referenced by parse_stab_struct_type().
01372 { 01373 struct debug_handle *info = (struct debug_handle *) handle; 01374 struct debug_type *t; 01375 struct debug_class_type *c; 01376 01377 t = debug_make_type (info, 01378 structp ? DEBUG_KIND_CLASS : DEBUG_KIND_UNION_CLASS, 01379 size); 01380 if (t == NULL) 01381 return DEBUG_TYPE_NULL; 01382 01383 c = (struct debug_class_type *) xmalloc (sizeof *c); 01384 memset (c, 0, sizeof *c); 01385 01386 c->fields = fields; 01387 c->baseclasses = baseclasses; 01388 c->methods = methods; 01389 if (ownvptr) 01390 c->vptrbase = t; 01391 else 01392 c->vptrbase = vptrbase; 01393 01394 t->u.kclass = c; 01395 01396 return t; 01397 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_offset_type | ( | PTR | handle, | |
| debug_type | base_type, | |||
| debug_type | target_type | |||
| ) |
Definition at line 1620 of file debug.c.
References debug_offset_type::base_type, DEBUG_KIND_OFFSET, debug_make_type(), DEBUG_TYPE_NULL, info, debug_type::koffset, memset, NULL, debug_offset_type::target_type, debug_type::u, and xmalloc().
Referenced by parse_stab_type(), and stab_demangle_type().
01624 { 01625 struct debug_handle *info = (struct debug_handle *) handle; 01626 struct debug_type *t; 01627 struct debug_offset_type *o; 01628 01629 if (base_type == NULL || target_type == NULL) 01630 return DEBUG_TYPE_NULL; 01631 01632 t = debug_make_type (info, DEBUG_KIND_OFFSET, 0); 01633 if (t == NULL) 01634 return DEBUG_TYPE_NULL; 01635 01636 o = (struct debug_offset_type *) xmalloc (sizeof *o); 01637 memset (o, 0, sizeof *o); 01638 01639 o->base_type = base_type; 01640 o->target_type = target_type; 01641 01642 t->u.koffset = o; 01643 01644 return t; 01645 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_pointer_type | ( | PTR | handle, | |
| debug_type | type | |||
| ) |
Definition at line 1430 of file debug.c.
References DEBUG_KIND_POINTER, debug_make_type(), DEBUG_TYPE_NULL, info, debug_type::kpointer, NULL, debug_type::pointer, and debug_type::u.
Referenced by ieee_builtin_type(), parse_ieee_ty(), parse_stab_string(), parse_stab_type(), stab_demangle_fund_type(), and stab_demangle_type().
01433 { 01434 struct debug_handle *info = (struct debug_handle *) handle; 01435 struct debug_type *t; 01436 01437 if (type == NULL) 01438 return DEBUG_TYPE_NULL; 01439 01440 if (type->pointer != DEBUG_TYPE_NULL) 01441 return type->pointer; 01442 01443 t = debug_make_type (info, DEBUG_KIND_POINTER, 0); 01444 if (t == NULL) 01445 return DEBUG_TYPE_NULL; 01446 01447 t->u.kpointer = type; 01448 01449 type->pointer = t; 01450 01451 return t; 01452 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_range_type | ( | PTR | handle, | |
| debug_type | type, | |||
| bfd_signed_vma | lower, | |||
| bfd_signed_vma | upper | |||
| ) |
Definition at line 1512 of file debug.c.
References DEBUG_KIND_RANGE, debug_make_type(), DEBUG_TYPE_NULL, info, debug_type::krange, memset, NULL, debug_range_type::type, debug_type::u, and xmalloc().
Referenced by parse_ieee_ty(), and parse_stab_range_type().
01517 { 01518 struct debug_handle *info = (struct debug_handle *) handle; 01519 struct debug_type *t; 01520 struct debug_range_type *r; 01521 01522 if (type == NULL) 01523 return DEBUG_TYPE_NULL; 01524 01525 t = debug_make_type (info, DEBUG_KIND_RANGE, 0); 01526 if (t == NULL) 01527 return DEBUG_TYPE_NULL; 01528 01529 r = (struct debug_range_type *) xmalloc (sizeof *r); 01530 memset (r, 0, sizeof *r); 01531 01532 r->type = type; 01533 r->lower = lower; 01534 r->upper = upper; 01535 01536 t->u.krange = r; 01537 01538 return t; 01539 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_reference_type | ( | PTR | handle, | |
| debug_type | type | |||
| ) |
Definition at line 1490 of file debug.c.
References DEBUG_KIND_REFERENCE, debug_make_type(), DEBUG_TYPE_NULL, info, debug_type::kreference, NULL, and debug_type::u.
Referenced by ieee_read_cxx_defaults(), parse_stab_type(), and stab_demangle_type().
01493 { 01494 struct debug_handle *info = (struct debug_handle *) handle; 01495 struct debug_type *t; 01496 01497 if (type == NULL) 01498 return DEBUG_TYPE_NULL; 01499 01500 t = debug_make_type (info, DEBUG_KIND_REFERENCE, 0); 01501 if (t == NULL) 01502 return DEBUG_TYPE_NULL; 01503 01504 t->u.kreference = type; 01505 01506 return t; 01507 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_set_type | ( | PTR | handle, | |
| debug_type | type, | |||
| boolean | bitstringp | |||
| ) |
Definition at line 1587 of file debug.c.
References DEBUG_KIND_SET, debug_make_type(), DEBUG_TYPE_NULL, info, debug_type::kset, memset, NULL, debug_set_type::type, debug_type::u, and xmalloc().
Referenced by parse_ieee_ty(), and parse_stab_type().
01591 { 01592 struct debug_handle *info = (struct debug_handle *) handle; 01593 struct debug_type *t; 01594 struct debug_set_type *s; 01595 01596 if (type == NULL) 01597 return DEBUG_TYPE_NULL; 01598 01599 t = debug_make_type (info, DEBUG_KIND_SET, 0); 01600 if (t == NULL) 01601 return DEBUG_TYPE_NULL; 01602 01603 s = (struct debug_set_type *) xmalloc (sizeof *s); 01604 memset (s, 0, sizeof *s); 01605 01606 s->type = type; 01607 s->bitstringp = bitstringp; 01608 01609 t->u.kset = s; 01610 01611 return t; 01612 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_field debug_make_static_member | ( | PTR | handle, | |
| const char * | name, | |||
| debug_type | type, | |||
| const char * | physname, | |||
| enum debug_visibility | visibility | |||
| ) |
Definition at line 1830 of file debug.c.
References f, memset, debug_field::type, debug_type::u, and xmalloc().
Referenced by ieee_read_cxx_class(), and parse_stab_one_struct_field().
01836 { 01837 struct debug_field *f; 01838 01839 f = (struct debug_field *) xmalloc (sizeof *f); 01840 memset (f, 0, sizeof *f); 01841 01842 f->name = name; 01843 f->type = type; 01844 f->static_member = true; 01845 f->u.s.physname = physname; 01846 f->visibility = visibility; 01847 01848 return f; 01849 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_method_variant debug_make_static_method_variant | ( | PTR | handle, | |
| const char * | physname, | |||
| debug_type | type, | |||
| enum debug_visibility | visibility, | |||
| boolean | constp, | |||
| boolean | volatilep | |||
| ) |
Definition at line 1915 of file debug.c.
References memset, debug_method_variant::type, VOFFSET_STATIC_METHOD, and xmalloc().
Referenced by ieee_read_cxx_class(), and parse_stab_members().
01923 { 01924 struct debug_method_variant *m; 01925 01926 m = (struct debug_method_variant *) xmalloc (sizeof *m); 01927 memset (m, 0, sizeof *m); 01928 01929 m->physname = physname; 01930 m->type = type; 01931 m->visibility = visibility; 01932 m->constp = constp; 01933 m->volatilep = volatilep; 01934 m->voffset = VOFFSET_STATIC_METHOD; 01935 01936 return m; 01937 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_struct_type | ( | PTR | handle, | |
| boolean | structp, | |||
| bfd_vma | size, | |||
| debug_field * | fields | |||
| ) |
Definition at line 1328 of file debug.c.
References DEBUG_KIND_STRUCT, DEBUG_KIND_UNION, debug_make_type(), DEBUG_TYPE_NULL, debug_class_type::fields, info, debug_type::kclass, memset, NULL, debug_type::u, and xmalloc().
Referenced by parse_ieee_ty(), and parse_stab_struct_type().
01333 { 01334 struct debug_handle *info = (struct debug_handle *) handle; 01335 struct debug_type *t; 01336 struct debug_class_type *c; 01337 01338 t = debug_make_type (info, 01339 structp ? DEBUG_KIND_STRUCT : DEBUG_KIND_UNION, 01340 size); 01341 if (t == NULL) 01342 return DEBUG_TYPE_NULL; 01343 01344 c = (struct debug_class_type *) xmalloc (sizeof *c); 01345 memset (c, 0, sizeof *c); 01346 01347 c->fields = fields; 01348 01349 t->u.kclass = c; 01350 01351 return t; 01352 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static struct debug_type* debug_make_type | ( | struct debug_handle * | info, | |
| enum debug_type_kind | kind, | |||
| unsigned int | size | |||
| ) | [static] |
Definition at line 1209 of file debug.c.
References memset, and xmalloc().
Referenced by debug_make_array_type(), debug_make_bool_type(), debug_make_complex_type(), debug_make_const_type(), debug_make_enum_type(), debug_make_float_type(), debug_make_function_type(), debug_make_indirect_type(), debug_make_int_type(), debug_make_method_type(), debug_make_object_type(), debug_make_offset_type(), debug_make_pointer_type(), debug_make_range_type(), debug_make_reference_type(), debug_make_set_type(), debug_make_struct_type(), debug_make_undefined_tagged_type(), debug_make_void_type(), debug_make_volatile_type(), debug_name_type(), and debug_tag_type().
01213 { 01214 struct debug_type *t; 01215 01216 t = (struct debug_type *) xmalloc (sizeof *t); 01217 memset (t, 0, sizeof *t); 01218 01219 t->kind = kind; 01220 t->size = size; 01221 01222 return t; 01223 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_undefined_tagged_type | ( | PTR | handle, | |
| const char * | name, | |||
| enum debug_type_kind | kind | |||
| ) |
Definition at line 1731 of file debug.c.
References debug_error(), DEBUG_KIND_CLASS, DEBUG_KIND_ENUM, DEBUG_KIND_STRUCT, DEBUG_KIND_UNION, DEBUG_KIND_UNION_CLASS, debug_make_type(), debug_tag_type(), DEBUG_TYPE_NULL, info, and NULL.
Referenced by finish_stab().
01735 { 01736 struct debug_handle *info = (struct debug_handle *) handle; 01737 struct debug_type *t; 01738 01739 if (name == NULL) 01740 return DEBUG_TYPE_NULL; 01741 01742 switch (kind) 01743 { 01744 case DEBUG_KIND_STRUCT: 01745 case DEBUG_KIND_UNION: 01746 case DEBUG_KIND_CLASS: 01747 case DEBUG_KIND_UNION_CLASS: 01748 case DEBUG_KIND_ENUM: 01749 break; 01750 01751 default: 01752 debug_error ("debug_make_undefined_type: unsupported kind"); 01753 return DEBUG_TYPE_NULL; 01754 } 01755 01756 t = debug_make_type (info, kind, 0); 01757 if (t == NULL) 01758 return DEBUG_TYPE_NULL; 01759 01760 return debug_tag_type (handle, name, t); 01761 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_void_type | ( | PTR | handle | ) |
Definition at line 1256 of file debug.c.
References DEBUG_KIND_VOID, debug_make_type(), and info.
Referenced by ieee_builtin_type(), parse_ieee_atn(), parse_ieee_ty(), parse_stab_range_type(), parse_stab_sun_builtin_type(), parse_stab_type(), stab_demangle_fund_type(), and stab_xcoff_builtin_type().
01258 { 01259 struct debug_handle *info = (struct debug_handle *) handle; 01260 01261 return debug_make_type (info, DEBUG_KIND_VOID, 0); 01262 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_make_volatile_type | ( | PTR | handle, | |
| debug_type | type | |||
| ) |
Definition at line 1708 of file debug.c.
References DEBUG_KIND_VOLATILE, debug_make_type(), DEBUG_TYPE_NULL, info, debug_type::kvolatile, NULL, and debug_type::u.
Referenced by parse_ieee_ty(), parse_stab_type(), and stab_demangle_fund_type().
01711 { 01712 struct debug_handle *info = (struct debug_handle *) handle; 01713 struct debug_type *t; 01714 01715 if (type == NULL) 01716 return DEBUG_TYPE_NULL; 01717 01718 t = debug_make_type (info, DEBUG_KIND_VOLATILE, 0); 01719 if (t == NULL) 01720 return DEBUG_TYPE_NULL; 01721 01722 t->u.kvolatile = type; 01723 01724 return t; 01725 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_name_type | ( | PTR | handle, | |
| const char * | name, | |||
| debug_type | type | |||
| ) |
Definition at line 1942 of file debug.c.
References debug_handle::current_file, debug_handle::current_unit, debug_add_to_namespace(), debug_error(), DEBUG_KIND_NAMED, DEBUG_LINKAGE_NONE, debug_make_type(), DEBUG_OBJECT_TYPE, DEBUG_TYPE_NULL, debug_file::globals, info, debug_type::knamed, memset, n, NULL, debug_named_type::type, debug_name::type, debug_name::u, debug_type::u, and xmalloc().
Referenced by ieee_builtin_type(), parse_ieee_ty(), parse_stab_string(), stab_demangle_fund_type(), and stab_xcoff_builtin_type().
01946 { 01947 struct debug_handle *info = (struct debug_handle *) handle; 01948 struct debug_type *t; 01949 struct debug_named_type *n; 01950 struct debug_name *nm; 01951 01952 if (name == NULL || type == NULL) 01953 return DEBUG_TYPE_NULL; 01954 01955 if (info->current_unit == NULL 01956 || info->current_file == NULL) 01957 { 01958 debug_error ("debug_name_type: no current file"); 01959 return DEBUG_TYPE_NULL; 01960 /* return false; */ 01961 } 01962 01963 t = debug_make_type (info, DEBUG_KIND_NAMED, 0); 01964 if (t == NULL) 01965 return DEBUG_TYPE_NULL; 01966 01967 n = (struct debug_named_type *) xmalloc (sizeof *n); 01968 memset (n, 0, sizeof *n); 01969 01970 n->type = type; 01971 01972 t->u.knamed = n; 01973 01974 /* We always add the name to the global namespace. This is probably 01975 wrong in some cases, but it seems to be right for stabs. FIXME. */ 01976 01977 nm = debug_add_to_namespace (info, &info->current_file->globals, name, 01978 DEBUG_OBJECT_TYPE, DEBUG_LINKAGE_NONE); 01979 if (nm == NULL) 01980 return DEBUG_TYPE_NULL; 01981 01982 nm->u.type = t; 01983 01984 n->name = nm; 01985 01986 return t; 01987 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_record_float_const | ( | PTR | handle, | |
| const char * | name, | |||
| double | val | |||
| ) |
Definition at line 1077 of file debug.c.
References debug_add_to_current_namespace(), DEBUG_LINKAGE_NONE, DEBUG_OBJECT_FLOAT_CONSTANT, info, n, and NULL.
Referenced by parse_stab_string().
01081 { 01082 struct debug_handle *info = (struct debug_handle *) handle; 01083 struct debug_name *n; 01084 01085 if (name == NULL) 01086 return false; 01087 01088 n = debug_add_to_current_namespace (info, name, DEBUG_OBJECT_FLOAT_CONSTANT, 01089 DEBUG_LINKAGE_NONE); 01090 if (n == NULL) 01091 return false; 01092 01093 n->u.float_constant = val; 01094 01095 return true; 01096 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_record_function | ( | PTR | handle, | |
| const char * | name, | |||
| debug_type | return_type, | |||
| boolean | global, | |||
| bfd_vma | addr | |||
| ) |
Definition at line 764 of file debug.c.
References debug_handle::current_block, debug_handle::current_file, debug_handle::current_function, debug_handle::current_unit, debug_add_to_namespace(), debug_error(), DEBUG_LINKAGE_GLOBAL, DEBUG_LINKAGE_STATIC, DEBUG_OBJECT_FUNCTION, f, debug_file::globals, info, memset, n, NULL, debug_function::return_type, and xmalloc().
Referenced by parse_ieee_bb(), and parse_stab_string().
00770 { 00771 struct debug_handle *info = (struct debug_handle *) handle; 00772 struct debug_function *f; 00773 struct debug_block *b; 00774 struct debug_name *n; 00775 00776 if (name == NULL) 00777 name = ""; 00778 if (return_type == NULL) 00779 return false; 00780 00781 if (info->current_unit == NULL) 00782 { 00783 debug_error ("debug_record_function: no debug_set_filename call"); 00784 return false; 00785 } 00786 00787 f = (struct debug_function *) xmalloc (sizeof *f); 00788 memset (f, 0, sizeof *f); 00789 00790 f->return_type = return_type; 00791 00792 b = (struct debug_block *) xmalloc (sizeof *b); 00793 memset (b, 0, sizeof *b); 00794 00795 b->start = addr; 00796 b->end = (bfd_vma) -1; 00797 00798 f->blocks = b; 00799 00800 info->current_function = f; 00801 info->current_block = b; 00802 00803 /* FIXME: If we could handle nested functions, this would be the 00804 place: we would want to use a different namespace. */ 00805 n = debug_add_to_namespace (info, 00806 &info->current_file->globals, 00807 name, 00808 DEBUG_OBJECT_FUNCTION, 00809 (global 00810 ? DEBUG_LINKAGE_GLOBAL 00811 : DEBUG_LINKAGE_STATIC)); 00812 if (n == NULL) 00813 return false; 00814 00815 n->u.function = f; 00816 00817 return true; 00818 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_record_int_const | ( | PTR | handle, | |
| const char * | name, | |||
| bfd_vma | val | |||
| ) |
Definition at line 1053 of file debug.c.
References debug_add_to_current_namespace(), DEBUG_LINKAGE_NONE, DEBUG_OBJECT_INT_CONSTANT, info, n, and NULL.
Referenced by parse_stab_string().
01057 { 01058 struct debug_handle *info = (struct debug_handle *) handle; 01059 struct debug_name *n; 01060 01061 if (name == NULL) 01062 return false; 01063 01064 n = debug_add_to_current_namespace (info, name, DEBUG_OBJECT_INT_CONSTANT, 01065 DEBUG_LINKAGE_NONE); 01066 if (n == NULL) 01067 return false; 01068 01069 n->u.int_constant = val; 01070 01071 return true; 01072 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_record_label | ( | PTR | handle, | |
| const char * | name, | |||
| debug_type | type, | |||
| bfd_vma | addr | |||
| ) |
Definition at line 1133 of file debug.c.
References debug_error().
Referenced by parse_stab_string().
01138 { 01139 /* FIXME. */ 01140 debug_error ("debug_record_label not implemented"); 01141 return false; 01142 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_record_line | ( | PTR | handle, | |
| unsigned long | lineno, | |||
| bfd_vma | addr | |||
| ) |
Definition at line 969 of file debug.c.
References debug_lineno::addrs, debug_handle::current_file, debug_handle::current_lineno, debug_handle::current_unit, debug_error(), DEBUG_LINENO_COUNT, debug_lineno::file, info, debug_lineno::linenos, and NULL.
Referenced by parse_ieee_atn(), and parse_stab().
00973 { 00974 struct debug_handle *info = (struct debug_handle *) handle; 00975 struct debug_lineno *l; 00976 unsigned int i; 00977 00978 if (info->current_unit == NULL) 00979 { 00980 debug_error ("debug_record_line: no current unit"); 00981 return false; 00982 } 00983 00984 l = info->current_lineno; 00985 if (l != NULL && l->file == info->current_file) 00986 { 00987 for (i = 0; i < DEBUG_LINENO_COUNT; i++) 00988 { 00989 if (l->linenos[i] == (unsigned long) -1) 00990 { 00991 l->linenos[i] = lineno; 00992 l->addrs[i] = addr; 00993 return true; 00994 } 00995 } 00996 } 00997 00998 /* If we get here, then either 1) there is no current_lineno 00999 structure, which means this is the first line number in this 01000 compilation unit, 2) the current_lineno structure is for a 01001 different file, or 3) the current_lineno structure is full. 01002 Regardless, we want to allocate a new debug_lineno structure, put 01003 it in the right place, and make it the new current_lineno 01004 structure. */ 01005 01006 l = (struct debug_lineno *) xmalloc (sizeof *l); 01007 memset (l, 0, sizeof *l); 01008 01009 l->file = info->current_file; 01010 l->linenos[0] = lineno; 01011 l->addrs[0] = addr; 01012 for (i = 1; i < DEBUG_LINENO_COUNT; i++) 01013 l->linenos[i] = (unsigned long) -1; 01014 01015 if (info->current_lineno != NULL) 01016 info->current_lineno->next = l; 01017 else 01018 info->current_unit->linenos = l; 01019 01020 info->current_lineno = l; 01021 01022 return true; 01023 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_record_parameter | ( | PTR | handle, | |
| const char * | name, | |||
| debug_type | type, | |||
| enum debug_parm_kind | kind, | |||
| bfd_vma | val | |||
| ) |
Definition at line 823 of file debug.c.
References debug_handle::current_function, debug_handle::current_unit, debug_error(), info, debug_type::kind, memset, debug_parameter::next, NULL, p, debug_function::parameters, debug_parameter::type, and xmalloc().
Referenced by parse_stab_string().
00829 { 00830 struct debug_handle *info = (struct debug_handle *) handle; 00831 struct debug_parameter *p, **pp; 00832 00833 if (name == NULL || type == NULL) 00834 return false; 00835 00836 if (info->current_unit == NULL 00837 || info->current_function == NULL) 00838 { 00839 debug_error ("debug_record_parameter: no current function"); 00840 return false; 00841 } 00842 00843 p = (struct debug_parameter *) xmalloc (sizeof *p); 00844 memset (p, 0, sizeof *p); 00845 00846 p->name = name; 00847 p->type = type; 00848 p->kind = kind; 00849 p->val = val; 00850 00851 for (pp = &info->current_function->parameters; 00852 *pp != NULL; 00853 pp = &(*pp)->next) 00854 ; 00855 *pp = p; 00856 00857 return true; 00858 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_record_type_size | ( | PTR | handle, | |
| debug_type | type, | |||
| unsigned int | size | |||
| ) |
Definition at line 2049 of file debug.c.
References debug_type::size, and debug_named_type::type.
Referenced by parse_stab_type().
02053 { 02054 #if 0 02055 if (type->size != 0 && type->size != size) 02056 fprintf (stderr, "Warning: changing type size from %d to %d\n", 02057 type->size, size); 02058 #endif 02059 02060 type->size = size; 02061 02062 return true; 02063 }
Here is the caller graph for this function:

| boolean debug_record_typed_const | ( | PTR | handle, | |
| const char * | name, | |||
| debug_type | type, | |||
| bfd_vma | val | |||
| ) |
Definition at line 1101 of file debug.c.
References debug_add_to_current_namespace(), DEBUG_LINKAGE_NONE, DEBUG_OBJECT_TYPED_CONSTANT, info, memset, n, NULL, debug_typed_constant::type, and xmalloc().
Referenced by parse_stab_string().
01106 { 01107 struct debug_handle *info = (struct debug_handle *) handle; 01108 struct debug_name *n; 01109 struct debug_typed_constant *tc; 01110 01111 if (name == NULL || type == NULL) 01112 return false; 01113 01114 n = debug_add_to_current_namespace (info, name, DEBUG_OBJECT_TYPED_CONSTANT, 01115 DEBUG_LINKAGE_NONE); 01116 if (n == NULL) 01117 return false; 01118 01119 tc = (struct debug_typed_constant *) xmalloc (sizeof *tc); 01120 memset (tc, 0, sizeof *tc); 01121 01122 tc->type = type; 01123 tc->val = val; 01124 01125 n->u.typed_constant = tc; 01126 01127 return true; 01128 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_record_variable | ( | PTR | handle, | |
| const char * | name, | |||
| debug_type | type, | |||
| enum debug_var_kind | kind, | |||
| bfd_vma | val | |||
| ) |
Definition at line 1147 of file debug.c.
References debug_handle::current_block, debug_handle::current_file, debug_handle::current_unit, debug_add_to_namespace(), debug_error(), DEBUG_GLOBAL, DEBUG_LINKAGE_AUTOMATIC, DEBUG_LINKAGE_GLOBAL, DEBUG_LINKAGE_STATIC, DEBUG_OBJECT_VARIABLE, DEBUG_STATIC, debug_file::globals, info, debug_block::locals, memset, n, NULL, debug_variable::type, and xmalloc().
Referenced by parse_ieee_atn(), stab_emit_pending_vars(), and stab_record_variable().
01153 { 01154 struct debug_handle *info = (struct debug_handle *) handle; 01155 struct debug_namespace **nsp; 01156 enum debug_object_linkage linkage; 01157 struct debug_name *n; 01158 struct debug_variable *v; 01159 01160 if (name == NULL || type == NULL) 01161 return false; 01162 01163 if (info->current_unit == NULL 01164 || info->current_file == NULL) 01165 { 01166 debug_error ("debug_record_variable: no current file"); 01167 return false; 01168 } 01169 01170 if (kind == DEBUG_GLOBAL || kind == DEBUG_STATIC) 01171 { 01172 nsp = &info->current_file->globals; 01173 if (kind == DEBUG_GLOBAL) 01174 linkage = DEBUG_LINKAGE_GLOBAL; 01175 else 01176 linkage = DEBUG_LINKAGE_STATIC; 01177 } 01178 else 01179 { 01180 if (info->current_block == NULL) 01181 { 01182 debug_error ("debug_record_variable: no current block"); 01183 return false; 01184 } 01185 nsp = &info->current_block->locals; 01186 linkage = DEBUG_LINKAGE_AUTOMATIC; 01187 } 01188 01189 n = debug_add_to_namespace (info, nsp, name, DEBUG_OBJECT_VARIABLE, linkage); 01190 if (n == NULL) 01191 return false; 01192 01193 v = (struct debug_variable *) xmalloc (sizeof *v); 01194 memset (v, 0, sizeof *v); 01195 01196 v->kind = kind; 01197 v->type = type; 01198 v->val = val; 01199 01200 n->u.variable = v; 01201 01202 return true; 01203 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean debug_set_class_id | ( | struct debug_handle * | info, | |
| const char * | tag, | |||
| struct debug_type * | type | |||
| ) | [static] |
Definition at line 3076 of file debug.c.
References assert, DEBUG_KIND_CLASS, DEBUG_KIND_STRUCT, DEBUG_KIND_UNION, DEBUG_KIND_UNION_CLASS, debug_type_samep(), debug_class_type::id, debug_type::kclass, debug_type::kind, memset, debug_class_id::next, NULL, strcmp(), debug_class_id::tag, debug_class_id::type, debug_type::u, and xmalloc().
Referenced by debug_write_class_type(), and debug_write_type().
03080 { 03081 struct debug_class_type *c; 03082 struct debug_class_id *l; 03083 03084 assert (type->kind == DEBUG_KIND_STRUCT 03085 || type->kind == DEBUG_KIND_UNION 03086 || type->kind == DEBUG_KIND_CLASS 03087 || type->kind == DEBUG_KIND_UNION_CLASS); 03088 03089 c = type->u.kclass; 03090 03091 if (c->id > info->base_id) 03092 return true; 03093 03094 for (l = info->id_list; l != NULL; l = l->next) 03095 { 03096 if (l->type->kind != type->kind) 03097 continue; 03098 03099 if (tag == NULL) 03100 { 03101 if (l->tag != NULL) 03102 continue; 03103 } 03104 else 03105 { 03106 if (l->tag == NULL 03107 || l->tag[0] != tag[0] 03108 || strcmp (l->tag, tag) != 0) 03109 continue; 03110 } 03111 03112 if (debug_type_samep (info, l->type, type)) 03113 { 03114 c->id = l->type->u.kclass->id; 03115 return true; 03116 } 03117 } 03118 03119 /* There are no identical types. Use a new ID, and add it to the 03120 list. */ 03121 ++info->class_id; 03122 c->id = info->class_id; 03123 03124 l = (struct debug_class_id *) xmalloc (sizeof *l); 03125 memset (l, 0, sizeof *l); 03126 03127 l->type = type; 03128 l->tag = tag; 03129 03130 l->next = info->id_list; 03131 info->id_list = l; 03132 03133 return true; 03134 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_set_filename | ( | PTR | handle, | |
| const char * | name | |||
| ) |
Definition at line 669 of file debug.c.
References assert, debug_handle::current_block, debug_handle::current_file, debug_handle::current_function, debug_handle::current_lineno, debug_handle::current_unit, info, memset, debug_unit::next, NULL, debug_handle::units, and xmalloc().
Referenced by parse_ieee_bb(), and parse_stab().
00672 { 00673 struct debug_handle *info = (struct debug_handle *) handle; 00674 struct debug_file *nfile; 00675 struct debug_unit *nunit; 00676 00677 if (name == NULL) 00678 name = ""; 00679 00680 nfile = (struct debug_file *) xmalloc (sizeof *nfile); 00681 memset (nfile, 0, sizeof *nfile); 00682 00683 nfile->filename = name; 00684 00685 nunit = (struct debug_unit *) xmalloc (sizeof *nunit); 00686 memset (nunit, 0, sizeof *nunit); 00687 00688 nunit->files = nfile; 00689 info->current_file = nfile; 00690 00691 if (info->current_unit != NULL) 00692 info->current_unit->next = nunit; 00693 else 00694 { 00695 assert (info->units == NULL); 00696 info->units = nunit; 00697 } 00698 00699 info->current_unit = nunit; 00700 00701 info->current_function = NULL; 00702 info->current_block = NULL; 00703 info->current_lineno = NULL; 00704 00705 return true; 00706 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_start_block | ( | PTR | handle, | |
| bfd_vma | addr | |||
| ) |
Definition at line 897 of file debug.c.
References debug_block::children, debug_handle::current_block, debug_handle::current_unit, debug_error(), info, memset, debug_block::next, NULL, debug_block::start, and xmalloc().
Referenced by parse_ieee_bb(), and parse_stab().
00900 { 00901 struct debug_handle *info = (struct debug_handle *) handle; 00902 struct debug_block *b, **pb; 00903 00904 /* We must always have a current block: debug_record_function sets 00905 one up. */ 00906 if (info->current_unit == NULL 00907 || info->current_block == NULL) 00908 { 00909 debug_error ("debug_start_block: no current block"); 00910 return false; 00911 } 00912 00913 b = (struct debug_block *) xmalloc (sizeof *b); 00914 memset (b, 0, sizeof *b); 00915 00916 b->parent = info->current_block; 00917 b->start = addr; 00918 b->end = (bfd_vma) -1; 00919 00920 /* This new block is a child of the current block. */ 00921 for (pb = &info->current_block->children; 00922 *pb != NULL; 00923 pb = &(*pb)->next) 00924 ; 00925 *pb = b; 00926 00927 info->current_block = b; 00928 00929 return true; 00930 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_start_common_block | ( | PTR | handle, | |
| const char * | name | |||
| ) |
Definition at line 1029 of file debug.c.
References debug_error().
Referenced by parse_stab().
01032 { 01033 /* FIXME */ 01034 debug_error ("debug_start_common_block: not implemented"); 01035 return false; 01036 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_start_source | ( | PTR | handle, | |
| const char * | name | |||
| ) |
Definition at line 712 of file debug.c.
References debug_handle::current_file, debug_handle::current_unit, debug_error(), f, debug_unit::files, info, memset, debug_file::next, NULL, strcmp(), and xmalloc().
Referenced by parse_ieee_bb(), parse_ieee_be(), and parse_stab().
00715 { 00716 struct debug_handle *info = (struct debug_handle *) handle; 00717 struct debug_file *f, **pf; 00718 00719 if (name == NULL) 00720 name = ""; 00721 00722 if (info->current_unit == NULL) 00723 { 00724 debug_error ("debug_start_source: no debug_set_filename call"); 00725 return false; 00726 } 00727 00728 for (f = info->current_unit->files; f != NULL; f = f->next) 00729 { 00730 if (f->filename[0] == name[0] 00731 && f->filename[1] == name[1] 00732 && strcmp (f->filename, name) == 0) 00733 { 00734 info->current_file = f; 00735 return true; 00736 } 00737 } 00738 00739 f = (struct debug_file *) xmalloc (sizeof *f); 00740 memset (f, 0, sizeof *f); 00741 00742 f->filename = name; 00743 00744 for (pf = &info->current_file->next; 00745 *pf != NULL; 00746 pf = &(*pf)->next) 00747 ; 00748 *pf = f; 00749 00750 info->current_file = f; 00751 00752 return true; 00753 }
Here is the call graph for this function:

Here is the caller graph for this function:

| debug_type debug_tag_type | ( | PTR | handle, | |
| const char * | name, | |||
| debug_type | type | |||
| ) |
Definition at line 1992 of file debug.c.
References debug_handle::current_file, debug_add_to_namespace(), debug_error(), DEBUG_KIND_TAGGED, DEBUG_LINKAGE_NONE, debug_make_type(), DEBUG_OBJECT_TAG, DEBUG_TYPE_NULL, debug_file::globals, info, debug_type::kind, debug_type::knamed, memset, n, debug_name::name, debug_named_type::name, NULL, strcmp(), debug_name::tag, debug_named_type::type, debug_name::type, debug_name::u, debug_type::u, and xmalloc().
Referenced by debug_make_undefined_tagged_type(), parse_ieee_ty(), and parse_stab_string().
01996 { 01997 struct debug_handle *info = (struct debug_handle *) handle; 01998 struct debug_type *t; 01999 struct debug_named_type *n; 02000 struct debug_name *nm; 02001 02002 if (name == NULL || type == NULL) 02003 return DEBUG_TYPE_NULL; 02004 02005 if (info->current_file == NULL) 02006 { 02007 debug_error ("debug_tag_type: no current file"); 02008 return DEBUG_TYPE_NULL; 02009 } 02010 02011 if (type->kind == DEBUG_KIND_TAGGED) 02012 { 02013 if (strcmp (type->u.knamed->name->name, name) == 0) 02014 return type; 02015 debug_error ("debug_tag_type: extra tag attempted"); 02016 return DEBUG_TYPE_NULL; 02017 } 02018 02019 t = debug_make_type (info, DEBUG_KIND_TAGGED, 0); 02020 if (t == NULL) 02021 return DEBUG_TYPE_NULL; 02022 02023 n = (struct debug_named_type *) xmalloc (sizeof *n); 02024 memset (n, 0, sizeof *n); 02025 02026 n->type = type; 02027 02028 t->u.knamed = n; 02029 02030 /* We keep a global namespace of tags for each compilation unit. I 02031 don't know if that is the right thing to do. */ 02032 02033 nm = debug_add_to_namespace (info, &info->current_file->globals, name, 02034 DEBUG_OBJECT_TAG, DEBUG_LINKAGE_NONE); 02035 if (nm == NULL) 02036 return DEBUG_TYPE_NULL; 02037 02038 nm->u.tag = t; 02039 02040 n->name = nm; 02041 02042 return t; 02043 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean debug_type_samep | ( | struct debug_handle * | info, | |
| struct debug_type * | t1, | |||
| struct debug_type * | t2 | |||
| ) | [static] |
Definition at line 3140 of file debug.c.
References abort(), debug_method_type::arg_types, debug_function_type::arg_types, debug_offset_type::base_type, debug_set_type::bitstringp, debug_class_type_samep(), DEBUG_KIND_ARRAY, DEBUG_KIND_BOOL, DEBUG_KIND_CLASS, DEBUG_KIND_COMPLEX, DEBUG_KIND_CONST, DEBUG_KIND_ENUM, DEBUG_KIND_FLOAT, DEBUG_KIND_FUNCTION, DEBUG_KIND_INDIRECT, DEBUG_KIND_INT, DEBUG_KIND_METHOD, DEBUG_KIND_NAMED, DEBUG_KIND_OFFSET, DEBUG_KIND_POINTER, DEBUG_KIND_RANGE, DEBUG_KIND_REFERENCE, DEBUG_KIND_SET, DEBUG_KIND_STRUCT, DEBUG_KIND_TAGGED, DEBUG_KIND_UNION, DEBUG_KIND_UNION_CLASS, DEBUG_KIND_VOID, DEBUG_KIND_VOLATILE, debug_method_type::domain_type, debug_array_type::element_type, debug_class_type::id, debug_type::karray, debug_type::kclass, debug_type::kconst, debug_type::kenum, debug_type::kfunction, debug_type::kind, debug_type::kindirect, debug_type::kint, debug_type::kmethod, debug_type::knamed, debug_type::koffset, debug_type::kpointer, debug_type::krange, debug_type::kreference, debug_type::kset, debug_type::kvolatile, debug_array_type::lower, debug_range_type::lower, debug_name::name, debug_named_type::name, debug_enum_type::names, debug_type_compare_list::next, NULL, debug_method_type::return_type, debug_function_type::return_type, debug_type::size, debug_indirect_type::slot, strcmp(), debug_array_type::stringp, debug_type_compare_list::t1, debug_type_compare_list::t2, debug_offset_type::target_type, debug_set_type::type, debug_range_type::type, debug_named_type::type, debug_type::u, debug_array_type::upper, debug_range_type::upper, debug_enum_type::values, debug_method_type::varargs, and debug_function_type::varargs.
Referenced by debug_class_type_samep(), and debug_set_class_id().
03144 { 03145 struct debug_type_compare_list *l; 03146 struct debug_type_compare_list top; 03147 boolean ret; 03148 03149 if (t1 == NULL) 03150 return t2 == NULL; 03151 if (t2 == NULL) 03152 return false; 03153 03154 while (t1->kind == DEBUG_KIND_INDIRECT) 03155 { 03156 t1 = *t1->u.kindirect->slot; 03157 if (t1 == NULL) 03158 return false; 03159 } 03160 while (t2->kind == DEBUG_KIND_INDIRECT) 03161 { 03162 t2 = *t2->u.kindirect->slot; 03163 if (t2 == NULL) 03164 return false; 03165 } 03166 03167 if (t1 == t2) 03168 return true; 03169 03170 /* As a special case, permit a typedef to match a tag, since C++ 03171 debugging output will sometimes add a typedef where C debugging 03172 output will not. */ 03173 if (t1->kind == DEBUG_KIND_NAMED 03174 && t2->kind == DEBUG_KIND_TAGGED) 03175 return debug_type_samep (info, t1->u.knamed->type, t2); 03176 else if (t1->kind == DEBUG_KIND_TAGGED 03177 && t2->kind == DEBUG_KIND_NAMED) 03178 return debug_type_samep (info, t1, t2->u.knamed->type); 03179 03180 if (t1->kind != t2->kind 03181 || t1->size != t2->size) 03182 return false; 03183 03184 /* Get rid of the trivial cases first. */ 03185 switch (t1->kind) 03186 { 03187 default: 03188 break; 03189 case DEBUG_KIND_VOID: 03190 case DEBUG_KIND_FLOAT: 03191 case DEBUG_KIND_COMPLEX: 03192 case DEBUG_KIND_BOOL: 03193 return true; 03194 case DEBUG_KIND_INT: 03195 return t1->u.kint == t2->u.kint; 03196 } 03197 03198 /* We have to avoid an infinite recursion. We do this by keeping a 03199 list of types which we are comparing. We just keep the list on 03200 the stack. If we encounter a pair of types we are currently 03201 comparing, we just assume that they are equal. */ 03202 for (l = info->compare_list; l != NULL; l = l->next) 03203 { 03204 if (l->t1 == t1 && l->t2 == t2) 03205 return true; 03206 } 03207 03208 top.t1 = t1; 03209 top.t2 = t2; 03210 top.next = info->compare_list; 03211 info->compare_list = ⊤ 03212 03213 switch (t1->kind) 03214 { 03215 default: 03216 abort (); 03217 ret = false; 03218 break; 03219 03220 case DEBUG_KIND_STRUCT: 03221 case DEBUG_KIND_UNION: 03222 case DEBUG_KIND_CLASS: 03223 case DEBUG_KIND_UNION_CLASS: 03224 if (t1->u.kclass == NULL) 03225 ret = t2->u.kclass == NULL; 03226 else if (t2->u.kclass == NULL) 03227 ret = false; 03228 else if (t1->u.kclass->id > info->base_id 03229 && t1->u.kclass->id == t2->u.kclass->id) 03230 ret = true; 03231 else 03232 ret = debug_class_type_samep (info, t1, t2); 03233 break; 03234 03235 case DEBUG_KIND_ENUM: 03236 if (t1->u.kenum == NULL) 03237 ret = t2->u.kenum == NULL; 03238 else if (t2->u.kenum == NULL) 03239 ret = false; 03240 else 03241 { 03242 const char **pn1, **pn2; 03243 bfd_signed_vma *pv1, *pv2; 03244 03245 pn1 = t1->u.kenum->names; 03246 pn2 = t2->u.kenum->names; 03247 pv1 = t1->u.kenum->values; 03248 pv2 = t2->u.kenum->values; 03249 while (*pn1 != NULL && *pn2 != NULL) 03250 { 03251 if (**pn1 != **pn2 03252 || *pv1 != *pv2 03253 || strcmp (*pn1, *pn2) != 0) 03254 break; 03255 ++pn1; 03256 ++pn2; 03257 ++pv1; 03258 ++pv2; 03259 } 03260 ret = *pn1 == NULL && *pn2 == NULL; 03261 } 03262 break; 03263 03264 case DEBUG_KIND_POINTER: 03265 ret = debug_type_samep (info, t1->u.kpointer, t2->u.kpointer); 03266 break; 03267 03268 case DEBUG_KIND_FUNCTION: 03269 if (t1->u.kfunction->varargs != t2->u.kfunction->varargs 03270 || ! debug_type_samep (info, t1->u.kfunction->return_type, 03271 t2->u.kfunction->return_type) 03272 || ((t1->u.kfunction->arg_types == NULL) 03273 != (t2->u.kfunction->arg_types == NULL))) 03274 ret = false; 03275 else if (t1->u.kfunction->arg_types == NULL) 03276 ret = true; 03277 else 03278 { 03279 struct debug_type **a1, **a2; 03280 03281 a1 = t1->u.kfunction->arg_types; 03282 a2 = t2->u.kfunction->arg_types; 03283 while (*a1 != NULL && *a2 != NULL) 03284 if (! debug_type_samep (info, *a1, *a2)) 03285 break; 03286 ret = *a1 == NULL && *a2 == NULL; 03287 } 03288 break; 03289 03290 case DEBUG_KIND_REFERENCE: 03291 ret = debug_type_samep (info, t1->u.kreference, t2->u.kreference); 03292 break; 03293 03294 case DEBUG_KIND_RANGE: 03295 ret = (t1->u.krange->lower == t2->u.krange->lower 03296 && t1->u.krange->upper == t2->u.krange->upper 03297 && debug_type_samep (info, t1->u.krange->type, 03298 t2->u.krange->type)); 03299 03300 case DEBUG_KIND_ARRAY: 03301 ret = (t1->u.karray->lower == t2->u.karray->lower 03302 && t1->u.karray->upper == t2->u.karray->upper 03303 && t1->u.karray->stringp == t2->u.karray->stringp 03304 && debug_type_samep (info, t1->u.karray->element_type, 03305 t2->u.karray->element_type)); 03306 break; 03307 03308 case DEBUG_KIND_SET: 03309 ret = (t1->u.kset->bitstringp == t2->u.kset->bitstringp 03310 && debug_type_samep (info, t1->u.kset->type, t2->u.kset->type)); 03311 break; 03312 03313 case DEBUG_KIND_OFFSET: 03314 ret = (debug_type_samep (info, t1->u.koffset->base_type, 03315 t2->u.koffset->base_type) 03316 && debug_type_samep (info, t1->u.koffset->target_type, 03317 t2->u.koffset->target_type)); 03318 break; 03319 03320 case DEBUG_KIND_METHOD: 03321 if (t1->u.kmethod->varargs != t2->u.kmethod->varargs 03322 || ! debug_type_samep (info, t1->u.kmethod->return_type, 03323 t2->u.kmethod->return_type) 03324 || ! debug_type_samep (info, t1->u.kmethod->domain_type, 03325 t2->u.kmethod->domain_type) 03326 || ((t1->u.kmethod->arg_types == NULL) 03327 != (t2->u.kmethod->arg_types == NULL))) 03328 ret = false; 03329 else if (t1->u.kmethod->arg_types == NULL) 03330 ret = true; 03331 else 03332 { 03333 struct debug_type **a1, **a2; 03334 03335 a1 = t1->u.kmethod->arg_types; 03336 a2 = t2->u.kmethod->arg_types; 03337 while (*a1 != NULL && *a2 != NULL) 03338 if (! debug_type_samep (info, *a1, *a2)) 03339 break; 03340 ret = *a1 == NULL && *a2 == NULL; 03341 } 03342 break; 03343 03344 case DEBUG_KIND_CONST: 03345 ret = debug_type_samep (info, t1->u.kconst, t2->u.kconst); 03346 break; 03347 03348 case DEBUG_KIND_VOLATILE: 03349 ret = debug_type_samep (info, t1->u.kvolatile, t2->u.kvolatile); 03350 break; 03351 03352 case DEBUG_KIND_NAMED: 03353 case DEBUG_KIND_TAGGED: 03354 ret = (strcmp (t1->u.knamed->name->name, t2->u.knamed->name->name) == 0 03355 && debug_type_samep (info, t1->u.knamed->type, 03356 t2->u.knamed->type)); 03357 break; 03358 } 03359 03360 info->compare_list = top.next; 03361 03362 return ret; 03363 }
Here is the call graph for this function:

Here is the caller graph for this function:

| boolean debug_write | ( | PTR | handle, | |
| const struct debug_write_fns * | fns, | |||
| PTR | fhandle | |||
| ) |
Definition at line 2424 of file debug.c.
References debug_handle::base_id, debug_handle::class_id, debug_handle::current_write_lineno, debug_handle::current_write_lineno_index, debug_write_linenos(), debug_write_name(), f, debug_file::filename, debug_unit::files, debug_handle::id_list, info, debug_unit::linenos, debug_handle::mark, n, debug_unit::next, NULL, and debug_handle::units.
Referenced by pstack_install_segv_action(), and write_ieee_debugging_info().
02428 { 02429 struct debug_handle *info = (struct debug_handle *) handle; 02430 struct debug_unit *u; 02431 02432 /* We use a mark to tell whether we have already written out a 02433 particular name. We use an integer, so that we don't have to 02434 clear the mark fields if we happen to write out the same 02435 information more than once. */ 02436 ++info->mark; 02437 02438 /* The base_id field holds an ID value which will never be used, so 02439 that we can tell whether we have assigned an ID during this call 02440 to debug_write. */ 02441 info->base_id = info->class_id; 02442 02443 /* We keep a linked list of classes for which was have assigned ID's 02444 during this call to debug_write. */ 02445 info->id_list = NULL; 02446 02447 for (u = info->units; u != NULL; u = u->next) 02448 { 02449 struct debug_file *f; 02450 boolean first_file; 02451 02452 info->current_write_lineno = u->linenos; 02453 info->current_write_lineno_index = 0; 02454 02455 if (! (*fns->start_compilation_unit) (fhandle, u->files->filename)) 02456 return false; 02457 02458 first_file = true; 02459 for (f = u->files; f != NULL; f = f->next) 02460 { 02461 struct debug_name *n; 02462 02463 if (first_file) 02464 first_file = false; 02465 else 02466 { 02467 if (! (*fns->start_source) (fhandle, f->filename)) 02468 return false; 02469 } 02470 02471 if (f->globals != NULL) 02472 { 02473 for (n = f->globals->list; n != NULL; n = n->next) 02474 { 02475 if (! debug_write_name (info, fns, fhandle, n)) 02476 return false; 02477 } 02478 } 02479 } 02480 02481 /* Output any line number information which hasn't already been 02482 handled. */ 02483 if (! debug_write_linenos (info, fns, fhandle, (bfd_vma) -1)) 02484 return false; 02485 } 02486 02487 return true; 02488 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean debug_write_block | ( | struct debug_handle * | info, | |
| const struct debug_write_fns * | fns, | |||
| PTR | fhandle, | |||
| struct debug_block * | block | |||
| ) | [static] |
Definition at line 2984 of file debug.c.
References yaSSL::block, debug_write_linenos(), debug_write_name(), n, debug_block::next, and NULL.
Referenced by debug_write_function().
02989 { 02990 struct debug_name *n; 02991 struct debug_block *b; 02992 02993 if (! debug_write_linenos (info, fns, fhandle, block->start)) 02994 return false; 02995 02996 /* I can't see any point to writing out a block with no local 02997 variables, so we don't bother, except for the top level block. */ 02998 if (block->locals != NULL || block->parent == NULL) 02999 { 03000 if (! (*fns->start_block) (fhandle, block->start)) 03001 return false; 03002 } 03003 03004 if (block->locals != NULL) 03005 { 03006 for (n = block->locals->list; n != NULL; n = n->next) 03007 { 03008 if (! debug_write_name (info, fns, fhandle, n)) 03009 return false; 03010 } 03011 } 03012 03013 for (b = block->children; b != NULL; b = b->next) 03014 { 03015 if (! debug_write_block (info, fns, fhandle, b)) 03016 return false; 03017 } 03018 03019 if (! debug_write_linenos (info, fns, fhandle, block->end)) 03020 return false; 03021 03022 if (block->locals != NULL || block->parent == NULL) 03023 { 03024 if (! (*fns->end_block) (fhandle, block->end)) 03025 return false; 03026 } 03027 03028 return true; 03029 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean debug_write_class_type | ( | struct debug_handle * | info, | |
| const struct debug_write_fns * | fns, | |||
| PTR | fhandle, | |||
| struct debug_type * | type, | |||
| const char * | tag | |||
| ) | [static] |
Definition at line 2790 of file debug.c.
References assert, debug_class_type::baseclasses, DEBUG_KIND_CLASS, debug_set_class_id(), debug_write_type(), f, debug_class_type::fields, debug_class_type::id, id, debug_type::kclass, debug_type::kind, debug_class_type::mark, NULL, debug_type::size, debug_type::u, and debug_class_type::vptrbase.
Referenced by debug_write_type().
02796 { 02797 unsigned int i; 02798 unsigned int id; 02799 struct debug_type *vptrbase; 02800 02801 if (type->u.kclass == NULL) 02802 { 02803 id = 0; 02804 vptrbase = NULL; 02805 } 02806 else 02807 { 02808 if (type->u.kclass->id <= info->base_id) 02809 { 02810 if (! debug_set_class_id (info, tag, type)) 02811 return false; 02812 } 02813 02814 if (info->mark == type->u.kclass->mark) 02815 { 02816 /* We are currently outputting this class, or we have 02817 already output it. This can happen when there are 02818 methods for an anonymous class. */ 02819 assert (type->u.kclass->id > info->base_id); 02820 return (*fns->tag_type) (fhandle, tag, type->u.kclass->id, 02821 type->kind); 02822 } 02823 type->u.kclass->mark = info->mark; 02824 id = type->u.kclass->id; 02825 02826 vptrbase = type->u.kclass->vptrbase; 02827 if (vptrbase != NULL && vptrbase != type) 02828 { 02829 if (! debug_write_type (info, fns, fhandle, vptrbase, 02830 (struct debug_name *) NULL)) 02831 return false; 02832 } 02833 } 02834 02835 if (! (*fns->start_class_type) (fhandle, tag, id, 02836 type->kind == DEBUG_KIND_CLASS, 02837 type->size, 02838 vptrbase != NULL, 02839 vptrbase == type)) 02840 return false; 02841 02842 if (type->u.kclass != NULL) 02843 { 02844 if (type->u.kclass->fields != NULL) 02845 { 02846 for (i = 0; type->u.kclass->fields[i] != NULL; i++) 02847 { 02848 struct debug_field *f; 02849 02850 f = type->u.kclass->fields[i]; 02851 if (! debug_write_type (info, fns, fhandle, f->type, 02852 (struct debug_name *) NULL)) 02853 return false; 02854 if (f->static_member) 02855 { 02856 if (! (*fns->class_static_member) (fhandle, f->name, 02857 f->u.s.physname, 02858 f->visibility)) 02859 return false; 02860 } 02861 else 02862 { 02863 if (! (*fns->struct_field) (fhandle, f->name, f->u.f.bitpos, 02864 f->u.f.bitsize, f->visibility)) 02865 return false; 02866 } 02867 } 02868 } 02869 02870 if (type->u.kclass->baseclasses != NULL) 02871 { 02872 for (i = 0; type->u.kclass->baseclasses[i] != NULL; i++) 02873 { 02874 struct debug_baseclass *b; 02875 02876 b = type->u.kclass->baseclasses[i]; 02877 if (! debug_write_type (info, fns, fhandle, b->type, 02878 (struct debug_name *) NULL)) 02879 return false; 02880 if (! (*fns->class_baseclass) (fhandle, b->bitpos, b->virtual, 02881 b->visibility)) 02882 return false; 02883 } 02884 } 02885 02886 if (type->u.kclass->methods != NULL) 02887 { 02888 for (i = 0; type->u.kclass->methods[i] != NULL; i++) 02889 { 02890 struct debug_method *m; 02891 unsigned int j; 02892 02893 m = type->u.kclass->methods[i]; 02894 if (! (*fns->class_start_method) (fhandle, m->name)) 02895 return false; 02896 for (j = 0; m->variants[j] != NULL; j++) 02897 { 02898 struct debug_method_variant *v; 02899 02900 v = m->variants[j]; 02901 if (v->context != NULL) 02902 { 02903 if (! debug_write_type (info, fns, fhandle, v->context, 02904 (struct debug_name *) NULL)) 02905 return false; 02906 } 02907 if (! debug_write_type (info, fns, fhandle, v->type, 02908 (struct debug_name *) NULL)) 02909 return false; 02910 if (v->voffset != VOFFSET_STATIC_METHOD) 02911 { 02912 if (! (*fns->class_method_variant) (fhandle, v->physname, 02913 v->visibility, 02914 v->constp, 02915 v->volatilep, 02916 v->voffset, 02917 v->context != NULL)) 02918 return false; 02919 } 02920 else 02921 { 02922 if (! (*fns->class_static_method_variant) (fhandle, 02923 v->physname, 02924 v->visibility, 02925 v->constp, 02926 v->volatilep)) 02927 return false; 02928 } 02929 } 02930 if (! (*fns->class_end_method) (fhandle)) 02931 return false; 02932 } 02933 } 02934 } 02935 02936 return (*fns->end_class_type) (fhandle); 02937 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean debug_write_function | ( | struct debug_handle * | info, | |
| const struct debug_write_fns * | fns, | |||
| PTR | fhandle, | |||
| const char * | name, | |||
| enum debug_object_linkage | linkage, | |||
| struct debug_function * | function | |||
| ) | [static] |
Definition at line 2942 of file debug.c.
References debug_function::blocks, DEBUG_LINKAGE_GLOBAL, debug_write_block(), debug_write_linenos(), debug_write_type(), debug_block::next, NULL, p, debug_function::parameters, debug_function::return_type, and debug_block::start.
Referenced by debug_write_name().
02949 { 02950 struct debug_parameter *p; 02951 struct debug_block *b; 02952 02953 if (! debug_write_linenos (info, fns, fhandle, function->blocks->start)) 02954 return false; 02955 02956 if (! debug_write_type (info, fns, fhandle, function->return_type, 02957 (struct debug_name *) NULL)) 02958 return false; 02959 02960 if (! (*fns->start_function) (fhandle, name, 02961 linkage == DEBUG_LINKAGE_GLOBAL)) 02962 return false; 02963 02964 for (p = function->parameters; p != NULL; p = p->next) 02965 { 02966 if (! debug_write_type (info, fns, fhandle, p->type, 02967 (struct debug_name *) NULL) 02968 || ! (*fns->function_parameter) (fhandle, p->name, p->kind, p->val)) 02969 return false; 02970 } 02971 02972 for (b = function->blocks; b != NULL; b = b->next) 02973 { 02974 if (! debug_write_block (info, fns, fhandle, b)) 02975 return false; 02976 } 02977 02978 return (*fns->end_function) (fhandle); 02979 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean debug_write_linenos | ( | struct debug_handle * | info, | |
| const struct debug_write_fns * | fns, | |||
| PTR | fhandle, | |||
| bfd_vma | address | |||
| ) | [static] |
Definition at line 3034 of file debug.c.
References debug_lineno::addrs, debug_lineno::file, debug_file::filename, debug_lineno::linenos, debug_lineno::next, and NULL.
Referenced by debug_write(), debug_write_block(), and debug_write_function().
03039 { 03040 while (info->current_write_lineno != NULL) 03041 { 03042 struct debug_lineno *l; 03043 03044 l = info->current_write_lineno; 03045 03046 while (info->current_write_lineno_index < DEBUG_LINENO_COUNT) 03047 { 03048 if (l->linenos[info->current_write_lineno_index] 03049 == (unsigned long) -1) 03050 break; 03051 03052 if (l->addrs[info->current_write_lineno_index] >= address) 03053 return true; 03054 03055 if (! (*fns->lineno) (fhandle, l->file->filename, 03056 l->linenos[info->current_write_lineno_index], 03057 l->addrs[info->current_write_lineno_index])) 03058 return false; 03059 03060 ++info->current_write_lineno_index; 03061 } 03062 03063 info->current_write_lineno = l->next; 03064 info->current_write_lineno_index = 0; 03065 } 03066 03067 return true; 03068 }
Here is the caller graph for this function:

| static boolean debug_write_name | ( | struct debug_handle * | info, | |
| const struct debug_write_fns * | fns, | |||
| PTR | fhandle, | |||
| struct debug_name * | n | |||
| ) | [static] |
Definition at line 2493 of file debug.c.
References abort(), DEBUG_OBJECT_FLOAT_CONSTANT, DEBUG_OBJECT_FUNCTION, DEBUG_OBJECT_INT_CONSTANT, DEBUG_OBJECT_TAG, DEBUG_OBJECT_TYPE, DEBUG_OBJECT_TYPED_CONSTANT, DEBUG_OBJECT_VARIABLE, debug_write_function(), debug_write_type(), n, and NULL.
Referenced by debug_write(), and debug_write_block().
02498 { 02499 switch (n->kind) 02500 { 02501 case DEBUG_OBJECT_TYPE: 02502 if (! debug_write_type (info, fns, fhandle, n->u.type, n) 02503 || ! (*fns->typdef) (fhandle, n->name)) 02504 return false; 02505 return true; 02506 case DEBUG_OBJECT_TAG: 02507 if (! debug_write_type (info, fns, fhandle, n->u.tag, n)) 02508 return false; 02509 return (*fns->tag) (fhandle, n->name); 02510 case DEBUG_OBJECT_VARIABLE: 02511 if (! debug_write_type (info, fns, fhandle, n->u.variable->type, 02512 (struct debug_name *) NULL)) 02513 return false; 02514 return (*fns->variable) (fhandle, n->name, n->u.variable->kind, 02515 n->u.variable->val); 02516 case DEBUG_OBJECT_FUNCTION: 02517 return debug_write_function (info, fns, fhandle, n->name, 02518 n->linkage, n->u.function); 02519 case DEBUG_OBJECT_INT_CONSTANT: 02520 return (*fns->int_constant) (fhandle, n->name, n->u.int_constant); 02521 case DEBUG_OBJECT_FLOAT_CONSTANT: 02522 return (*fns->float_constant) (fhandle, n->name, n->u.float_constant); 02523 case DEBUG_OBJECT_TYPED_CONSTANT: 02524 if (! debug_write_type (info, fns, fhandle, n->u.typed_constant->type, 02525 (struct debug_name *) NULL)) 02526 return false; 02527 return (*fns->typed_constant) (fhandle, n->name, 02528 n->u.typed_constant->val); 02529 default: 02530 abort (); 02531 return false; 02532 } 02533 /*NOTREACHED*/ 02534 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean debug_write_type | ( | struct debug_handle * | info, | |
| const struct debug_write_fns * | fns, | |||
| PTR | fhandle, | |||
| struct debug_type * | type, | |||
| struct debug_name * | name | |||
| ) | [static] |
Definition at line 2543 of file debug.c.
References debug_method_type::arg_types, debug_function_type::arg_types, assert, debug_offset_type::base_type, debug_set_type::bitstringp, debug_error(), debug_get_real_type(), DEBUG_KIND_ARRAY, DEBUG_KIND_BOOL, DEBUG_KIND_CLASS, DEBUG_KIND_COMPLEX, DEBUG_KIND_ENUM, DEBUG_KIND_FLOAT, DEBUG_KIND_FUNCTION, DEBUG_KIND_ILLEGAL, DEBUG_KIND_INDIRECT, DEBUG_KIND_INT, DEBUG_KIND_METHOD, DEBUG_KIND_NAMED, DEBUG_KIND_OFFSET, DEBUG_KIND_POINTER, DEBUG_KIND_RANGE, DEBUG_KIND_REFERENCE, DEBUG_KIND_SET, DEBUG_KIND_STRUCT, DEBUG_KIND_TAGGED, DEBUG_KIND_UNION, DEBUG_KIND_UNION_CLASS, DEBUG_KIND_VOID, DEBUG_OBJECT_TAG, debug_set_class_id(), DEBUG_TYPE_NULL, debug_write_class_type(), debug_array_type::element_type, f, debug_class_type::fields, debug_class_type::id, id, debug_type::karray, debug_type::kclass, debug_type::kenum, debug_type::kfunction, debug_type::kind, debug_type::kindirect, debug_type::kint, debug_type::kmethod, debug_type::knamed, debug_type::koffset, debug_type::kpointer, debug_type::krange, debug_type::kreference, debug_type::kset, debug_array_type::lower, debug_range_type::lower, debug_class_type::mark, debug_name::mark, debug_name::name, name, debug_named_type::name, debug_enum_type::names, NULL, debug_array_type::range_type, debug_method_type::return_type, debug_function_type::return_type, debug_type::size, debug_indirect_type::slot, debug_array_type::stringp, debug_name::tag, debug_offset_type::target_type, debug_set_type::type, debug_range_type::type, debug_name::type, debug_type::u, debug_array_type::upper, debug_range_type::upper, debug_enum_type::values, and debug_function_type::varargs.
Referenced by debug_write_class_type(), debug_write_function(), and debug_write_name().
02549 { 02550 unsigned int i; 02551 int is; 02552 const char *tag; 02553 02554 /* If we have a name for this type, just output it. We only output 02555 typedef names after they have been defined. We output type tags 02556 whenever we are not actually defining them. */ 02557 if ((type->kind == DEBUG_KIND_NAMED 02558 || type->kind == DEBUG_KIND_TAGGED) 02559 && (type->u.knamed->name->mark == info->mark 02560 || (type->kind == DEBUG_KIND_TAGGED 02561 && type->u.knamed->name != name))) 02562 { 02563 if (type->kind == DEBUG_KIND_NAMED) 02564 return (*fns->typedef_type) (fhandle, type->u.knamed->name->name); 02565 else 02566 { 02567 struct debug_type *real; 02568 unsigned int id; 02569 02570 real = debug_get_real_type ((PTR) info, type); 02571 id = 0; 02572 if ((real->kind == DEBUG_KIND_STRUCT 02573 || real->kind == DEBUG_KIND_UNION 02574 || real->kind == DEBUG_KIND_CLASS 02575 || real->kind == DEBUG_KIND_UNION_CLASS) 02576 && real->u.kclass != NULL) 02577 { 02578 if (real->u.kclass->id <= info->base_id) 02579 { 02580 if (! debug_set_class_id (info, 02581 type->u.knamed->name->name, 02582 real)) 02583 return false; 02584 } 02585 id = real->u.kclass->id; 02586 } 02587 02588 return (*fns->tag_type) (fhandle, type->u.knamed->name->name, id, 02589 real->kind); 02590 } 02591 } 02592 02593 /* Mark the name after we have already looked for a known name, so 02594 that we don't just define a type in terms of itself. We need to 02595 mark the name here so that a struct containing a pointer to 02596 itself will work. */ 02597 if (name != NULL) 02598 name->mark = info->mark; 02599 02600 tag = NULL; 02601 if (name != NULL 02602 && type->kind != DEBUG_KIND_NAMED 02603 && type->kind != DEBUG_KIND_TAGGED) 02604 { 02605 assert (name->kind == DEBUG_OBJECT_TAG); 02606 tag = name->name; 02607 } 02608 02609 switch (type->kind) 02610 { 02611 case DEBUG_KIND_ILLEGAL: 02612 debug_error ("debug_write_type: illegal type encountered"); 02613 return false; 02614 case DEBUG_KIND_INDIRECT: 02615 if (*type->u.kindirect->slot == DEBUG_TYPE_NULL) 02616 return (*fns->empty_type) (fhandle); 02617 return debug_write_type (info, fns, fhandle, *type->u.kindirect->slot, 02618 name); 02619 case DEBUG_KIND_VOID: 02620 return (*fns->void_type) (fhandle); 02621 case DEBUG_KIND_INT: 02622 return (*fns->int_type) (fhandle, type->size, type->u.kint); 02623 case DEBUG_KIND_FLOAT: 02624 return (*fns->float_type) (fhandle, type->size); 02625 case DEBUG_KIND_COMPLEX: 02626 return (*fns->complex_type) (fhandle, type->size); 02627 case DEBUG_KIND_BOOL: 02628 return (*fns->bool_type) (fhandle, type->size); 02629 case DEBUG_KIND_STRUCT: 02630 case DEBUG_KIND_UNION: 02631 if (type->u.kclass != NULL) 02632 { 02633 if (type->u.kclass->id <= info->base_id) 02634 { 02635 if (! debug_set_class_id (info, tag, type)) 02636 return false; 02637 } 02638 02639 if (info->mark == type->u.kclass->mark) 02640 { 02641 /* We are currently outputting this struct, or we have 02642 already output it. I don't know if this can happen, 02643 but it can happen for a class. */ 02644 assert (type->u.kclass->id > info->base_id); 02645 return (*fns->tag_type) (fhandle, tag, type->u.kclass->id, 02646 type->kind); 02647 } 02648 type->u.kclass->mark = info->mark; 02649 } 02650 02651 if (! (*fns->start_struct_type) (fhandle, tag, 02652 (type->u.kclass != NULL 02653 ? type->u.kclass->id 02654 : 0), 02655 type->kind == DEBUG_KIND_STRUCT, 02656 type->size)) 02657 return false; 02658 if (type->u.kclass != NULL 02659 && type->u.kclass->fields != NULL) 02660 { 02661 for (i = 0; type->u.kclass->fields[i] != NULL; i++) 02662 { 02663 struct debug_field *f; 02664 02665 f = type->u.kclass->fields[i]; 02666 if (! debug_write_type (info, fns, fhandle, f->type, 02667 (struct debug_name *) NULL) 02668 || ! (*fns->struct_field) (fhandle, f->name, f->u.f.bitpos, 02669 f->u.f.bitsize, f->visibility)) 02670 return false; 02671 } 02672 } 02673 return (*fns->end_struct_type) (fhandle); 02674 case DEBUG_KIND_CLASS: 02675 case DEBUG_KIND_UNION_CLASS: 02676 return debug_write_class_type (info, fns, fhandle, type, tag); 02677 case DEBUG_KIND_ENUM: 02678 if (type->u.kenum == NULL) 02679 return (*fns->enum_type) (fhandle, tag, (const char **) NULL, 02680 (bfd_signed_vma *) NULL); 02681 return (*fns->enum_type) (fhandle, tag, type->u.kenum->names, 02682 type->u.kenum->values); 02683 case DEBUG_KIND_POINTER: 02684 if (! debug_write_type (info, fns, fhandle, type->u.kpointer, 02685 (struct debug_name *) NULL)) 02686 return false; 02687 return (*fns->pointer_type) (fhandle); 02688 case DEBUG_KIND_FUNCTION: 02689 if (! debug_write_type (info, fns, fhandle, 02690 type->u.kfunction->return_type, 02691 (struct debug_name *) NULL)) 02692 return false; 02693 if (type->u.kfunction->arg_types == NULL) 02694 is = -1; 02695 else 02696 { 02697 for (is = 0; type->u.kfunction->arg_types[is] != NULL; is++) 02698 if (! debug_write_type (info, fns, fhandle, 02699 type->u.kfunction->arg_types[is], 02700 (struct debug_name *) NULL)) 02701 return false; 02702 } 02703 return (*fns->function_type) (fhandle, is, 02704 type->u.kfunction->varargs); 02705 case DEBUG_KIND_REFERENCE: 02706 if (! debug_write_type (info, fns, fhandle, type->u.kreference, 02707 (struct debug_name *) NULL)) 02708 return false; 02709 return (*fns->reference_type) (fhandle); 02710 case DEBUG_KIND_RANGE: 02711 if (! debug_write_type (info, fns, fhandle, type->u.krange->type, 02712 (struct debug_name *) NULL)) 02713 return false; 02714 return (*fns->range_type) (fhandle, type->u.krange->lower, 02715 type->u.krange->upper); 02716 case DEBUG_KIND_ARRAY: 02717 if (! debug_write_type (info, fns, fhandle, type->u.karray->element_type, 02718 (struct debug_name *) NULL) 02719 || ! debug_write_type (info, fns, fhandle, 02720 type->u.karray->range_type, 02721 (struct debug_name *) NULL)) 02722 return false; 02723 return (*fns->array_type) (fhandle, type->u.karray->lower, 02724 type->u.karray->upper, 02725 type->u.karray->stringp); 02726 case DEBUG_KIND_SET: 02727 if (! debug_write_type (info, fns, fhandle, type->u.kset->type, 02728 (struct debug_name *) NULL)) 02729 return false; 02730 return (*fns->set_type) (fhandle, type->u.kset->bitstringp); 02731 case DEBUG_KIND_OFFSET: 02732 if (! debug_write_type (info, fns, fhandle, type->u.koffset->base_type, 02733 (struct debug_name *) NULL) 02734 || ! debug_write_type (info, fns, fhandle, 02735 type->u.koffset->target_type, 02736 (struct debug_name *) NULL)) 02737 return false; 02738 return (*fns->offset_type) (fhandle); 02739 case DEBUG_KIND_METHOD: 02740 if (! debug_write_type (info, fns, fhandle, 02741 type->u.kmethod->return_type, 02742 (struct debug_name *) NULL)) 02743 return false; 02744 if (type->u.kmethod->arg_types == NULL) 02745 is = -1; 02746 else 02747 { 02748 for (is = 0; type->u.kmethod->arg_types[is] != NULL; is++) 02749 if (! debug_write_type (info, fns, fhandle, 02750 type->u.kmethod->arg_types[is], 02751 (struct debug_name *) NULL)) 02752 return false; 02753 } 02754 if (type->u.kmethod->domain_type != NULL) 02755 { 02756 if (! debug_write_type (info, fns, fhandle, 02757 type->u.kmethod->domain_type, 02758 (struct debug_name *) NULL)) 02759 return false; 02760 } 02761 return (*fns->method_type) (fhandle, 02762 type->u.kmethod->domain_type != NULL, 02763 is, 02764 type->u.kmethod->varargs); 02765 case DEBUG_KIND_CONST: 02766 if (! debug_write_type (info, fns, fhandle, type->u.kconst, 02767 (struct debug_name *) NULL)) 02768 return false; 02769 return (*fns->const_type) (fhandle); 02770 case DEBUG_KIND_VOLATILE: 02771 if (! debug_write_type (info, fns, fhandle, type->u.kvolatile, 02772 (struct debug_name *) NULL)) 02773 return false; 02774 return (*fns->volatile_type) (fhandle); 02775 case DEBUG_KIND_NAMED: 02776 return debug_write_type (info, fns, fhandle, type->u.knamed->type, 02777 (struct debug_name *) NULL); 02778 case DEBUG_KIND_TAGGED: 02779 return debug_write_type (info, fns, fhandle, type->u.knamed->type, 02780 type->u.knamed->name); 02781 default: 02782 abort (); 02783 return false; 02784 } 02785 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean debug_type_samep PARAMS | ( | (struct debug_handle *, struct debug_type *, struct debug_type *) | ) | [static] |
| static boolean debug_set_class_id PARAMS | ( | (struct debug_handle *, const char *, struct debug_type *) | ) | [static] |
| static boolean debug_write_linenos PARAMS | ( | (struct debug_handle *, const struct debug_write_fns *, PTR, bfd_vma) | ) | [static] |
| static boolean debug_write_block PARAMS | ( | (struct debug_handle *, const struct debug_write_fns *, PTR, struct debug_block *) | ) | [static] |
| static boolean debug_write_function PARAMS | ( | (struct debug_handle *, const struct debug_write_fns *, PTR, const char *, enum debug_object_linkage, struct debug_function *) | ) | [static] |
| static boolean debug_write_class_type PARAMS | ( | (struct debug_handle *, const struct debug_write_fns *, PTR, struct debug_type *, const char *) | ) | [static] |
| static boolean debug_write_type PARAMS | ( | (struct debug_handle *, const struct debug_write_fns *, PTR, struct debug_type *, struct debug_name *) | ) | [static] |
| static boolean debug_write_name PARAMS | ( | (struct debug_handle *, const struct debug_write_fns *, PTR, struct debug_name *) | ) | [static] |
| static struct debug_type* debug_get_real_type PARAMS | ( | (PTR, debug_type) | ) | [static] |
| static struct debug_type* debug_make_type PARAMS | ( | (struct debug_handle *, enum debug_type_kind, unsigned int) | ) | [static] |
| static struct debug_name* debug_add_to_current_namespace PARAMS | ( | (struct debug_handle *, const char *, enum debug_object_kind, enum debug_object_linkage) | ) | [static] |
| static struct debug_name* debug_add_to_namespace PARAMS | ( | (struct debug_handle *, struct debug_namespace **, const char *, enum debug_object_kind, enum debug_object_linkage) | ) | [static] |
| static void debug_error PARAMS | ( | (const char *) | ) | [static] |
1.4.7

