Lines Matching refs:cu
374 struct dwarf2_cu *cu; member
737 struct dwarf2_cu *cu);
740 struct dwarf2_cu *cu);
745 struct dwarf2_cu *cu);
753 static void dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu);
822 struct dwarf2_cu *cu);
824 static int die_is_declaration (struct die_info *, struct dwarf2_cu *cu);
836 bfd *abfd, struct dwarf2_cu *cu));
871 static void read_subrange_type (struct die_info *die, struct dwarf2_cu *cu);
903 static char *determine_class_name (struct die_info *die, struct dwarf2_cu *cu);
1022 struct dwarf2_cu *cu);
1025 struct dwarf2_cu *cu);
1365 dwarf2_build_include_psymtabs (struct dwarf2_cu *cu, in dwarf2_build_include_psymtabs() argument
1369 struct objfile *objfile = cu->objfile; in dwarf2_build_include_psymtabs()
1373 lh = dwarf_decode_line_header (pdi->line_offset, abfd, cu); in dwarf2_build_include_psymtabs()
1377 dwarf_decode_lines (lh, NULL, abfd, cu, pst); in dwarf2_build_include_psymtabs()
1424 struct dwarf2_cu cu; in dwarf2_build_psymtabs_hard() local
1431 memset (&cu, 0, sizeof (cu)); in dwarf2_build_psymtabs_hard()
1433 obstack_init (&cu.comp_unit_obstack); in dwarf2_build_psymtabs_hard()
1435 back_to_inner = make_cleanup (free_stack_comp_unit, &cu); in dwarf2_build_psymtabs_hard()
1437 cu.objfile = objfile; in dwarf2_build_psymtabs_hard()
1438 info_ptr = partial_read_comp_unit_head (&cu.header, info_ptr, abfd); in dwarf2_build_psymtabs_hard()
1441 cu.header.offset = beg_of_comp_unit - dwarf2_per_objfile->info_buffer; in dwarf2_build_psymtabs_hard()
1442 cu.header.first_die_ptr = info_ptr; in dwarf2_build_psymtabs_hard()
1443 cu.header.cu_head_ptr = beg_of_comp_unit; in dwarf2_build_psymtabs_hard()
1445 cu.list_in_scope = &file_symbols; in dwarf2_build_psymtabs_hard()
1448 dwarf2_read_abbrevs (abfd, &cu); in dwarf2_build_psymtabs_hard()
1449 make_cleanup (dwarf2_free_abbrev_table, &cu); in dwarf2_build_psymtabs_hard()
1451 this_cu = dwarf2_find_comp_unit (cu.header.offset, objfile); in dwarf2_build_psymtabs_hard()
1454 abbrev = peek_die_abbrev (info_ptr, &bytes_read, &cu); in dwarf2_build_psymtabs_hard()
1456 abfd, info_ptr, &cu); in dwarf2_build_psymtabs_hard()
1459 set_cu_language (comp_unit_die.language, &cu); in dwarf2_build_psymtabs_hard()
1484 if (this_cu->cu != NULL) in dwarf2_build_psymtabs_hard()
1485 free_one_cached_comp_unit (this_cu->cu); in dwarf2_build_psymtabs_hard()
1487 cu.per_cu = this_cu; in dwarf2_build_psymtabs_hard()
1493 this_cu->cu = &cu; in dwarf2_build_psymtabs_hard()
1507 first_die = load_partial_dies (abfd, info_ptr, 1, &cu); in dwarf2_build_psymtabs_hard()
1509 scan_partial_symbols (first_die, &lowpc, &highpc, &cu); in dwarf2_build_psymtabs_hard()
1538 info_ptr = beg_of_comp_unit + cu.header.length in dwarf2_build_psymtabs_hard()
1539 + cu.header.initial_length_size; in dwarf2_build_psymtabs_hard()
1545 dwarf2_build_include_psymtabs (&cu, &comp_unit_die, pst); in dwarf2_build_psymtabs_hard()
1561 struct dwarf2_cu *cu; in load_comp_unit() local
1569 cu = xmalloc (sizeof (struct dwarf2_cu)); in load_comp_unit()
1570 memset (cu, 0, sizeof (struct dwarf2_cu)); in load_comp_unit()
1572 obstack_init (&cu->comp_unit_obstack); in load_comp_unit()
1574 cu->objfile = objfile; in load_comp_unit()
1575 info_ptr = partial_read_comp_unit_head (&cu->header, info_ptr, abfd); in load_comp_unit()
1578 cu->header.offset = beg_of_comp_unit - dwarf2_per_objfile->info_buffer; in load_comp_unit()
1579 cu->header.first_die_ptr = info_ptr; in load_comp_unit()
1580 cu->header.cu_head_ptr = beg_of_comp_unit; in load_comp_unit()
1583 dwarf2_read_abbrevs (abfd, cu); in load_comp_unit()
1584 back_to = make_cleanup (dwarf2_free_abbrev_table, cu); in load_comp_unit()
1587 abbrev = peek_die_abbrev (info_ptr, &bytes_read, cu); in load_comp_unit()
1589 abfd, info_ptr, cu); in load_comp_unit()
1592 set_cu_language (comp_unit_die.language, cu); in load_comp_unit()
1595 this_cu->cu = cu; in load_comp_unit()
1596 cu->per_cu = this_cu; in load_comp_unit()
1602 load_partial_dies (abfd, info_ptr, 0, cu); in load_comp_unit()
1675 CORE_ADDR *highpc, struct dwarf2_cu *cu) in scan_partial_symbols() argument
1677 struct objfile *objfile = cu->objfile; in scan_partial_symbols()
1689 fixup_partial_die (pdi, cu); in scan_partial_symbols()
1713 add_partial_symbol (pdi, cu); in scan_partial_symbols()
1722 add_partial_symbol (pdi, cu); in scan_partial_symbols()
1729 add_partial_symbol (pdi, cu); in scan_partial_symbols()
1734 add_partial_enumeration (pdi, cu); in scan_partial_symbols()
1740 add_partial_symbol (pdi, cu); in scan_partial_symbols()
1743 add_partial_namespace (pdi, lowpc, highpc, cu); in scan_partial_symbols()
1782 struct dwarf2_cu *cu) in partial_die_parent_scope() argument
1792 real_pdi = find_partial_die (real_pdi->spec_offset, cu); in partial_die_parent_scope()
1801 fixup_partial_die (parent, cu); in partial_die_parent_scope()
1803 grandparent_scope = partial_die_parent_scope (parent, cu); in partial_die_parent_scope()
1813 parent->scope = typename_concat (&cu->comp_unit_obstack, grandparent_scope, in partial_die_parent_scope()
1814 parent->name, cu); in partial_die_parent_scope()
1838 struct dwarf2_cu *cu) in partial_die_full_name() argument
1842 parent_scope = partial_die_parent_scope (pdi, cu); in partial_die_full_name()
1846 return typename_concat (NULL, parent_scope, pdi->name, cu); in partial_die_full_name()
1850 add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) in add_partial_symbol() argument
1852 struct objfile *objfile = cu->objfile; in add_partial_symbol()
1866 actual_name = partial_die_full_name (pdi, cu); in add_partial_symbol()
1885 cu->language, objfile); in add_partial_symbol()
1895 cu->language, objfile); in add_partial_symbol()
1915 addr = decode_locdesc (pdi->locdesc, cu); in add_partial_symbol()
1921 cu->language, objfile); in add_partial_symbol()
1928 addr = decode_locdesc (pdi->locdesc, cu); in add_partial_symbol()
1935 cu->language, objfile); in add_partial_symbol()
1944 0, (CORE_ADDR) 0, cu->language, objfile); in add_partial_symbol()
1950 0, (CORE_ADDR) 0, cu->language, objfile); in add_partial_symbol()
1964 (cu->language == language_cplus in add_partial_symbol()
1965 || cu->language == language_java) in add_partial_symbol()
1968 0, (CORE_ADDR) 0, cu->language, objfile); in add_partial_symbol()
1970 if (cu->language == language_cplus in add_partial_symbol()
1971 || cu->language == language_java) in add_partial_symbol()
1977 0, (CORE_ADDR) 0, cu->language, objfile); in add_partial_symbol()
1983 (cu->language == language_cplus in add_partial_symbol()
1984 || cu->language == language_java) in add_partial_symbol()
1987 0, (CORE_ADDR) 0, cu->language, objfile); in add_partial_symbol()
2002 if (cu->language == language_cplus in add_partial_symbol()
2003 && cu->has_namespace_info == 0 in add_partial_symbol()
2042 struct dwarf2_cu *cu) in add_partial_namespace() argument
2044 struct objfile *objfile = cu->objfile; in add_partial_namespace()
2048 add_partial_symbol (pdi, cu); in add_partial_namespace()
2053 scan_partial_symbols (pdi->die_child, lowpc, highpc, cu); in add_partial_namespace()
2062 struct dwarf2_cu *cu) in guess_structure_name() argument
2064 if ((cu->language == language_cplus in guess_structure_name()
2065 || cu->language == language_java) in guess_structure_name()
2066 && cu->has_namespace_info == 0 in guess_structure_name()
2084 real_pdi = find_partial_die (real_pdi->spec_offset, cu); in guess_structure_name()
2094 = language_class_name_from_physname (cu->language_defn, in guess_structure_name()
2101 &cu->comp_unit_obstack); in guess_structure_name()
2116 struct dwarf2_cu *cu) in add_partial_enumeration() argument
2118 struct objfile *objfile = cu->objfile; in add_partial_enumeration()
2123 add_partial_symbol (enum_pdi, cu); in add_partial_enumeration()
2131 add_partial_symbol (pdi, cu); in add_partial_enumeration()
2142 peek_die_abbrev (char *info_ptr, int *bytes_read, struct dwarf2_cu *cu) in peek_die_abbrev() argument
2144 bfd *abfd = cu->objfile->obfd; in peek_die_abbrev()
2153 abbrev = dwarf2_lookup_abbrev (abbrev_number, cu); in peek_die_abbrev()
2168 skip_children (char *info_ptr, struct dwarf2_cu *cu) in skip_children() argument
2175 abbrev = peek_die_abbrev (info_ptr, &bytes_read, cu); in skip_children()
2179 info_ptr = skip_one_die (info_ptr + bytes_read, abbrev, cu); in skip_children()
2191 struct dwarf2_cu *cu) in skip_one_die() argument
2195 bfd *abfd = cu->objfile->obfd; in skip_one_die()
2204 abfd, info_ptr, cu); in skip_one_die()
2209 + dwarf2_get_ref_die_offset (&attr, cu); in skip_one_die()
2219 info_ptr += cu->header.addr_size; in skip_one_die()
2243 info_ptr += cu->header.offset_size; in skip_one_die()
2278 return skip_children (info_ptr, cu); in skip_one_die()
2288 bfd *abfd, struct dwarf2_cu *cu) in locate_pdi_sibling() argument
2302 return skip_children (info_ptr, cu); in locate_pdi_sibling()
2375 item->per_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain; in process_queue()
2381 reset_die_and_siblings_types (item->per_cu->cu->dies, in process_queue()
2382 item->per_cu->cu); in process_queue()
2416 if (item->per_cu->cu != NULL) in dwarf2_release_queue()
2417 free_one_cached_comp_unit (item->per_cu->cu); in dwarf2_release_queue()
2485 struct dwarf2_cu *cu; in load_full_comp_unit() local
2497 cu = xmalloc (sizeof (struct dwarf2_cu)); in load_full_comp_unit()
2498 memset (cu, 0, sizeof (struct dwarf2_cu)); in load_full_comp_unit()
2501 free_cu_cleanup = make_cleanup (free_one_comp_unit, cu); in load_full_comp_unit()
2503 cu->objfile = pst->objfile; in load_full_comp_unit()
2506 info_ptr = read_comp_unit_head (&cu->header, info_ptr, abfd); in load_full_comp_unit()
2509 dwarf2_read_abbrevs (abfd, cu); in load_full_comp_unit()
2510 back_to = make_cleanup (dwarf2_free_abbrev_table, cu); in load_full_comp_unit()
2512 cu->header.offset = offset; in load_full_comp_unit()
2514 cu->per_cu = per_cu; in load_full_comp_unit()
2515 per_cu->cu = cu; in load_full_comp_unit()
2518 obstack_init (&cu->comp_unit_obstack); in load_full_comp_unit()
2520 cu->dies = read_comp_unit (info_ptr, abfd, cu); in load_full_comp_unit()
2526 attr = dwarf2_attr (cu->dies, DW_AT_language, cu); in load_full_comp_unit()
2528 set_cu_language (DW_UNSND (attr), cu); in load_full_comp_unit()
2530 set_cu_language (language_minimal, cu); in load_full_comp_unit()
2538 return cu; in load_full_comp_unit()
2548 struct dwarf2_cu *cu = per_cu->cu; in process_full_comp_unit() local
2565 cu->list_in_scope = &file_symbols; in process_full_comp_unit()
2573 cu->header.base_known = 0; in process_full_comp_unit()
2574 cu->header.base_address = 0; in process_full_comp_unit()
2576 attr = dwarf2_attr (cu->dies, DW_AT_entry_pc, cu); in process_full_comp_unit()
2579 cu->header.base_address = DW_ADDR (attr); in process_full_comp_unit()
2580 cu->header.base_known = 1; in process_full_comp_unit()
2584 attr = dwarf2_attr (cu->dies, DW_AT_low_pc, cu); in process_full_comp_unit()
2587 cu->header.base_address = DW_ADDR (attr); in process_full_comp_unit()
2588 cu->header.base_known = 1; in process_full_comp_unit()
2593 process_die (cu->dies, cu); in process_full_comp_unit()
2598 get_scope_pc_bounds (cu->dies, &lowpc, &highpc, cu); in process_full_comp_unit()
2606 && !(cu->language == language_c && symtab->language != language_c)) in process_full_comp_unit()
2608 symtab->language = cu->language; in process_full_comp_unit()
2619 process_die (struct die_info *die, struct dwarf2_cu *cu) in process_die() argument
2626 read_file_scope (die, cu); in process_die()
2629 read_subroutine_type (die, cu); in process_die()
2630 read_func_scope (die, cu); in process_die()
2640 read_lexical_block_scope (die, cu); in process_die()
2645 read_structure_type (die, cu); in process_die()
2646 process_structure_scope (die, cu); in process_die()
2649 read_enumeration_type (die, cu); in process_die()
2650 process_enumeration_scope (die, cu); in process_die()
2657 read_subroutine_type (die, cu); in process_die()
2660 read_array_type (die, cu); in process_die()
2663 read_tag_pointer_type (die, cu); in process_die()
2666 read_tag_ptr_to_member_type (die, cu); in process_die()
2669 read_tag_reference_type (die, cu); in process_die()
2672 read_tag_string_type (die, cu); in process_die()
2677 read_base_type (die, cu); in process_die()
2680 new_symbol (die, die->type, cu); in process_die()
2683 read_subrange_type (die, cu); in process_die()
2686 new_symbol (die, die->type, cu); in process_die()
2689 read_common_block (die, cu); in process_die()
2695 read_namespace (die, cu); in process_die()
2709 new_symbol (die, NULL, cu); in process_die()
2715 initialize_cu_func_list (struct dwarf2_cu *cu) in initialize_cu_func_list() argument
2717 cu->first_fn = cu->last_fn = cu->cached_fn = NULL; in initialize_cu_func_list()
2721 read_file_scope (struct die_info *die, struct dwarf2_cu *cu) in read_file_scope() argument
2723 struct objfile *objfile = cu->objfile; in read_file_scope()
2724 struct comp_unit_head *cu_header = &cu->header; in read_file_scope()
2738 get_scope_pc_bounds (die, &lowpc, &highpc, cu); in read_file_scope()
2747 attr = dwarf2_attr (die, DW_AT_name, cu); in read_file_scope()
2752 attr = dwarf2_attr (die, DW_AT_comp_dir, cu); in read_file_scope()
2767 attr = dwarf2_attr (die, DW_AT_language, cu); in read_file_scope()
2770 set_cu_language (DW_UNSND (attr), cu); in read_file_scope()
2773 attr = dwarf2_attr (die, DW_AT_producer, cu); in read_file_scope()
2775 cu->producer = DW_STRING (attr); in read_file_scope()
2789 memset (cu->ftypes, 0, FT_NUM_MEMBERS * sizeof (struct type *)); in read_file_scope()
2794 initialize_cu_func_list (cu); in read_file_scope()
2802 process_die (child_die, cu); in read_file_scope()
2808 attr = dwarf2_attr (die, DW_AT_stmt_list, cu); in read_file_scope()
2812 line_header = dwarf_decode_line_header (line_offset, abfd, cu); in read_file_scope()
2817 dwarf_decode_lines (line_header, comp_dir, abfd, cu, NULL); in read_file_scope()
2825 attr = dwarf2_attr (die, DW_AT_macro_info, cu); in read_file_scope()
2830 comp_dir, abfd, cu); in read_file_scope()
2837 struct dwarf2_cu *cu) in add_to_cu_func_list() argument
2842 obstack_alloc (&cu->comp_unit_obstack, sizeof (struct function_range)); in add_to_cu_func_list()
2849 if (cu->last_fn == NULL) in add_to_cu_func_list()
2850 cu->first_fn = thisfn; in add_to_cu_func_list()
2852 cu->last_fn->next = thisfn; in add_to_cu_func_list()
2854 cu->last_fn = thisfn; in add_to_cu_func_list()
2858 read_func_scope (struct die_info *die, struct dwarf2_cu *cu) in read_func_scope() argument
2860 struct objfile *objfile = cu->objfile; in read_func_scope()
2873 name = dwarf2_linkage_name (die, cu); in read_func_scope()
2877 if (name == NULL || !dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu)) in read_func_scope()
2880 if (cu->language == language_cplus in read_func_scope()
2881 || cu->language == language_java) in read_func_scope()
2883 struct die_info *spec_die = die_specification (die, cu); in read_func_scope()
2909 char *specification_prefix = determine_prefix (spec_die, cu); in read_func_scope()
2919 add_to_cu_func_list (name, lowpc, highpc, cu); in read_func_scope()
2922 new->name = new_symbol (die, die->type, cu); in read_func_scope()
2926 attr = dwarf2_attr (die, DW_AT_frame_base, cu); in read_func_scope()
2937 dwarf2_symbol_mark_computed (attr, new->name, cu); in read_func_scope()
2939 cu->list_in_scope = &local_symbols; in read_func_scope()
2946 process_die (child_die, cu); in read_func_scope()
2966 cu->list_in_scope = &file_symbols; in read_func_scope()
2977 read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) in read_lexical_block_scope() argument
2979 struct objfile *objfile = cu->objfile; in read_lexical_block_scope()
2992 if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu)) in read_lexical_block_scope()
3003 process_die (child_die, cu); in read_lexical_block_scope()
3022 CORE_ADDR *highpc, struct dwarf2_cu *cu) in dwarf2_get_pc_bounds() argument
3024 struct objfile *objfile = cu->objfile; in dwarf2_get_pc_bounds()
3025 struct comp_unit_head *cu_header = &cu->header; in dwarf2_get_pc_bounds()
3032 attr = dwarf2_attr (die, DW_AT_high_pc, cu); in dwarf2_get_pc_bounds()
3036 attr = dwarf2_attr (die, DW_AT_low_pc, cu); in dwarf2_get_pc_bounds()
3048 attr = dwarf2_attr (die, DW_AT_ranges, cu); in dwarf2_get_pc_bounds()
3077 marker = read_address (obfd, buffer, cu, &dummy); in dwarf2_get_pc_bounds()
3082 base = read_address (obfd, buffer + addr_size, cu, &dummy); in dwarf2_get_pc_bounds()
3094 range_beginning = read_address (obfd, buffer, cu, &dummy); in dwarf2_get_pc_bounds()
3096 range_end = read_address (obfd, buffer, cu, &dummy); in dwarf2_get_pc_bounds()
3112 base = read_address (obfd, buffer + addr_size, cu, &dummy); in dwarf2_get_pc_bounds()
3183 struct dwarf2_cu *cu) in get_scope_pc_bounds() argument
3189 if (dwarf2_get_pc_bounds (die, ¤t_low, ¤t_high, cu)) in get_scope_pc_bounds()
3202 if (dwarf2_get_pc_bounds (child, ¤t_low, ¤t_high, cu)) in get_scope_pc_bounds()
3217 get_scope_pc_bounds (child, ¤t_low, ¤t_high, cu); in get_scope_pc_bounds()
3242 struct dwarf2_cu *cu) in dwarf2_add_field() argument
3244 struct objfile *objfile = cu->objfile; in dwarf2_add_field()
3267 attr = dwarf2_attr (die, DW_AT_accessibility, cu); in dwarf2_add_field()
3272 attr = dwarf2_attr (die, DW_AT_virtuality, cu); in dwarf2_add_field()
3278 if (die->tag == DW_TAG_member && ! die_is_declaration (die, cu)) in dwarf2_add_field()
3283 fp->type = die_type (die, cu); in dwarf2_add_field()
3288 attr = dwarf2_attr (die, DW_AT_bit_size, cu); in dwarf2_add_field()
3299 attr = dwarf2_attr (die, DW_AT_data_member_location, cu); in dwarf2_add_field()
3303 decode_locdesc (DW_BLOCK (attr), cu) * bits_per_byte; in dwarf2_add_field()
3307 attr = dwarf2_attr (die, DW_AT_bit_offset, cu); in dwarf2_add_field()
3330 attr = dwarf2_attr (die, DW_AT_byte_size, cu); in dwarf2_add_field()
3352 attr = dwarf2_attr (die, DW_AT_name, cu); in dwarf2_add_field()
3362 if (dwarf2_attr (die, DW_AT_artificial, cu)) in dwarf2_add_field()
3380 attr = dwarf2_attr (die, DW_AT_name, cu); in dwarf2_add_field()
3387 physname = dwarf2_linkage_name (die, cu); in dwarf2_add_field()
3392 FIELD_TYPE (*fp) = die_type (die, cu); in dwarf2_add_field()
3398 attr = dwarf2_attr (die, DW_AT_data_member_location, cu); in dwarf2_add_field()
3400 FIELD_BITPOS (*fp) = (decode_locdesc (DW_BLOCK (attr), cu) in dwarf2_add_field()
3404 FIELD_TYPE (*fp) = die_type (die, cu); in dwarf2_add_field()
3414 struct dwarf2_cu *cu) in dwarf2_attach_fields_to_type() argument
3501 struct type *type, struct dwarf2_cu *cu) in dwarf2_add_member_fn() argument
3503 struct objfile *objfile = cu->objfile; in dwarf2_add_member_fn()
3513 attr = dwarf2_attr (die, DW_AT_name, cu); in dwarf2_add_member_fn()
3520 physname = dwarf2_linkage_name (die, cu); in dwarf2_add_member_fn()
3591 if (dwarf2_attr (die, DW_AT_containing_type, cu) != NULL) in dwarf2_add_member_fn()
3592 fnp->fcontext = die_containing_type (die, cu); in dwarf2_add_member_fn()
3598 attr = dwarf2_attr (die, DW_AT_accessibility, cu); in dwarf2_add_member_fn()
3613 attr = dwarf2_attr (die, DW_AT_artificial, cu); in dwarf2_add_member_fn()
3618 attr = dwarf2_attr (die, DW_AT_vtable_elem_location, cu); in dwarf2_add_member_fn()
3624 fnp->voffset = decode_locdesc (DW_BLOCK (attr), cu) + 2; in dwarf2_add_member_fn()
3642 struct dwarf2_cu *cu) in dwarf2_attach_fn_fields_to_type() argument
3676 is_vtable_name (const char *name, struct dwarf2_cu *cu) in is_vtable_name() argument
3682 if ((cu->language == language_java in is_vtable_name()
3709 read_structure_type (struct die_info *die, struct dwarf2_cu *cu) in read_structure_type() argument
3711 struct objfile *objfile = cu->objfile; in read_structure_type()
3723 attr = dwarf2_attr (die, DW_AT_name, cu); in read_structure_type()
3726 if (cu->language == language_cplus in read_structure_type()
3727 || cu->language == language_java) in read_structure_type()
3729 char *new_prefix = determine_class_name (die, cu); in read_structure_type()
3759 attr = dwarf2_attr (die, DW_AT_byte_size, cu); in read_structure_type()
3769 if (die_is_declaration (die, cu)) in read_structure_type()
3775 set_die_type (die, type, cu); in read_structure_type()
3777 if (die->child != NULL && ! die_is_declaration (die, cu)) in read_structure_type()
3797 dwarf2_add_field (&fi, child_die, cu); in read_structure_type()
3802 read_type_die (child_die, cu); in read_structure_type()
3803 dwarf2_add_member_fn (&fi, child_die, type, cu); in read_structure_type()
3808 dwarf2_add_field (&fi, child_die, cu); in read_structure_type()
3815 dwarf2_attach_fields_to_type (&fi, type, cu); in read_structure_type()
3818 dwarf2_attach_fn_fields_to_type (&fi, type, cu); in read_structure_type()
3824 if (dwarf2_attr (die, DW_AT_containing_type, cu) != NULL) in read_structure_type()
3826 struct type *t = die_containing_type (die, cu); in read_structure_type()
3840 if (is_vtable_name (fieldname, cu)) in read_structure_type()
3870 process_structure_scope (struct die_info *die, struct dwarf2_cu *cu) in process_structure_scope() argument
3872 struct objfile *objfile = cu->objfile; in process_structure_scope()
3895 process_die (child_die, cu); in process_structure_scope()
3900 if (die->child != NULL && ! die_is_declaration (die, cu)) in process_structure_scope()
3901 new_symbol (die, die->type, cu); in process_structure_scope()
3910 read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) in read_enumeration_type() argument
3912 struct objfile *objfile = cu->objfile; in read_enumeration_type()
3922 attr = dwarf2_attr (die, DW_AT_name, cu); in read_enumeration_type()
3931 name, cu); in read_enumeration_type()
3941 attr = dwarf2_attr (die, DW_AT_byte_size, cu); in read_enumeration_type()
3951 set_die_type (die, type, cu); in read_enumeration_type()
3959 determine_class_name (struct die_info *die, struct dwarf2_cu *cu) in determine_class_name() argument
3962 struct die_info *spec_die = die_specification (die, cu); in determine_class_name()
3970 char *specification_prefix = determine_prefix (spec_die, cu); in determine_class_name()
3989 = language_class_name_from_physname (cu->language_defn, in determine_class_name()
3991 (child, cu)); in determine_class_name()
4001 const char *name = dwarf2_name (die, cu); in determine_class_name()
4004 cu); in determine_class_name()
4020 process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) in process_enumeration_scope() argument
4022 struct objfile *objfile = cu->objfile; in process_enumeration_scope()
4039 process_die (child_die, cu); in process_enumeration_scope()
4043 attr = dwarf2_attr (child_die, DW_AT_name, cu); in process_enumeration_scope()
4046 sym = new_symbol (child_die, die->type, cu); in process_enumeration_scope()
4084 new_symbol (die, die->type, cu); in process_enumeration_scope()
4092 read_array_type (struct die_info *die, struct dwarf2_cu *cu) in read_array_type() argument
4094 struct objfile *objfile = cu->objfile; in read_array_type()
4109 element_type = die_type (die, cu); in read_array_type()
4115 index_type = dwarf2_fundamental_type (objfile, FT_INTEGER, cu); in read_array_type()
4118 cu); in read_array_type()
4128 read_subrange_type (child_die, cu); in read_array_type()
4153 if (read_array_order (die, cu) == DW_ORD_col_major) in read_array_type()
4171 attr = dwarf2_attr (die, DW_AT_GNU_vector, cu); in read_array_type()
4178 set_die_type (die, type, cu); in read_array_type()
4182 read_array_order (struct die_info *die, struct dwarf2_cu *cu) in read_array_order() argument
4186 attr = dwarf2_attr (die, DW_AT_ordering, cu); in read_array_order()
4199 if (cu->language == language_fortran && in read_array_order()
4200 cu->producer && strstr (cu->producer, "GNU F77")) in read_array_order()
4205 switch (cu->language_defn->la_array_ordering) in read_array_order()
4219 read_common_block (struct die_info *die, struct dwarf2_cu *cu) in read_common_block() argument
4226 attr = dwarf2_attr (die, DW_AT_location, cu); in read_common_block()
4232 base = decode_locdesc (DW_BLOCK (attr), cu); in read_common_block()
4249 sym = new_symbol (child_die, NULL, cu); in read_common_block()
4250 attr = dwarf2_attr (child_die, DW_AT_data_member_location, cu); in read_common_block()
4254 base + decode_locdesc (DW_BLOCK (attr), cu); in read_common_block()
4265 read_namespace (struct die_info *die, struct dwarf2_cu *cu) in read_namespace() argument
4267 struct objfile *objfile = cu->objfile; in read_namespace()
4274 name = namespace_name (die, &is_anonymous, cu); in read_namespace()
4284 char *temp_name = typename_concat (NULL, previous_prefix, name, cu); in read_namespace()
4293 if (dwarf2_extension (die, cu) == NULL) in read_namespace()
4304 new_symbol (die, type, cu); in read_namespace()
4305 set_die_type (die, type, cu); in read_namespace()
4319 process_die (child_die, cu); in read_namespace()
4333 namespace_name (struct die_info *die, int *is_anonymous, struct dwarf2_cu *cu) in namespace_name() argument
4342 current_die = dwarf2_extension (die, cu)) in namespace_name()
4344 name = dwarf2_name (current_die, cu); in namespace_name()
4362 read_tag_pointer_type (struct die_info *die, struct dwarf2_cu *cu) in read_tag_pointer_type() argument
4364 struct comp_unit_head *cu_header = &cu->header; in read_tag_pointer_type()
4375 type = lookup_pointer_type (die_type (die, cu)); in read_tag_pointer_type()
4377 attr_byte_size = dwarf2_attr (die, DW_AT_byte_size, cu); in read_tag_pointer_type()
4383 attr_address_class = dwarf2_attr (die, DW_AT_address_class, cu); in read_tag_pointer_type()
4412 set_die_type (die, type, cu); in read_tag_pointer_type()
4419 read_tag_ptr_to_member_type (struct die_info *die, struct dwarf2_cu *cu) in read_tag_ptr_to_member_type() argument
4421 struct objfile *objfile = cu->objfile; in read_tag_ptr_to_member_type()
4432 to_type = die_type (die, cu); in read_tag_ptr_to_member_type()
4433 domain = die_containing_type (die, cu); in read_tag_ptr_to_member_type()
4436 set_die_type (die, type, cu); in read_tag_ptr_to_member_type()
4443 read_tag_reference_type (struct die_info *die, struct dwarf2_cu *cu) in read_tag_reference_type() argument
4445 struct comp_unit_head *cu_header = &cu->header; in read_tag_reference_type()
4454 type = lookup_reference_type (die_type (die, cu)); in read_tag_reference_type()
4455 attr = dwarf2_attr (die, DW_AT_byte_size, cu); in read_tag_reference_type()
4464 set_die_type (die, type, cu); in read_tag_reference_type()
4468 read_tag_const_type (struct die_info *die, struct dwarf2_cu *cu) in read_tag_const_type() argument
4477 base_type = die_type (die, cu); in read_tag_const_type()
4479 cu); in read_tag_const_type()
4483 read_tag_volatile_type (struct die_info *die, struct dwarf2_cu *cu) in read_tag_volatile_type() argument
4492 base_type = die_type (die, cu); in read_tag_volatile_type()
4494 cu); in read_tag_volatile_type()
4503 read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) in read_tag_string_type() argument
4505 struct objfile *objfile = cu->objfile; in read_tag_string_type()
4515 attr = dwarf2_attr (die, DW_AT_string_length, cu); in read_tag_string_type()
4523 attr = dwarf2_attr (die, DW_AT_byte_size, cu); in read_tag_string_type()
4533 index_type = dwarf2_fundamental_type (objfile, FT_INTEGER, cu); in read_tag_string_type()
4535 if (cu->language == language_fortran) in read_tag_string_type()
4543 char_type = dwarf2_fundamental_type (objfile, FT_CHAR, cu); in read_tag_string_type()
4546 set_die_type (die, type, cu); in read_tag_string_type()
4561 read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu) in read_subroutine_type() argument
4572 type = die_type (die, cu); in read_subroutine_type()
4576 attr = dwarf2_attr (die, DW_AT_prototyped, cu); in read_subroutine_type()
4578 || cu->language == language_cplus in read_subroutine_type()
4579 || cu->language == language_java) in read_subroutine_type()
4616 attr = dwarf2_attr (child_die, DW_AT_artificial, cu); in read_subroutine_type()
4621 TYPE_FIELD_TYPE (ftype, iparams) = die_type (child_die, cu); in read_subroutine_type()
4628 set_die_type (die, ftype, cu); in read_subroutine_type()
4632 read_typedef (struct die_info *die, struct dwarf2_cu *cu) in read_typedef() argument
4634 struct objfile *objfile = cu->objfile; in read_typedef()
4640 attr = dwarf2_attr (die, DW_AT_name, cu); in read_typedef()
4647 cu); in read_typedef()
4648 TYPE_TARGET_TYPE (die->type) = die_type (die, cu); in read_typedef()
4656 read_base_type (struct die_info *die, struct dwarf2_cu *cu) in read_base_type() argument
4658 struct objfile *objfile = cu->objfile; in read_base_type()
4669 attr = dwarf2_attr (die, DW_AT_encoding, cu); in read_base_type()
4674 attr = dwarf2_attr (die, DW_AT_byte_size, cu); in read_base_type()
4679 attr = dwarf2_attr (die, DW_AT_name, cu); in read_base_type()
4717 cu); in read_base_type()
4722 = dwarf2_fundamental_type (objfile, FT_EXT_PREC_FLOAT, cu); in read_base_type()
4725 = dwarf2_fundamental_type (objfile, FT_DBL_PREC_FLOAT, cu); in read_base_type()
4728 = dwarf2_fundamental_type (objfile, FT_FLOAT, cu); in read_base_type()
4733 type = dwarf_base_type (encoding, size, cu); in read_base_type()
4735 set_die_type (die, type, cu); in read_base_type()
4741 read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) in read_subrange_type() argument
4753 base_type = die_type (die, cu); in read_subrange_type()
4764 if (cu->language == language_fortran) in read_subrange_type()
4773 attr = dwarf2_attr (die, DW_AT_lower_bound, cu); in read_subrange_type()
4777 attr = dwarf2_attr (die, DW_AT_upper_bound, cu); in read_subrange_type()
4801 attr = dwarf2_attr (die, DW_AT_name, cu); in read_subrange_type()
4805 attr = dwarf2_attr (die, DW_AT_byte_size, cu); in read_subrange_type()
4809 set_die_type (die, range_type, cu); in read_subrange_type()
4816 read_comp_unit (char *info_ptr, bfd *abfd, struct dwarf2_cu *cu) in read_comp_unit() argument
4818 return read_die_and_children (info_ptr, abfd, cu, &info_ptr, NULL); in read_comp_unit()
4829 struct dwarf2_cu *cu, in read_die_and_children() argument
4837 cur_ptr = read_full_die (&die, abfd, info_ptr, cu, &has_children); in read_die_and_children()
4838 store_in_ref_table (die->offset, die, cu); in read_die_and_children()
4842 die->child = read_die_and_siblings (cur_ptr, abfd, cu, in read_die_and_children()
4862 struct dwarf2_cu *cu, in read_die_and_siblings() argument
4875 = read_die_and_children (cur_ptr, abfd, cu, &cur_ptr, parent); in read_die_and_siblings()
4951 dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu) in dwarf2_read_abbrevs() argument
4953 struct comp_unit_head *cu_header = &cu->header; in dwarf2_read_abbrevs()
4962 obstack_init (&cu->abbrev_obstack); in dwarf2_read_abbrevs()
4963 cu->dwarf2_abbrevs = obstack_alloc (&cu->abbrev_obstack, in dwarf2_read_abbrevs()
4966 memset (cu->dwarf2_abbrevs, 0, in dwarf2_read_abbrevs()
4979 cur_abbrev = dwarf_alloc_abbrev (cu); in dwarf2_read_abbrevs()
4989 cu->has_namespace_info = 1; in dwarf2_read_abbrevs()
5014 cu->has_form_ref_addr = 1; in dwarf2_read_abbrevs()
5024 cur_abbrev->attrs = obstack_alloc (&cu->abbrev_obstack, in dwarf2_read_abbrevs()
5031 cur_abbrev->next = cu->dwarf2_abbrevs[hash_number]; in dwarf2_read_abbrevs()
5032 cu->dwarf2_abbrevs[hash_number] = cur_abbrev; in dwarf2_read_abbrevs()
5046 if (dwarf2_lookup_abbrev (abbrev_number, cu) != NULL) in dwarf2_read_abbrevs()
5058 struct dwarf2_cu *cu = ptr_to_cu; in dwarf2_free_abbrev_table() local
5060 obstack_free (&cu->abbrev_obstack, NULL); in dwarf2_free_abbrev_table()
5061 cu->dwarf2_abbrevs = NULL; in dwarf2_free_abbrev_table()
5067 dwarf2_lookup_abbrev (unsigned int number, struct dwarf2_cu *cu) in dwarf2_lookup_abbrev() argument
5073 abbrev = cu->dwarf2_abbrevs[hash_number]; in dwarf2_lookup_abbrev()
5120 struct dwarf2_cu *cu) in load_partial_dies() argument
5132 cu->partial_dies in load_partial_dies()
5133 = htab_create_alloc_ex (cu->header.length / 12, in load_partial_dies()
5137 &cu->comp_unit_obstack, in load_partial_dies()
5141 part_die = obstack_alloc (&cu->comp_unit_obstack, in load_partial_dies()
5146 abbrev = peek_die_abbrev (info_ptr, &bytes_read, cu); in load_partial_dies()
5175 info_ptr = skip_one_die (info_ptr + bytes_read, abbrev, cu); in load_partial_dies()
5180 abfd, info_ptr, cu); in load_partial_dies()
5208 &cu->objfile->static_psymbols, in load_partial_dies()
5209 0, (CORE_ADDR) 0, cu->language, cu->objfile); in load_partial_dies()
5210 info_ptr = locate_pdi_sibling (part_die, info_ptr, abfd, cu); in load_partial_dies()
5229 (cu->language == language_cplus in load_partial_dies()
5230 || cu->language == language_java) in load_partial_dies()
5231 ? &cu->objfile->global_psymbols in load_partial_dies()
5232 : &cu->objfile->static_psymbols, in load_partial_dies()
5233 0, (CORE_ADDR) 0, cu->language, cu->objfile); in load_partial_dies()
5235 info_ptr = locate_pdi_sibling (part_die, info_ptr, abfd, cu); in load_partial_dies()
5281 slot = htab_find_slot_with_hash (cu->partial_dies, part_die, in load_partial_dies()
5286 part_die = obstack_alloc (&cu->comp_unit_obstack, in load_partial_dies()
5296 || (cu->language != language_c in load_partial_dies()
5307 info_ptr = locate_pdi_sibling (last_die, info_ptr, abfd, cu); in load_partial_dies()
5319 char *info_ptr, struct dwarf2_cu *cu) in read_partial_die() argument
5340 info_ptr = read_attribute (&attr, &abbrev->attrs[i], abfd, info_ptr, cu); in read_partial_die()
5399 part_die->spec_offset = dwarf2_get_ref_die_offset (&attr, cu); in read_partial_die()
5408 + dwarf2_get_ref_die_offset (&attr, cu); in read_partial_die()
5438 find_partial_die_in_comp_unit (unsigned long offset, struct dwarf2_cu *cu) in find_partial_die_in_comp_unit() argument
5444 lookup_die = htab_find_with_hash (cu->partial_dies, &part_die, offset); in find_partial_die_in_comp_unit()
5456 find_partial_die (unsigned long offset, struct dwarf2_cu *cu) in find_partial_die() argument
5460 if (offset >= cu->header.offset in find_partial_die()
5461 && offset < cu->header.offset + cu->header.length) in find_partial_die()
5462 return find_partial_die_in_comp_unit (offset, cu); in find_partial_die()
5464 per_cu = dwarf2_find_containing_comp_unit (offset, cu->objfile); in find_partial_die()
5466 if (per_cu->cu == NULL) in find_partial_die()
5468 load_comp_unit (per_cu, cu->objfile); in find_partial_die()
5469 per_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain; in find_partial_die()
5473 per_cu->cu->last_used = 0; in find_partial_die()
5474 return find_partial_die_in_comp_unit (offset, per_cu->cu); in find_partial_die()
5482 struct dwarf2_cu *cu) in fixup_partial_die() argument
5491 spec_die = find_partial_die (part_die->spec_offset, cu); in fixup_partial_die()
5493 fixup_partial_die (spec_die, cu); in fixup_partial_die()
5516 guess_structure_name (part_die, cu); in fixup_partial_die()
5526 struct dwarf2_cu *cu, int *has_children) in read_full_die() argument
5546 abbrev = dwarf2_lookup_abbrev (abbrev_number, cu); in read_full_die()
5566 abfd, info_ptr, cu); in read_full_die()
5572 && (DW_ADDR (&die->attrs[i]) < cu->header.offset in read_full_die()
5574 >= cu->header.offset + cu->header.length))) in read_full_die()
5578 cu->objfile); in read_full_die()
5582 dwarf2_add_dependence (cu, per_cu); in read_full_die()
5590 if (per_cu->cu != NULL) in read_full_die()
5592 per_cu->cu->last_used = 0; in read_full_die()
5611 struct dwarf2_cu *cu) in read_attribute_value() argument
5613 struct comp_unit_head *cu_header = &cu->header; in read_attribute_value()
5622 DW_ADDR (attr) = read_address (abfd, info_ptr, cu, &bytes_read); in read_attribute_value()
5626 blk = dwarf_alloc_block (cu); in read_attribute_value()
5634 blk = dwarf_alloc_block (cu); in read_attribute_value()
5663 blk = dwarf_alloc_block (cu); in read_attribute_value()
5671 blk = dwarf_alloc_block (cu); in read_attribute_value()
5695 DW_ADDR (attr) = cu->header.offset + read_1_byte (abfd, info_ptr); in read_attribute_value()
5699 DW_ADDR (attr) = cu->header.offset + read_2_bytes (abfd, info_ptr); in read_attribute_value()
5703 DW_ADDR (attr) = cu->header.offset + read_4_bytes (abfd, info_ptr); in read_attribute_value()
5707 DW_ADDR (attr) = cu->header.offset + read_8_bytes (abfd, info_ptr); in read_attribute_value()
5711 DW_ADDR (attr) = (cu->header.offset in read_attribute_value()
5718 info_ptr = read_attribute_value (attr, form, abfd, info_ptr, cu); in read_attribute_value()
5732 bfd *abfd, char *info_ptr, struct dwarf2_cu *cu) in read_attribute() argument
5735 return read_attribute_value (attr, abbrev->form, abfd, info_ptr, cu); in read_attribute()
5783 read_address (bfd *abfd, char *buf, struct dwarf2_cu *cu, int *bytes_read) in read_address() argument
5785 struct comp_unit_head *cu_header = &cu->header; in read_address()
6072 set_cu_language (unsigned int lang, struct dwarf2_cu *cu) in set_cu_language() argument
6078 cu->language = language_c; in set_cu_language()
6081 cu->language = language_cplus; in set_cu_language()
6086 cu->language = language_fortran; in set_cu_language()
6089 cu->language = language_asm; in set_cu_language()
6092 cu->language = language_java; in set_cu_language()
6096 cu->language = language_ada; in set_cu_language()
6103 cu->language = language_minimal; in set_cu_language()
6106 cu->language_defn = language_def (cu->language); in set_cu_language()
6112 dwarf2_attr (struct die_info *die, unsigned int name, struct dwarf2_cu *cu) in dwarf2_attr() argument
6127 return dwarf2_attr (follow_die_ref (die, spec, cu), name, cu); in dwarf2_attr()
6137 dwarf2_flag_true_p (struct die_info *die, unsigned name, struct dwarf2_cu *cu) in dwarf2_flag_true_p() argument
6139 struct attribute *attr = dwarf2_attr (die, name, cu); in dwarf2_flag_true_p()
6145 die_is_declaration (struct die_info *die, struct dwarf2_cu *cu) in die_is_declaration() argument
6154 return (dwarf2_flag_true_p (die, DW_AT_declaration, cu) in die_is_declaration()
6155 && dwarf2_attr (die, DW_AT_specification, cu) == NULL); in die_is_declaration()
6162 die_specification (struct die_info *die, struct dwarf2_cu *cu) in die_specification() argument
6164 struct attribute *spec_attr = dwarf2_attr (die, DW_AT_specification, cu); in die_specification()
6169 return follow_die_ref (die, spec_attr, cu); in die_specification()
6259 struct dwarf2_cu *cu) in dwarf_decode_line_header() argument
6291 read_initial_length (abfd, line_ptr, &cu->header, &bytes_read); in dwarf_decode_line_header()
6302 lh->header_length = read_offset (abfd, line_ptr, &cu->header, &bytes_read); in dwarf_decode_line_header()
6367 check_cu_functions (CORE_ADDR address, struct dwarf2_cu *cu) in check_cu_functions() argument
6372 if (!cu->first_fn) in check_cu_functions()
6375 if (!cu->cached_fn) in check_cu_functions()
6376 cu->cached_fn = cu->first_fn; in check_cu_functions()
6378 fn = cu->cached_fn; in check_cu_functions()
6385 fn = cu->first_fn; in check_cu_functions()
6386 while (fn && fn != cu->cached_fn) in check_cu_functions()
6425 struct dwarf2_cu *cu, struct partial_symtab *pst) in dwarf_decode_lines() argument
6432 struct objfile *objfile = cu->objfile; in dwarf_decode_lines()
6486 check_cu_functions (address, cu)); in dwarf_decode_lines()
6506 address = read_address (abfd, line_ptr, cu, &bytes_read); in dwarf_decode_lines()
6539 check_cu_functions (address, cu)); in dwarf_decode_lines()
6672 struct dwarf2_cu *cu) in var_decode_location() argument
6674 struct objfile *objfile = cu->objfile; in var_decode_location()
6675 struct comp_unit_head *cu_header = &cu->header; in var_decode_location()
6707 read_address (objfile->obfd, DW_BLOCK (attr)->data + 1, cu, &dummy); in var_decode_location()
6722 dwarf2_symbol_mark_computed (attr, sym, cu); in var_decode_location()
6733 new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) in new_symbol() argument
6735 struct objfile *objfile = cu->objfile; in new_symbol()
6745 name = dwarf2_linkage_name (die, cu); in new_symbol()
6757 SYMBOL_LANGUAGE (sym) = cu->language; in new_symbol()
6767 SYMBOL_TYPE (sym) = die_type (die, cu); in new_symbol()
6768 attr = dwarf2_attr (die, DW_AT_decl_line, cu); in new_symbol()
6776 attr = dwarf2_attr (die, DW_AT_low_pc, cu); in new_symbol()
6787 attr2 = dwarf2_attr (die, DW_AT_external, cu); in new_symbol()
6794 add_symbol_to_list (sym, cu->list_in_scope); in new_symbol()
6806 attr = dwarf2_attr (die, DW_AT_const_value, cu); in new_symbol()
6809 dwarf2_const_value (attr, sym, cu); in new_symbol()
6810 attr2 = dwarf2_attr (die, DW_AT_external, cu); in new_symbol()
6814 add_symbol_to_list (sym, cu->list_in_scope); in new_symbol()
6817 attr = dwarf2_attr (die, DW_AT_location, cu); in new_symbol()
6820 var_decode_location (attr, sym, cu); in new_symbol()
6821 attr2 = dwarf2_attr (die, DW_AT_external, cu); in new_symbol()
6825 add_symbol_to_list (sym, cu->list_in_scope); in new_symbol()
6835 attr2 = dwarf2_attr (die, DW_AT_external, cu); in new_symbol()
6837 && dwarf2_attr (die, DW_AT_type, cu) != NULL) in new_symbol()
6845 attr = dwarf2_attr (die, DW_AT_location, cu); in new_symbol()
6848 var_decode_location (attr, sym, cu); in new_symbol()
6853 attr = dwarf2_attr (die, DW_AT_const_value, cu); in new_symbol()
6856 dwarf2_const_value (attr, sym, cu); in new_symbol()
6858 add_symbol_to_list (sym, cu->list_in_scope); in new_symbol()
6877 if (cu->language == language_cplus in new_symbol()
6878 || cu->language == language_java) in new_symbol()
6905 list_to_add = (cu->list_in_scope == &file_symbols in new_symbol()
6906 && (cu->language == language_cplus in new_symbol()
6907 || cu->language == language_java) in new_symbol()
6908 ? &global_symbols : cu->list_in_scope); in new_symbol()
6916 if (cu->language == language_cplus in new_symbol()
6917 || cu->language == language_java) in new_symbol()
6939 name, cu); in new_symbol()
6943 add_symbol_to_list (sym, cu->list_in_scope); in new_symbol()
6949 add_symbol_to_list (sym, cu->list_in_scope); in new_symbol()
6957 name, cu); in new_symbol()
6959 attr = dwarf2_attr (die, DW_AT_const_value, cu); in new_symbol()
6962 dwarf2_const_value (attr, sym, cu); in new_symbol()
6970 list_to_add = (cu->list_in_scope == &file_symbols in new_symbol()
6971 && (cu->language == language_cplus in new_symbol()
6972 || cu->language == language_java) in new_symbol()
6973 ? &global_symbols : cu->list_in_scope); in new_symbol()
6999 struct dwarf2_cu *cu) in dwarf2_const_value() argument
7001 struct objfile *objfile = cu->objfile; in dwarf2_const_value()
7002 struct comp_unit_head *cu_header = &cu->header; in dwarf2_const_value()
7101 die_type (struct die_info *die, struct dwarf2_cu *cu) in die_type() argument
7107 type_attr = dwarf2_attr (die, DW_AT_type, cu); in die_type()
7111 return dwarf2_fundamental_type (cu->objfile, FT_VOID, cu); in die_type()
7114 type_die = follow_die_ref (die, type_attr, cu); in die_type()
7116 type = tag_type_to_type (type_die, cu); in die_type()
7121 cu->objfile->name); in die_type()
7130 die_containing_type (struct die_info *die, struct dwarf2_cu *cu) in die_containing_type() argument
7136 type_attr = dwarf2_attr (die, DW_AT_containing_type, cu); in die_containing_type()
7139 type_die = follow_die_ref (die, type_attr, cu); in die_containing_type()
7140 type = tag_type_to_type (type_die, cu); in die_containing_type()
7147 cu->objfile->name); in die_containing_type()
7153 tag_type_to_type (struct die_info *die, struct dwarf2_cu *cu) in tag_type_to_type() argument
7161 read_type_die (die, cu); in tag_type_to_type()
7166 cu->objfile->name); in tag_type_to_type()
7173 read_type_die (struct die_info *die, struct dwarf2_cu *cu) in read_type_die() argument
7175 char *prefix = determine_prefix (die, cu); in read_type_die()
7185 read_structure_type (die, cu); in read_type_die()
7188 read_enumeration_type (die, cu); in read_type_die()
7192 read_subroutine_type (die, cu); in read_type_die()
7195 read_array_type (die, cu); in read_type_die()
7198 read_tag_pointer_type (die, cu); in read_type_die()
7201 read_tag_ptr_to_member_type (die, cu); in read_type_die()
7204 read_tag_reference_type (die, cu); in read_type_die()
7207 read_tag_const_type (die, cu); in read_type_die()
7210 read_tag_volatile_type (die, cu); in read_type_die()
7213 read_tag_string_type (die, cu); in read_type_die()
7216 read_typedef (die, cu); in read_type_die()
7219 read_subrange_type (die, cu); in read_type_die()
7222 read_base_type (die, cu); in read_type_die()
7242 determine_prefix (struct die_info *die, struct dwarf2_cu *cu) in determine_prefix() argument
7246 if (cu->language != language_cplus in determine_prefix()
7247 && cu->language != language_java) in determine_prefix()
7270 char *parent_prefix = determine_prefix (parent, cu); in determine_prefix()
7273 cu), in determine_prefix()
7274 cu); in determine_prefix()
7290 char *new_prefix = determine_prefix (parent, cu); in determine_prefix()
7294 retval = determine_class_name (parent, cu); in determine_prefix()
7302 return determine_prefix (parent, cu); in determine_prefix()
7317 struct dwarf2_cu *cu) in typename_concat() argument
7323 else if (cu->language == language_java) in typename_concat()
7351 dwarf_base_type (int encoding, int size, struct dwarf2_cu *cu) in dwarf_base_type() argument
7353 struct objfile *objfile = cu->objfile; in dwarf_base_type()
7361 type = dwarf2_fundamental_type (objfile, FT_VOID, cu); in dwarf_base_type()
7364 type = dwarf2_fundamental_type (objfile, FT_BOOLEAN, cu); in dwarf_base_type()
7369 type = dwarf2_fundamental_type (objfile, FT_DBL_PREC_COMPLEX, cu); in dwarf_base_type()
7373 type = dwarf2_fundamental_type (objfile, FT_COMPLEX, cu); in dwarf_base_type()
7379 type = dwarf2_fundamental_type (objfile, FT_DBL_PREC_FLOAT, cu); in dwarf_base_type()
7383 type = dwarf2_fundamental_type (objfile, FT_FLOAT, cu); in dwarf_base_type()
7390 type = dwarf2_fundamental_type (objfile, FT_SIGNED_CHAR, cu); in dwarf_base_type()
7393 type = dwarf2_fundamental_type (objfile, FT_SIGNED_SHORT, cu); in dwarf_base_type()
7397 type = dwarf2_fundamental_type (objfile, FT_SIGNED_INTEGER, cu); in dwarf_base_type()
7402 type = dwarf2_fundamental_type (objfile, FT_SIGNED_CHAR, cu); in dwarf_base_type()
7408 type = dwarf2_fundamental_type (objfile, FT_UNSIGNED_CHAR, cu); in dwarf_base_type()
7411 type = dwarf2_fundamental_type (objfile, FT_UNSIGNED_SHORT, cu); in dwarf_base_type()
7415 type = dwarf2_fundamental_type (objfile, FT_UNSIGNED_INTEGER, cu); in dwarf_base_type()
7420 type = dwarf2_fundamental_type (objfile, FT_UNSIGNED_CHAR, cu); in dwarf_base_type()
7423 type = dwarf2_fundamental_type (objfile, FT_SIGNED_INTEGER, cu); in dwarf_base_type()
7472 dwarf2_linkage_name (struct die_info *die, struct dwarf2_cu *cu) in dwarf2_linkage_name() argument
7476 attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu); in dwarf2_linkage_name()
7479 attr = dwarf2_attr (die, DW_AT_name, cu); in dwarf2_linkage_name()
7488 dwarf2_name (struct die_info *die, struct dwarf2_cu *cu) in dwarf2_name() argument
7492 attr = dwarf2_attr (die, DW_AT_name, cu); in dwarf2_name()
7502 dwarf2_extension (struct die_info *die, struct dwarf2_cu *cu) in dwarf2_extension() argument
7506 attr = dwarf2_attr (die, DW_AT_extension, cu); in dwarf2_extension()
7510 return follow_die_ref (die, attr, cu); in dwarf2_extension()
8401 struct dwarf2_cu *cu) in store_in_ref_table() argument
8407 old = cu->die_ref_table[h]; in store_in_ref_table()
8409 cu->die_ref_table[h] = die; in store_in_ref_table()
8413 dwarf2_get_ref_die_offset (struct attribute *attr, struct dwarf2_cu *cu) in dwarf2_get_ref_die_offset() argument
8459 struct dwarf2_cu *cu) in follow_die_ref() argument
8467 offset = dwarf2_get_ref_die_offset (attr, cu); in follow_die_ref()
8469 if (DW_ADDR (attr) < cu->header.offset in follow_die_ref()
8470 || DW_ADDR (attr) >= cu->header.offset + cu->header.length) in follow_die_ref()
8474 cu->objfile); in follow_die_ref()
8475 target_cu = per_cu->cu; in follow_die_ref()
8478 target_cu = cu; in follow_die_ref()
8491 (long) src_die->offset, (long) offset, cu->objfile->name); in follow_die_ref()
8498 struct dwarf2_cu *cu) in dwarf2_fundamental_type() argument
8510 if (cu->ftypes[typeid] == NULL) in dwarf2_fundamental_type()
8512 cu->ftypes[typeid] = cu->language_defn->la_fund_type (objfile, typeid); in dwarf2_fundamental_type()
8515 return (cu->ftypes[typeid]); in dwarf2_fundamental_type()
8544 decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu) in decode_locdesc() argument
8546 struct objfile *objfile = cu->objfile; in decode_locdesc()
8547 struct comp_unit_head *cu_header = &cu->header; in decode_locdesc()
8650 cu, &bytes_read); in decode_locdesc()
8747 dwarf_alloc_block (struct dwarf2_cu *cu) in dwarf_alloc_block() argument
8752 obstack_alloc (&cu->comp_unit_obstack, sizeof (struct dwarf_block)); in dwarf_alloc_block()
8757 dwarf_alloc_abbrev (struct dwarf2_cu *cu) in dwarf_alloc_abbrev() argument
8762 obstack_alloc (&cu->abbrev_obstack, sizeof (struct abbrev_info)); in dwarf_alloc_abbrev()
9020 struct dwarf2_cu *cu) in dwarf_decode_macros() argument
9097 lh, cu->objfile); in dwarf_decode_macros()
9168 struct dwarf2_cu *cu) in dwarf2_symbol_mark_computed() argument
9174 baton = obstack_alloc (&cu->objfile->objfile_obstack, in dwarf2_symbol_mark_computed()
9176 baton->objfile = cu->objfile; in dwarf2_symbol_mark_computed()
9182 baton->base_address = cu->header.base_address; in dwarf2_symbol_mark_computed()
9183 if (cu->header.base_known == 0) in dwarf2_symbol_mark_computed()
9194 baton = obstack_alloc (&cu->objfile->objfile_obstack, in dwarf2_symbol_mark_computed()
9196 baton->objfile = cu->objfile; in dwarf2_symbol_mark_computed()
9283 struct dwarf2_cu *cu = data; in free_one_comp_unit() local
9285 if (cu->per_cu != NULL) in free_one_comp_unit()
9286 cu->per_cu->cu = NULL; in free_one_comp_unit()
9287 cu->per_cu = NULL; in free_one_comp_unit()
9289 obstack_free (&cu->comp_unit_obstack, NULL); in free_one_comp_unit()
9290 if (cu->dies) in free_one_comp_unit()
9291 free_die_list (cu->dies); in free_one_comp_unit()
9293 xfree (cu); in free_one_comp_unit()
9306 struct dwarf2_cu *cu = data; in free_stack_comp_unit() local
9308 obstack_free (&cu->comp_unit_obstack, NULL); in free_stack_comp_unit()
9309 cu->partial_dies = NULL; in free_stack_comp_unit()
9311 if (cu->per_cu != NULL) in free_stack_comp_unit()
9315 cu->per_cu->cu = NULL; in free_stack_comp_unit()
9316 cu->per_cu = NULL; in free_stack_comp_unit()
9337 next_cu = per_cu->cu->read_in_chain; in free_cached_comp_units()
9339 free_one_comp_unit (per_cu->cu); in free_cached_comp_units()
9358 per_cu->cu->last_used ++; in age_cached_comp_units()
9359 if (per_cu->cu->last_used <= dwarf2_max_cache_age) in age_cached_comp_units()
9360 dwarf2_mark (per_cu->cu); in age_cached_comp_units()
9361 per_cu = per_cu->cu->read_in_chain; in age_cached_comp_units()
9370 next_cu = per_cu->cu->read_in_chain; in age_cached_comp_units()
9372 if (!per_cu->cu->mark) in age_cached_comp_units()
9374 free_one_comp_unit (per_cu->cu); in age_cached_comp_units()
9378 last_chain = &per_cu->cu->read_in_chain; in age_cached_comp_units()
9397 next_cu = per_cu->cu->read_in_chain; in free_one_cached_comp_unit()
9399 if (per_cu->cu == target_cu) in free_one_cached_comp_unit()
9401 free_one_comp_unit (per_cu->cu); in free_one_cached_comp_unit()
9406 last_chain = &per_cu->cu->read_in_chain; in free_one_cached_comp_unit()
9445 set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) in set_die_type() argument
9451 if (cu->per_cu == NULL) in set_die_type()
9454 if (cu->per_cu->type_hash == NULL) in set_die_type()
9455 cu->per_cu->type_hash in set_die_type()
9456 = htab_create_alloc_ex (cu->header.length / 24, in set_die_type()
9460 &cu->objfile->objfile_obstack, in set_die_type()
9467 htab_find_slot_with_hash (cu->per_cu->type_hash, &ofs, ofs.offset, INSERT); in set_die_type()
9468 *slot = obstack_alloc (&cu->objfile->objfile_obstack, sizeof (**slot)); in set_die_type()
9492 reset_die_and_siblings_types (struct die_info *start_die, struct dwarf2_cu *cu) in reset_die_and_siblings_types() argument
9496 if (cu->per_cu->type_hash == NULL) in reset_die_and_siblings_types()
9501 die->type = get_die_type (die, cu->per_cu->type_hash); in reset_die_and_siblings_types()
9503 reset_die_and_siblings_types (die->child, cu); in reset_die_and_siblings_types()
9513 dwarf2_add_dependence (struct dwarf2_cu *cu, in dwarf2_add_dependence() argument
9518 if (cu->dependencies == NULL) in dwarf2_add_dependence()
9519 cu->dependencies in dwarf2_add_dependence()
9521 NULL, &cu->comp_unit_obstack, in dwarf2_add_dependence()
9525 slot = htab_find_slot (cu->dependencies, ref_per_cu, INSERT); in dwarf2_add_dependence()
9539 if (per_cu->cu->mark) in dwarf2_mark_helper()
9541 per_cu->cu->mark = 1; in dwarf2_mark_helper()
9543 if (per_cu->cu->dependencies != NULL) in dwarf2_mark_helper()
9544 htab_traverse (per_cu->cu->dependencies, dwarf2_mark_helper, NULL); in dwarf2_mark_helper()
9550 dwarf2_mark (struct dwarf2_cu *cu) in dwarf2_mark() argument
9552 if (cu->mark) in dwarf2_mark()
9554 cu->mark = 1; in dwarf2_mark()
9555 if (cu->dependencies != NULL) in dwarf2_mark()
9556 htab_traverse (cu->dependencies, dwarf2_mark_helper, NULL); in dwarf2_mark()
9564 per_cu->cu->mark = 0; in dwarf2_clear_marks()
9565 per_cu = per_cu->cu->read_in_chain; in dwarf2_clear_marks()